CORE
mf_verifymacvars.sas
Go to the documentation of this file.
1 
34 %macro mf_verifymacvars(
35  verifyVars /* list of macro variable NAMES */
36  ,makeUpcase=NO /* set to YES to make all the variable VALUES uppercase */
37  ,mAbort=SOFT
38  );
39 
40  %local verifyIterator verifyVar abortmsg;
41  %do verifyIterator=1 %to %sysfunc(countw(&verifyVars,%str( )));
42  %let verifyVar=%qscan(&verifyVars,&verifyIterator,%str( ));
43  %if not %symexist(&verifyvar) %then %do;
44  %let abortmsg= Variable &verifyVar is MISSING;
45  %goto exit_error;
46  %end;
47  %if %length(&&&verifyVar)=0 %then %do;
48  %let abortmsg= Variable &verifyVar is EMPTY;
49  %goto exit_error;
50  %end;
51  %if &makeupcase=YES %then %do;
52  %let &verifyVar=%upcase(&&&verifyvar);
53  %end;
54  %end;
55 
56  %goto exit_success;
57  %exit_error:
58  %if &mAbort=SOFT %then %put ERROR: &abortmsg;
59  %else %mf_abort(mac=mf_verifymacvars,type=&mfabort,msg=&abortmsg);
60  %exit_success:
61 
62 %mend;