Hi All,
Is there a way to feed a macro variable into every job in a flow from management console/flow manager? Without having to change every individual job or is there a way to define an environment variable set in management console as a macro variable in SAS? It isn't recognising the macro variables set at the moment
Thanks
SS
If you are using the LSF scheduler in SMC then you can add an environment variable to the job then use the SYSGET SAS function to read that into a macro variable. We use this technique ourselves and it is a great way to supply job inputs automatically.
%let batch_var = %sysfunc(sysget(batch_var)); * Reads an environment variable called batch_var.;
When the SAS session starts, it's already running with the correct user-id, so you can query that in the autoexec.sas by using
%if %sysget(USER) = ....
%then %do;
%let macrovar = ....;
%end;
If you are using the LSF scheduler in SMC then you can add an environment variable to the job then use the SYSGET SAS function to read that into a macro variable. We use this technique ourselves and it is a great way to supply job inputs automatically.
%let batch_var = %sysfunc(sysget(batch_var)); * Reads an environment variable called batch_var.;
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to explore data assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.