BookmarkSubscribeRSS Feed
SAShole
Pyrite | Level 9

I have a scheduled job flow that runs once a week and calls 50 individual reports. The program looks like this:

 

options NoSyntaxCheck;

%include 'N:\Organization\Work\Prog1.sas';
%include 'N:\Organization\Work\Prog2.sas';
....
%include 'N:\Organization\Work\Prog50.sas';

I would like some help thinking through the pro's and con's of having one deployed job, that is essentially a driver program versus say 50 individual deployed jobs. One concern I have is macro variables not getting cleared out and affecting subsequent programs. I do have some code in each program that looks like this:

 

%macro delvars;
  data vars;
    set sashelp.vmacro;
  run;

  data _null_;
    set vars;
    temp=lag(name);
    if scope='GLOBAL' and substr(name,1,3) ne 'SYS' and temp ne name then
      call execute('%symdel '||trim(left(name))||';');
  run;

%mend;
%delvars

The NoSyntaxCheck option was necessary to keep the programming running despite one program having an error. I ran into the situation where the client would post an input file with the incorrect name and it would stop the entire process.

 

Any input here is appreciated, thank you.

 

 

 

1 REPLY 1
SASKiwi
PROC Star

I've found moving most global macro variables to the driver program works well for me. That way they are defined once, are easier to maintain, and are available in all called programs.

 

I would change the report with the mis-named input file to not error if the filename is wrong, or move that to it's own separately-scheduled job.

 

My driver program can also be fed a list of programs to be run in a macro variable so it works for any scheduled job and there is only one version.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

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.

Discussion stats
  • 1 reply
  • 372 views
  • 1 like
  • 2 in conversation