Thursday, September 11, 2014

System options to introduce code

I don't want to change any existing code in the complicated SAS environment. Because the codes may be there for years and are working well, you have to explain or communicate a lot to make one little harmless change. It is smart to insert the code using system options when you kick off SAS batch.
#1. -append/-insert the program in autoexec system option
$ sas_batch.sh sas_program.sas -append autoexec sas_program_full_path

#2. -initstmt/-termstmt sytem option
$ sas_batch.sh sas_program.sas -initstmt '*sas codes here;'

Scenario:
All utility macros are stored and reused using macro autocall facility, when you want to test new macro (e.g. macro_new.sas), you can run the same work with new macro as follows:
$ sas_batch.sh sas_program.sas -append autoexec macro_new.sas
$ sas_batch.sh sas_program.sas -initstmt '%inc "macro_new.sas";'
In this way, we can test the new macro without change any existing codes.

No comments: