-
Notifications
You must be signed in to change notification settings - Fork 2
/
_version.sas
118 lines (79 loc) · 3.17 KB
/
_version.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
%put NOTE: You have called the macro _VERSION, 2006-02-15.;
%put NOTE: Copyright (c) 2001-2006 Rodney Sparapani;
%put;
/*
Author: Rodney Sparapani <rsparapa@mcw.edu>
Created: 2001-00-00
This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this file; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* _VERSION Documentation
Returns a one (true) if the current version of SAS is equal to or
greater than the version requested; zero (false) otherwise.
POSITIONAL Parameters
ARG1 version requested
Specific OPTIONAL Parameters
NOTES= default is to not display the returned value in a NOTE,
if set to something, then do display
VERSION=ARG1 alias
*/
%macro _version(arg1, notes=, version=&arg1);
%local result;
%let result=%eval(%scan(&sysver, 1, .)*100+0%scan(&sysver, 2, .)>=%scan(&version, 1, .)*100+0%scan(&version, 2, .));
%if %length(¬es) %then %put NOTE: _VERSION is returning the value &result;
&result
%mend _version;
%*VALIDATION TEST STREAM;
/* un-comment to re-validate
*VERSION 5 OR HIGHER;
%put NOTE: RETURN CODE=%_version(5, notes=1);
*VERSION 6 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6 notes=1);
*VERSION 6.03 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.03, notes=1);
*VERSION 6.04 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.04, notes=1);
*VERSION 6.06 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.06, notes=1);
*VERSION 6.07 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.07, notes=1);
*VERSION 6.08 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.08, notes=1);
*VERSION 6.09 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.09, notes=1);
*VERSION 6.10 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.10, notes=1);
*VERSION 6.11 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.11, notes=1);
*VERSION 6.12 OR HIGHER;
%put NOTE: RETURN CODE=%_version(6.12, notes=1);
*VERSION 7 OR HIGHER;
%put NOTE: RETURN CODE=%_version(7, notes=1);
*VERSION 7 OR HIGHER;
%put NOTE: RETURN CODE=%_version(7);
*VERSION 8 OR HIGHER;
%put NOTE: RETURN CODE=%_version(8, notes=1);
*VERSION 8 OR HIGHER;
%put NOTE: RETURN CODE=%_version(8);
*VERSION 8.2 OR HIGHER;
%put NOTE: RETURN CODE=%_version(8.2, notes=1);
*VERSION 8.2 OR HIGHER;
%put NOTE: RETURN CODE=%_version(8.2);
*VERSION 9 OR HIGHER;
%put NOTE: RETURN CODE=%_version(9, notes=1);
*VERSION 9 OR HIGHER;
%put NOTE: RETURN CODE=%_version(9);
*VERSION 9.1 OR HIGHER;
%put NOTE: RETURN CODE=%_version(9.1, notes=1);
*VERSION 9.1 OR HIGHER;
%put NOTE: RETURN CODE=%_version(9.1);
*/