Most often than not, we tend to run the SAS program in command lines. If the SAS is present in UNIX, we open a client terminal like PuTTY or SSH terminal and invoke the SAS program. If the SAS is present in Windows, then we can do the same by opening command mode.
The sytax for invoking the SAS Program is as follows:
sas <path and program-name>.sas
We need to make sure that the path of sas executable is present in the PATH enviroinment variable.
What is more interesting are the other command line arguments that we can pass while invoking a SAS program as mentioned above in the command line. Below, I've tried to illustrate each of them with the sytax and usage detail:
We can invoke the SAS program in the command mode as follows:
sas class.sas -sysparm "14"
One can even send a list of key-value pair values through the program which will feed-in to a macro.
Let me know your thoughts!
The sytax for invoking the SAS Program is as follows:
sas <path and program-name>.sas
We need to make sure that the path of sas executable is present in the PATH enviroinment variable.
What is more interesting are the other command line arguments that we can pass while invoking a SAS program as mentioned above in the command line. Below, I've tried to illustrate each of them with the sytax and usage detail:
- SYSPARM: This is the most useful option that I have come across. This lets us send parameters to the SAS programs through the command line prompt. The value of the SYSPARM is saved under the macro variable- SYSPARM, which can be accessed within the program. For Example, the below code - class.sas lets us send the age as a parameter while invoking the SAS Program.
%put &sysparm;
proc print data=sashelp.class noobs;
where age=&sysparm.;
run;
We can invoke the SAS program in the command mode as follows:
sas class.sas -sysparm "14"
One can even send a list of key-value pair values through the program which will feed-in to a macro.
- LOG: This option would redirect the log file to the specified location instead of the default location.
- WORK: This would help us specify the work directory location instead of the default work place.
Let me know your thoughts!