BookmarkSubscribeRSS Feed
Tecla1
Quartz | Level 8

Good morning,

I am trying to find a way to open network libraries with the 'RSUBMIT' command but I can't (inside a Macro that starts with "Rsubmit"), can you help me?

Thanks.

The data step:

RSUBMIT;

OPTIONS MPRINT;
OPTIONS MLOGIC;
OPTIONS SYMBOLGEN;
OPTIONS COMPRESS=YES;
OPTIONS VALIDVARNAME=UPCASE;
OPTIONS FORMCHAR="|----|+|---+=|-/\<>*";

LIBNAME RIOP "/sas_share/NAS_SDR_814/EX_824/Attivita/RIOP/SAS/DB_SAS" inencoding =any outencoding=any;
LIBNAME NEW "/sas_share/NAS_SDR_814/EX_824/Attivita/RIOP/RIOP - RIOP IN VOLO E SOSPESI CONTABILI/SAS/DB_SAS/New_files" inencoding =any outencoding=any;

ENDRSUBMIT;

LIBNAME RIOP   	    SLIBREF=RIOP      SERVER=SERV;
LIBNAME NEW   	    SLIBREF=NEW      SERVER=SERV;
3 REPLIES 3
Kurt_Bremser
Super User

I see neither a DATA nor a %MACRO statement in your code.

 

If you need help with code that does not do what you expected, ALWAYS post the complete log.

Tom
Super User Tom
Super User

Since you have not provided any real details let me just give some general advice.

 

Using a macro to remote submit SAS code can get confusing since you need to worry about two levels of abstraction.   Where the macro statements are executing and where the SAS code the macro generates is executing.

 

So for example what will the %PUT statements write in this program?

%macro rsub;
%let mvar=local;
signon xxx sascmd='!sascmd';
%syslput mvar=remote;
%put LOCAL &=mvar ;
rsubmit; 
  %put REMOTE &=mvar;
endrsubmit;
signoff xxx;
%mend;

%rsub;

Result:

Spoiler
 NOTE: Remote signon to XXX complete.
 LOCAL MVAR=local
 NOTE: Remote submit to XXX commencing.
 REMOTE MVAR=local
 NOTE: Remote submit to XXX complete.
 NOTE: Remote signoff from XXX commencing.
 NOTE: Remote signoff from XXX complete.

If you want the %PUT to run in the remote session you could use %NRSTR().

  %nrstr(%put) REMOTE &=mvar;

In general I find it best to avoid executing macro statements in the remotely submitted code blocks.  

Tecla1
Quartz | Level 8
Tnks for your kindly help....I'll try.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 332 views
  • 1 like
  • 3 in conversation