Hi,
Step1:
Shell script that call a SAS program that in turn call a macro - for
(Very basic not problem... skipping this part)
Step2a:signon and Step2b: a macro for the rsubmit
Stpe2a:
/*Grid Enabling section*/
%_engridson;
/*End of Enablement Signon*/
Macro Step2a
%MACRO _engridson;
%let rc=%sysfunc(grdsvc_enable(_all_,resource=SASAppCore));
%let rc=%sysfunc(grdsvc_nnodes(resource=SASAppCore));
%put Number of Grid Nodes=&rc;
options autosignon;
/*options NOSIGNONWAIT;*/
%MEND _engridson;
/***********************************************************************************************************************************/
Step2b: all twice due to the two tasks
OPTIONS FULLSTIMER SOURCE SOURCE2 MSGLEVEL=I MPRINT NOTES;
/***************START OF TASK 1 *****************/
/*********Task 1 To be sumbitted via enabling****/
%let tskid=T1&SYSJOBID;
%_engridrm (&tskid , job=%str(%include "/sas/$sasenvroot/sasadmu/gschedule/GridEnabled1.sas"));
/****************END OF TASK 1 ******************/
/***************START OF TASK 2 *****************/
/*********Task 2 To be sumbitted via enabling****/
%let tskid=T2&SYSJOBID;
/*%_engridrm (&tskid , job=%str(%include "/sas/$sasenvroot/sasadmu/gschedule/GridEnabled2.sas"));*/
/****************END OF TASK 2 ******************/
Maro for Step2a:
%MACRO _engridson;
%let rc=%sysfunc(grdsvc_enable(_all_,resource=SASAppCore));
%let rc=%sysfunc(grdsvc_nnodes(resource=SASAppCore));
%put Number of Grid Nodes=&rc;
options autosignon;
/*options NOSIGNONWAIT;*/
%MEND _engridson;
Macro Step2b:
%MACRO _engridrm (tskid ,job=);
%syslput jobs=&job/remote=&tskid;
rsubmit &tskid wait=no ;
%put %sysfunc(pathname(work));
&jobs;
endrsubmit;
waitfor _all_ &tskid;
%MEND _engridrm;
/***********************************************************************************************************************************/
Here are my issues:
1. The jobs run sequentially, I would like them to submit parallel
2. I would like to use:
SIGNON &tsksess1 SIGNONWAIT=NO ;
In my Step2b Macro to signing on dynamically and achieve number 1 of my issues. Currently I am using this:
%_engridson(&tsksess1,&mySignonVar1); but getting this error:
Log details:
34 RSUBMIT mySess2 WAIT=NO CMACVAR=myRsubmitVar&openSessID;
ERROR: A link must be established by executing the SIGNON command before you can communicate with MYSESS2.
NOTE: Subsequent lines will be ignored until ENDRSUBMIT.
If you are just trying to parallel process jobs, the easiest solution I have seen is just to sign on the grid once and do something like:
%let rc=%sysfunc(grdsvc_enable(_all_,server=SASApp_Grid));
options autosignon;
rsubmit task1 wait=no;
%Main_Method(1);
endrsubmit;
rsubmit task2 wait=no;
%Main_Method(2);
endrsubmit;
signoff _all_;
If you are just trying to parallel process jobs, the easiest solution I have seen is just to sign on the grid once and do something like:
%let rc=%sysfunc(grdsvc_enable(_all_,server=SASApp_Grid));
options autosignon;
rsubmit task1 wait=no;
%Main_Method(1);
endrsubmit;
rsubmit task2 wait=no;
%Main_Method(2);
endrsubmit;
signoff _all_;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.