BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MChalut
Calcite | Level 5

Hello! I have problem remote submitting a program which includes a autoexec file and sysparm in the call.  I am loosing my sysparm variables.  I am new at this and don't have a clue of where to look anymore 😞

 

So here it is...

 

This is my call:

"D:\Applications\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "D:\Applications\SASHome\SASFoundation\9.4\nls\en\SASV9.CFG" -SYSIN \\BrSasDev\ExternalData\Programs\DEV\Code\SAS_ExternalData_Chauffeur_OneAutomation.sas -sysparm 'DIR=Programs, ENV=DEV, APP=NaicsUpdate, P_01=D, P_02=\\fld6filer\BrsSystems\Workitems\TF17602\Testing\SAS\, P_03=BrSqlDev01, P_04=BrFrameDevelopment, P_05=\\BrSasDev\ExternalData\Programs\Dev\In\NaicsUpdate\OneAutomationTest.txt, P_06=SRGD-DRSG, P_07=66' -autoexec \\BrSasDev\ExternalData\Programs\DEV\AUTO\autoexec_DEV_NaicsUpdate.sas -log \\BrSasDev\ExternalData\Programs\DEV\LOG\Log_NaicsUpdate_2019-04-03T11-07-19.txt -nosplash -icon -batch 

And this is the content of my autoexec:

options autosignon;
rsubmit BrSasDev;

%global running errcode logger Oops_macro Oops_arg BRDEVTST inFileIncludeWithEffDate inFileIncludeWithoutEffDate;
%let thisAPP=NaicsUpdate;

%let thisSASserver=\\BrSasDev\ExternalData;
%let thisSASdir=Programs;
%let thisENV=DEV;
%let mycrpath=&thisSASserver\&thisSASdir\&thisEnv\MACRO;
libname mymacro "&mycrpath";
options mstored sasmstore = mymacro;
options noovp; /* no over print, limits error message extra copies in log */
%let logger="&thisSASserver\&thisSASdir\&thisENV\log\logging_default_&thisAPP..txt";
%let inFileIncludeWithEffDate = "&thisSASserver\&thisSASdir\&thisENV\Include\record_NaicsUpdate_withEffDate_in.txt";
%let inFileIncludeWithoutEffDate = "&thisSASserver\&thisSASdir\&thisENV\Include\record_NaicsUpdate_noEffDate_in.txt";

%let BRDEVTST = 1;

%put &sysparm;

So my parameters are not being passed.  Can somebody tell be what I am doing wrong?

 

Thank you in advance 🙂

Mylene

 

1 ACCEPTED SOLUTION

Accepted Solutions
DaveHorne
SAS Employee

Hi @MChalut, one way is using the &SYSLPUT statement.  This provides a way to pass macro variables from the local to remote session:

 

 

signon BrSasDev;

%syslput myparms=&sysparm;

rsubmit BrSasDev;

 

 

Then you would need to parse off the &myparms macro variable into smaller macro variables for each name/value pair.  Here's one example:

 

 

signon BrSasDev;
%syslput myparms=&sysparm;
rsubmit;

%put &myparms;

%let DIR=%scan(%bquote(&myparms),1,',');
%let DIR=%scan(&dir,2,'=');
%put &dir;

%let ENV=%scan(%bquote(&myparms),2,',');
%let ENV=%scan(&env,2,'=');
%put &env;

endrsubmit;
signoff noscript;

 

 

Here's the log output:

 

 

NOTE: Remote signon to BrSasDev complete.
33   %syslput myparms=&sysparm;
34
35   rsubmit;
NOTE: Remote submit to BrSasDev commencing.
1    %put &myparms;
DIR=Programs, ENV=DEV, APP=NaicsUpdate, P_01=D, P_02=\\fld6filer\BrsSystems\Workitems\TF17602\Testing\SAS\, P_03=BrSqlDev01, P_04=BrFrameDevelopment,
P_05=\\BrSasDev\ExternalData\Programs\Dev\In\NaicsUpdate\OneAutomationTest.txt, P_06=SRGD-DRSG, P_07=66
2
3    %let DIR=%scan(%bquote(&myparms),1,',');
4    %let DIR=%scan(&dir,2,'=');
5    %put &dir;
Programs
6
7    %let ENV=%scan(%bquote(&myparms),2,',');
8    %let ENV=%scan(&env,2,'=');
9    %put &env;
DEV
NOTE: Remote submit to BrSasDev complete.
36   signoff noscript;
NOTE: Remote signoff from BrSasDev commencing.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           0.37 seconds
      user cpu time       0.10 seconds
      system cpu time     0.15 seconds
      memory              9257.84k
      OS Memory           9828.00k
      Timestamp           04/03/2019 03:54:32 PM
      Step Count                        0  Switch Count  50

NOTE: Remote signoff from BrSasDev complete.

 

 

Hope this helps.

View solution in original post

2 REPLIES 2
DaveHorne
SAS Employee

Hi @MChalut, one way is using the &SYSLPUT statement.  This provides a way to pass macro variables from the local to remote session:

 

 

signon BrSasDev;

%syslput myparms=&sysparm;

rsubmit BrSasDev;

 

 

Then you would need to parse off the &myparms macro variable into smaller macro variables for each name/value pair.  Here's one example:

 

 

signon BrSasDev;
%syslput myparms=&sysparm;
rsubmit;

%put &myparms;

%let DIR=%scan(%bquote(&myparms),1,',');
%let DIR=%scan(&dir,2,'=');
%put &dir;

%let ENV=%scan(%bquote(&myparms),2,',');
%let ENV=%scan(&env,2,'=');
%put &env;

endrsubmit;
signoff noscript;

 

 

Here's the log output:

 

 

NOTE: Remote signon to BrSasDev complete.
33   %syslput myparms=&sysparm;
34
35   rsubmit;
NOTE: Remote submit to BrSasDev commencing.
1    %put &myparms;
DIR=Programs, ENV=DEV, APP=NaicsUpdate, P_01=D, P_02=\\fld6filer\BrsSystems\Workitems\TF17602\Testing\SAS\, P_03=BrSqlDev01, P_04=BrFrameDevelopment,
P_05=\\BrSasDev\ExternalData\Programs\Dev\In\NaicsUpdate\OneAutomationTest.txt, P_06=SRGD-DRSG, P_07=66
2
3    %let DIR=%scan(%bquote(&myparms),1,',');
4    %let DIR=%scan(&dir,2,'=');
5    %put &dir;
Programs
6
7    %let ENV=%scan(%bquote(&myparms),2,',');
8    %let ENV=%scan(&env,2,'=');
9    %put &env;
DEV
NOTE: Remote submit to BrSasDev complete.
36   signoff noscript;
NOTE: Remote signoff from BrSasDev commencing.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           0.37 seconds
      user cpu time       0.10 seconds
      system cpu time     0.15 seconds
      memory              9257.84k
      OS Memory           9828.00k
      Timestamp           04/03/2019 03:54:32 PM
      Step Count                        0  Switch Count  50

NOTE: Remote signoff from BrSasDev complete.

 

 

Hope this helps.

MChalut
Calcite | Level 5

It's working!!  Thank a lot for your help!!

Have a great day 🙂

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 766 views
  • 3 likes
  • 2 in conversation