BookmarkSubscribeRSS Feed
Asbon
Obsidian | Level 7

Hi,

Below is SAS code, which is scheduled in Tivoli. it is scheduled for every 5 minutes (1 hour actual time).
based on time, below code will trigger another codes by rsubmit.

eg:-at 20:15 this code is triggered in Tivoli where 2 rsubmit code are running(still in progress, it'll take 20 minutes to finish job)

At 20:20 Tivoli will trigger same sas code again, based on condition given in code, it should trigger another set of sas code as below.

 

is this scenario possiable by using Rsubmit. because this functionality is hapenning by call execute.

we want to convert it into rsubmit due to compliances.

 

%let date=%sysfunc(today(), yymmdd6.);
%let time=%sysfunc(time(), hhmm); %put &time;
 
data _null_;
/*time=scan(strip("&time."),1,':');*/
time=strip("&time.");
call symput('tm',strip(time));
call symput('week',strip(weekday(today())));
run ;
%put x&tm.z a&week.b;
%global x y;
%let x=Default;
%let y=Default;
 
filename donef '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_done';
 
filename mylog1 '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_a.log';
filename mylog2 '/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_b.log';
 
%macro test;
 
data _null_;
 
%if &tm. = 20:15 or &tm.= 20:15 or &tm. = '20:15' %then %do;
options sascmd="sas";
SIGNON tes_a ; 
RSUBMIT wait=no log=mylog1 ;
%let x=Success1;
%include "/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_a.sas";
endrsubmit;
 
SIGNON tes_b ; 
RSUBMIT wait=no  log=mylog2 ;
%let x=Success1;
%include "/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_b.sas";
endrsubmit;
signoff _all_;
%end;
 
%else %if &tm. = 20:20 or &tm.= 20:20 or &tm. = '20:20' %then %do;
options sascmd="sas";
 
SIGNON tes_c ; 
RSUBMIT wait=no log=mylog3 ;
%let x=Success2;
%include "/sasdata/cro_rte/user_libs/crm_prod/aasbon/systask/rsubmit/sreeni/tes_c.sas";
endrsubmit;
signoff  tes_c;
%end;

run;

%mend test;

%test;
%put a&x.z;

data _null_;
file donef;
run;

 

Help is appreciable.

 

Thanks,

Kenneth.

2 REPLIES 2
Patrick
Opal | Level 21

Why do you need this rsubmit blocks at all? Can't you just schedule these jobs separately in Tivoli? 

...and if in your real case the master job needs to pass some parameters to dependent jobs then consider using a control table. With control tables I normally prefer to use a database to avoid any locking issues and allow for concurrency - but it's also possible with SAS tables and libname option filelockwait=<n>.

doug_sas
SAS Employee

Since your RSUBMITs are followed immediately by SIGNOFFs, the CONNECT servers may be torn down before your code completes. You need to add WAITFOR statements to cause the SIGNOFFs to wait until the RSUBMIT code blocks complete.

 

I will agree with Patrick that having Tivoli just schedule all three jobs at the proper time seems like a easier approach.

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
  • 2 replies
  • 359 views
  • 0 likes
  • 3 in conversation