SAS® 9.4 Macro Language: Reference
Macro programming is not dependent on the user interface or the runmode.
@srinijareddy wrote:
Okay. But I want to know that can I find any basic explanations on how macros will be used in different environments
Just in case it has escaped you:
Macro programming is not dependent on the user interface or the runmode.
@DavidHD wrote:
While I generally agree I would add to this, that the run mode can have an influence if different autoexec are used because of e.g. different server context (SAS App vs SAS DI as a concrete example).
You could have different macro parameters/variables, yes, but the macro language will be the same.
And changes between environments would be site-specific and documented there, but not in any publicly available resource.
@srinijareddy wrote:
Okay. But I want to know that can I find any basic explanations on how macros will be used in different environments
The SAS macro language writes code statements.
There will not be any difference in behavior for the generated statements by "environment" than if you wrote the code and ran it.
>> The SAS macro language writes code statements. <<
That's a narrow view of what the macro facility can do. It can also prompt the user for input, read to and write from external files, obtain information about the programming environment, and create librefs and filerefs, all without generating any non-macro code.
@JackHamilton wrote:
>> The SAS macro language writes code statements. <<
That's a narrow view of what the macro facility can do. It can also prompt the user for input, read to and write from external files, obtain information about the programming environment, and create librefs and filerefs, all without generating any non-macro code.
Yes you can write a lot of Fopen, and related read and write stuff. ALL of it uses datastep functions with %sysfunc, which statement was not available when I first delved into learning macro code with SAS 5.
So I would not consider that a pure macro facility. In fact in many ways obfuscating stuff that may be better done with a data step.
If by "prompt for use input" by using the %window code, same thing basically as Window from the data step. If the later EG "prompt" that is not the quite the same a using pure macro code to get such in general.
I pity anyone going down the road of writing 50 page reports using %sysfunc(Fput,id,%somemacrovalue) statements.
Prompting for user input from code is largely obsolete, as defined user prompts for EG nodes and stored processes have taken over that functionality. User inputs from code can't be done in a client/server environment.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.