12.07.2015 Views

List Processing Basics: Creating and Using Lists of Macro ... - NESUG

List Processing Basics: Creating and Using Lists of Macro ... - NESUG

List Processing Basics: Creating and Using Lists of Macro ... - NESUG

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>NESUG</strong> 2007H<strong>and</strong>s-On WorkshopsEx10.sas1 * Ex10.sas: vertical: ;2 * add prefix <strong>and</strong> suffix;3 * call execute without nrstr;45 options nosource2;%*echo Include to log;6 %Include Project(make-unique-sort);7 %Include Project(Report-Region-macro);8 %Include Project(ReportTest);9 %* NOTE: not works correctly!;10 options mprint;1112 DATA _Null_;13 set Regions;14 call execute(’%ReportTest(Region=’15 || Region || ’)’);16 *call execute(’%Report (Region=’17 || Region || ’)’);18 run;%*calls executed here;19 run;see: write-calls-call-execute, pg. 11See explanation at Caveat, pg. 10Ex11.sas1 * Ex11.sas: vertical: ;2 * add prefix <strong>and</strong> suffix;3 * call execute with nrstr;45 options nosource2;%*echo Include to log;6 %Include Project(make-unique-sort);7 %Include Project(Report-Region-macro);8 %Include Project(ReportTest);9 *Include Project(ReportTestVarValue);10 options mprint;1112 DATA _Null_;13 set Regions;14 call execute(15 cats(16 ’%nrstr(’17 ,’%ReportTest(Region=’18 , Region19 , ’)’ %*end macro;20 ,’)’ %*end nrstr;21 ) %*end cats;22 ); %*end execute;23 run;%*calls executed here;24 run;2526 *task: execute ReportTest27 * with the Var=28 * Value= parameters;29 *solution: see write-calls-call-execute;30 *solution: see Ex11-solution;19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!