DATA Step, Macro, Functions and more

Syslput not passing macro variable into remote session

Reply
New Contributor the
New Contributor
Posts: 3

Syslput not passing macro variable into remote session

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.

 

Super User
Posts: 3,106

Re: Syslput not passing macro variable into remote session

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.

New Contributor the
New Contributor
Posts: 3

Re: Syslput not passing macro variable into remote session

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.

Ask a Question
Discussion stats
  • 2 replies
  • 88 views
  • 0 likes
  • 2 in conversation