BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
Hi,
I upload data from PC session to Mainframe.The dataset name changes everymonth based on the datevalue that is created in the preceeding steps.
Say for instance for current month the dataset to be uploaded is TMP1012.
Next month it becomes TMP1101.I use a macro variable TMP&value.But it doesnt seem to resolve.I know %sysrput will do the work.But i dont know how to use it.
2 REPLIES 2
SASKiwi
PROC Star
It's not clear from your explanation if you are defining a macro variable on your PC and want it to resolve on the mainframe or vice versa. If it is the first case then you need to use %SYSRPUT on your PC (having already signed on to your mainframe SAS session):

%let local_var = example;

%SYSRPUT remote_var = &local_var / remote = sessionid;

The macro variable remote_var should then resolve in your mainframe session.
PatrickG
SAS Employee
Here's an excerpt from the doc. Hope this helps.

The %SYSRPUT statement is submitted with SAS/CONNECT to a remote host to retrieve the value of a macro variable stored on the remote host. %SYSRPUT assigns that value to a macro variable on the local host. %SYSRPUT is similar to the %LET macro statement because it assigns a value to a macro variable. However, %SYSRPUT assigns a value to a variable on the local host, not on the remote host where the statement is processed. The %SYSRPUT statement places the macro variable into the global symbol table in the client session.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 1170 views
  • 0 likes
  • 3 in conversation