Is there any macro command that allows calling one program from another (the %run_program()
pseudo code)?
Program "Settings":
%let myvar="HELLO WORLD!";
Program "Program":
%run_program(Settings); *Pseudo-code;
%put &myvar; *Should print *Should print "HELLO WORLD!";
You can call a macro within a macro. Here is a trivial example. %macro one(dsn); proc print data=&dsn; run; %mend one; %macro two(dslist); %local i; %do i=1 %to %sysfunc(countw(&dslist)); %one(%scan(&dslist,&i)); %end; %mend two; %two(sashelp.
The macro DATASETS is used for the executing a DATA step which creates a dataset per student name. The macro parameter NAME is the student's name which is passed to the macro. To execute the macro for each name a Call Execute is used inside the DATA _NULL_ step. The data step first reads observations from the SASHELP.
Macros are compiled programs that you can call in a submitted SAS program or from a SAS command prompt. Like macro variables, you generally use macros to generate text. However, macros provide additional capabilities: Macros can contain programming statements that enable you to control how and when text is generated.
CALL EXECUTE is a very useful DATA step function which helps you stack up many SAS statements and run them together. It interacts with SAS Macro facility for immediate macro execution during the execution of DATA step.
This is not exact answer on your question, but if you only want to be sure that Settings
is run before Program
when Run Process Flow
you can link them together.
Settings
,Link Settings to...
, Program
from the dialog.Run Process FLow
And see the Hello World
be printed in the log.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With