DATA Step, Macro, Functions and more

strange %SYSLPUT warning

Accepted Solution Solved
Reply
Contributor
Posts: 26
Accepted Solution

strange %SYSLPUT warning

Here is my macro in SAS 9.3:

%LET GERC=%SYSFUNC( GrdSvc_Enable(_all_,resource=&SASAppSvr.));

%PUT GERC=&GERC.;

OPTIONS noSYMBOLGEN signonwait noMPRINT noMLOGIC NOTES COMPRESS=NO NOFULLSTIMER NOERRORABEND noMFILE;

LIBNAME dissert "*\DATA\";

%MACRO gridsubmit;

%LET tnum=1;

PROC PRINTTO LOG="*\LOGS\grid_enable.log" NEW;

RUN;

%DO start=1 %TO 981 %BY 20;

    SIGNON task&tnum;

    %SYSLPUT start=&start;

    %SYSLPUT tnum=&tnum;

    RSUBMIT task&tnum WAIT=NO PERSIST=NO;

    %PUT Session started on grid node %sysfunc( grdsvc_getname( task&tnum));

    OPTIONS noSYMBOLGEN noMPRINT noMLOGIC noNOTES COMPRESS=NO NOFULLSTIMER noERRORABEND noMFILE;

   

    LIBNAME dissert "*\DATA\";

    LIBNAME simulate "*\DATA\simulated\";

    %INCLUDE "*\mod_defs ND v21.sas";

    %INCLUDE "*\optimization ND v21.sas";

    %INCLUDE "*\M_step ND v17.sas";

    %INCLUDE "*\macro simulation wl v2.sas";

    %INCLUDE "*\hazard.sas";

    %simulations (

    numsims=20,

    startwhere=&start,

    results=dissert.output&tnum,

    K=3,

    P=2,

    dset1=simulate.testlong,

    dset2=simulate.testwide,

    num_nodes=12,

    convcrit=1E-4,

    varcrit=1E-15,

     shft=1,

    limit=4500,

    limit2=200,

    non=1 1 1,

    sg=1)

    ENDRSUBMIT;

    %LET tnum=%EVAL(&tnum+1);

%END;

WAITFOR _ALL_ %DO tnum=1 %TO 50; task&tnum %END; ;

SIGNOFF _ALL_;

data dissert.output;

set %DO tnum=1 %TO 50; dissert.output&tnum %END;;

run;

%MEND gridsubmit;

%gridsubmit;

%*LET num=%sysfunc(grdsvc_nnodes(server=&SASAppSvr)); %PUT #

%*LET rc=%sysfunc(grdsvc_getinfo(_ALL_)); %PUT &rc;

After running I get connection to the first task then every task thereafter I get the same warning:

NOTE: Remote signon to TASK1 complete.

NOTE: Background remote submit to TASK1 in progress.

NOTE: Remote submit to TASK1 commencing.

Session started on grid node *

ERROR: A link to TASK2 does not exist; execute SIGNON to establish the link.

Session started on grid node

WARNING: The value for variable START has been overridden due to interleaving SYSLPUT with

         asynchronous remote processing.

WARNING: The value for variable TNUM has been overridden due to interleaving SYSLPUT with

         asynchronous remote processing.


Accepted Solutions
Solution
‎07-06-2013 11:37 AM
Contributor
Posts: 26

Re: strange %SYSLPUT warning

Skipping the rsubmit macro entirely, writing another macro with PUT statements to write the entire program with 50 rsubmits to another file.  Problem solved.

View solution in original post


All Replies
Super User
Super User
Posts: 7,080

Re: strange %SYSLPUT warning

Try telling it which session to put the variables into.

SIGNON task&tnum;

    %SYSLPUT start=&start /remote=task&tnum;

    %SYSLPUT tnum=&tnum /remote=task&tnum;

Contributor
Posts: 26

Re: strange %SYSLPUT warning

that solved the warning but not the error.

ERROR: A link must be established by executing the SIGNON command before you can communicate with

       TASK2.

ERROR: A link must be established by executing the SIGNON command before you can communicate with

       TASK2.

ERROR: A link to TASK2 does not exist; execute SIGNON to establish the link.

Session started on grid node

ERROR: A link must be established by executing the SIGNON command before you can communicate with

       TASK3.

ERROR: A link must be established by executing the SIGNON command before you can communicate with

       TASK3.

Super User
Super User
Posts: 7,080

Re: strange %SYSLPUT warning

Sounds like your SIGNON is not finishing before your %SYSLPUT is running?

Another thing that I have had to use is to revert to using the old SAS 6.12 style macro for pushing macro values into the remote session.

Here is a %MSYSLPUT() macro to do that.

%macro msyslput

/*----------------------------------------------------------------------

Send value to remote macro variable while running inside a local macro

----------------------------------------------------------------------*/

(macvar   /* Name of remote macro variable to set */

,macval   /* Value to assign to remote macro variable */

,remote   /* (Optional) Name of remote session to send to */

);

/*----------------------------------------------------------------------

When trying to set remote macro variables within a local macro execution

SAS can get confused with timing and execution.  Reverting to using this

older method fixes that issue.

Based on SAS 6.12 autocall macro SYSLPUT that existed before SAS added

the %SYSLPUT macro statement.

----------------------------------------------------------------------*/

%local str ;

%let str=%str(rsubmit &remoteSmiley Wink%nrstr(%let) %str(&macvar = &macval;endrsubmitSmiley Wink;

&str.

%mend msyslput;

Super User
Posts: 3,261

Re: strange %SYSLPUT warning

What happens if you use the REMOTE = option on SYSLPUT as explained here:

http://support.sas.com/kb/40/924.html


Valued Guide
Posts: 2,177

Re: strange %SYSLPUT warning

Perhaps related to "asynchronous" remote session management.

And possibly not.

I think you'll solve the problem by removing the SIGNON into a preliminary loop.

Afterthought addeded by: Peter

Contributor
Posts: 26

Re: strange %SYSLPUT warning

The SIGNON loop worked for the connection.

The /REMOTE option appeared to work but now the macro variables do not resolve so the RSUBMIT goes nowhere

Super User
Super User
Posts: 7,080

Re: strange %SYSLPUT warning

You will need to stop using %SYSLPUT statement and use the old %NRSTR() trick, either via a utility macro or just using you ow local macro variable.

See this thread from last year.

https://communities.sas.com/thread/38251?start=0&tstart=0

Valued Guide
Posts: 2,177

Re: strange %SYSLPUT warning

did you include the syslput statements in the signon loop?

If so, you might need to add also a synchronous connect rsub to ensure that the macro values have landed

Contributor
Posts: 26

Re: strange %SYSLPUT warning

no they are not in the loop.  I used the remote=option.  Now that you mention it, there is not /remote option for %SYSLPUT in 9.2.....

Contributor
Posts: 26

Re: strange %SYSLPUT warning

Sorry about the confusion, the remote server I'm using is 9.2 not 9.3.  Using lots of servers and different versions, got mixed up.

Contributor
Posts: 26

Re: strange %SYSLPUT warning

Here is my current program.  Looks like the first RSUBMIT works fine but after that I get:

2940   RSUBMIT task&loop WAIT=NO PERSIST=NO;

ERROR: Unrecognized option, &.

ERROR: Remote submit canceled.

%MACRO gridsubmit;

%DO loop=1 %TO 41 %BY 20;

    SIGNON task&loop SIGNONWAIT=Y;

    %SYSLPUT start=&loop;   

%END;

%DO loop=1 %TO 41 %BY 20;   

    RSUBMIT task&loop WAIT=NO PERSIST=NO;

    %NRSTR(%%)PUT Session started on grid node %sysfunc( grdsvc_getname( task&start));

    OPTIONS noSYMBOLGEN noMPRINT noMLOGIC noNOTES COMPRESS=NO NOFULLSTIMER noERRORABEND noMFILE;

   

    LIBNAME dissert "\\\DATA\";

    LIBNAME simulate "\\\DATA\simulated\";

    %INCLUDE "\\\mod_defs ND v21.sas";

    %INCLUDE "\\\optimization ND v21.sas";

    %INCLUDE "\\\M_step ND v17.sas";

    %INCLUDE "\\\macro simulation wl v2.sas";

    %INCLUDE "\\\hazard.sas";

    %simulations (

    numsims=1,

    startwhere=&start,

    results=dissert.output&start,

    K=3,

    P=2,

    dset1=simulate.testlong,

    dset2=simulate.testwide,

    num_nodes=12,

    convcrit=1E-4,

    varcrit=1E-15,

     shft=1,

    limit=4500,

    limit2=200,

    non=1 1 1,

    sg=1)

    ENDRSUBMIT;

   

%END;

WAITFOR _ALL_ %DO start=1 %TO 41 %BY 20; task&start %END; ;

SIGNOFF _ALL_;

data dissert.output;

set %DO start=1 %TO 41 %BY 20; dissert.output&start %END; ;

run;

%MEND gridsubmit;

Contributor
Posts: 26

Re: strange %SYSLPUT warning

Only the first Rsubmit runs.  Looks like I need to abandon this macro and explicitly call the 50 RSUBMITS.  Any suggestions on how to automate this process?

Super User
Super User
Posts: 7,080

Re: strange %SYSLPUT warning

2940   RSUBMIT task&loop WAIT=NO PERSIST=NO;

ERROR: Unrecognized option, &.

This looks like a parser mistake.  Either create another macro variable to contain the value of the task name.

%let task=task&loop;

rsubmit &task ... ;

Or use %UNQUOTE()

rsubmit %unquote(task&loop) ....

Solution
‎07-06-2013 11:37 AM
Contributor
Posts: 26

Re: strange %SYSLPUT warning

Skipping the rsubmit macro entirely, writing another macro with PUT statements to write the entire program with 50 rsubmits to another file.  Problem solved.

🔒 This topic is solved and locked.

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

Discussion stats
  • 16 replies
  • 1730 views
  • 6 likes
  • 5 in conversation