BookmarkSubscribeRSS Feed
the
Calcite | Level 5 the
Calcite | Level 5

I wrote a quick macro to test submitting multiple remote sessions and I am getting some odd errors. It appears that the macro variable i isn't being passed through to the remote sessions and that the remote connection isn't being established before the client tries to communicate with it. Does anyone have any idea how to fix this?

 

Here is the code I submitted:

 

options autosignon sascmd='!sascmd -nosyntaxcheck';

%macro testrsubmit(x);
    %do i=1 %to &x;
        signon sess&i signonwait=no connectwait=no;

        %syslput i = &i /remote=sess&i;

        rsubmit sess&i wait=no sysrputsync=yes connectpersist=no;

        libname test "/example";    

        DATA test.Macros&i;
            set sashelp.vmacro;
        RUN;

        endrsubmit;
        
        signoff sess&i;
    %end;
%mend;

%testrsubmit(2);

 

And here are the errors I recieve:

 

Right away I get this:

NOTE: Background signon to SESS1 in progress.
ERROR: A link must be established by executing the SIGNON command before you can communicate with SESS1.
WARNING: Implicit SIGNOFF previously scheduled. SIGNOFF will occur at completion of asynchronous remote processing.
NOTE: Background signon to SESS2 in progress.
ERROR: A link must be established by executing the SIGNON command before you can communicate with SESS2.

 

 

and then these:

WARNING: Apparent symbolic reference I not resolved.
2      DATA test.Macros&i;
                       -
                       22
                       200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.
 
ERROR 200-322: The symbol is not recognized and will be ignored.

 

2 REPLIES 2
SASKiwi
PROC Star

I suggest you try signing on without these: signonwait=no connectwait=no. You have to have an active remote session for SYSLPUT to work.

 

BTW, I would advise against doing remote submits inside macros as it can cause control issues like you are experiencing that may be difficult to resolve. A better approach is to generate the required code inside the macro but run it outside.

the
Calcite | Level 5 the
Calcite | Level 5

Would you mind expanding on why rsubmit shouldn't be used inside of macros? I'm not too familiar with signon/rsubmit but using in them in a macro has given me nothing but headaches. Is there something specific about remote sessions that make them difficult to call in macros?

 

My goal is to break a big file up into smaller files and then process each of the smaller files in parallel. If I create a macro to write the code I need to a file and then use %include statements to call the files, would I lose the parallel processing I get with remote sessions?

 

I also don't know how many files I will need to process, so it looks like I will have to either loop over an rsubmit or an include.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1337 views
  • 0 likes
  • 2 in conversation