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;
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.
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:
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.
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →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.
Ready to level-up your skills? Choose your own adventure.