Signon and rsubmit to SAS Grid using a SAS Macro

Accepted Solution Solved
Reply
Highlighted
Occasional Contributor
Posts: 13
Accepted Solution

Signon and rsubmit to SAS Grid using a SAS Macro

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.


Accepted Solutions
Solution
‎02-12-2018 01:51 AM
Occasional Contributor
Posts: 16

Re: Signon and rsubmit to SAS Grid using a SAS Macro

Posted in reply to Deonjpret

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_;

View solution in original post


All Replies
Solution
‎02-12-2018 01:51 AM
Occasional Contributor
Posts: 16

Re: Signon and rsubmit to SAS Grid using a SAS Macro

Posted in reply to Deonjpret

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_;

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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