-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgetoption.sas
48 lines (35 loc) · 1.58 KB
/
getoption.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
%macro GetOption(option,global=N) / des="Find specified option";
/********************************************************************************
BEGIN MACRO HEADER
********************************************************************************
Name: GetOption
Author: Chris Swenson
Created: 2009-10-23
Purpose: Find a specified option
Arguments: option - option to examine
global= - whether to output a global macro variable
Revisions
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Date Author Comments
¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯
YYYY-MM-DD III Please use this format and insert new entries above
********************************************************************************
END MACRO HEADER
********************************************************************************/
%if %superq(OPTION)=%str() %then %do;
%put %str(E)RROR: No option specified.;
%return;
%end;
%if %index(*Y*N*,%upcase(*&GLOBAL*))=0 %then %do;
%put %str(E)RROR: %str(I)nvalid value for global argument. Please use Y or N.;
%return;
%end;
%if %upcase(&GLOBAL)=Y %then %do;
%global user_&option;
%end;
%if &option= %then %put NOTE: No argument specified.;
%else %do;
%let User_&option=%sysfunc(getoption(%unquote(%superq(OPTION))));
%put NOTE: User_&option=&&User_&option;
%end;
%mend GetOption;