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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 713 views
  • 0 likes
  • 3 in conversation