DATA Step, Macro, Functions and more

How to transfer local macro varibles to remote server macro variables

Accepted Solution Solved
Reply
Contributor
Posts: 56
Accepted Solution

How to transfer local macro varibles to remote server macro variables

Dear SAS community contributors,

 

I store weekend '20160409' into local macro variable END_OF_THIS_WEEK
     and '01OCT2015'd into local macro variable START_FISCAL_YEAR.
     I want to remote submit two macro varibles above to server to run SQL
     but it failed.  

 /******* my code:  ***********/

signon rlink;
libname rwork slibref=work server=prod;

rsubmit;

%SYSLPUT  END_WEEK_REMOTE = &END_OF_THIS_WEEK ;
%SYSLPUT  START_FY_REMOTE = &START_FISCAL_YEAR ;
 .....
proc sql;
......

endrsubmit;


 /*** error log ***/

    signon rlink;
NOTE: A link to PROD has been previously established. SIGNON is not necessary.
   libname rwork slibref=work server=prod;
NOTE: Libref RWORK was successfully assigned as follows:
      Engine:        REMOTE
      Physical Name: /saswork/SAS_work00810012_imapsrac1
      rsubmit;
NOTE: Remote submit to PROD commencing.
WARNING: Apparent symbolic reference END_OF_THIS_WEEK not resolved.
ERROR: A link must be established by executing the SIGNON command before you can communicate
       with UNKNOWN.
      %SYSLPUT  END_WEEK_REMOTE = &END_OF_THIS_WEEK ;
     %SYSLPUT  START_FY_REMOTE = &START_FISCAL_YEAR ;
WARNING: Apparent symbolic reference START_FISCAL_YEAR not resolved.
ERROR: A link must be established by executing the SIGNON command before you can communicate
       with UNKNOWN.


    I use PC SAS 9.3 and SAS/Connect to unix server.
    Do you have any suggestion to solve this issue ? Thanks in advance.


  Regards,

  William


Accepted Solutions
Solution
‎04-25-2016 08:58 AM
Contributor
Posts: 56

Re: How to transfer local macro varibles to remote server macro variables

Thanks for all replies. I coded as follows:

 

filename rlink '<..path>\filename.scr';
signon rlink;
libname rwork slibref=work server=prod;
 
%syslput _all_ ;

 

rsubmit;

.....

endrsubmit;

 

It works and moves all my LOCAL macro variables to REMOTE macro variables.

One minor point, the filename links to a "filename.scr" which is pronpt the user to enter user name and password to sign on unix server.

Is it possible that I hard code inside the code so that the users do not need to interact the screen to enter information ?

Thanks for your answer.

 

View solution in original post


All Replies
Super User
Posts: 10,460

Re: How to transfer local macro varibles to remote server macro variables

Any time I get a macro failure about values I try running OPTIONS MPRINT SYMBOLGEN; before the lines that seem to cause the error to see what the values of variables may be resolving to.

 

The warning message appears to say that a value is not currently assigned to your END_OF_THIS_WEEK variable. the options may confirm that.

 

Super User
Posts: 5,254

Re: How to transfer local macro varibles to remote server macro variables

Syslput should appear outside the rsubmit block.
If you need to execute it on the server use sysrput instead.

http://support.sas.com/documentation/cdl/en/connref/67933/HTML/default/viewer.htm#n1bc4zi0lp02ivn1ox...
Data never sleeps
Solution
‎04-25-2016 08:58 AM
Contributor
Posts: 56

Re: How to transfer local macro varibles to remote server macro variables

Thanks for all replies. I coded as follows:

 

filename rlink '<..path>\filename.scr';
signon rlink;
libname rwork slibref=work server=prod;
 
%syslput _all_ ;

 

rsubmit;

.....

endrsubmit;

 

It works and moves all my LOCAL macro variables to REMOTE macro variables.

One minor point, the filename links to a "filename.scr" which is pronpt the user to enter user name and password to sign on unix server.

Is it possible that I hard code inside the code so that the users do not need to interact the screen to enter information ?

Thanks for your answer.

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 325 views
  • 0 likes
  • 3 in conversation