In EG i can per program choose either Local (windows machine with SAS EG) or SASapp (unix server with SAS running) to run the sas code.
I can use File Copy task to copy a file between the two. But then I need to "hardcode" the same path in TWO programs (one running on SASApp and one running on local).
If the project is shared between users i must make sure all users have access to that folder to transfer a file SASapp <-> local. To get around this i want it to be dynamic. Ideally i would like to copy a dataset between SASapp WORK and Local WORK, (ie %sysfunc(pathname(work,L)) evaluated on respective machine). But then SASApp need to know the path to WORK on the Local machine.
Can i set a macro variable on SASApp and then transfer that value to the local session somehow?
If you are copying data sets, look at the Upload SAS Data Sets and Download SAS Data Sets tasks. These can copy SAS data set files from a remote SAS library to a local PC folder, or vice versa.
If these are just general files, I can't think of a clean way of doing what you want (copy macro values from local session to remote). I can think of one very messy way though.
I think @invalid was looking to grab just the one value (path to WORK). But if I follow @Quentin down the path of over-engineering, then you could just use the Download Data Set task to "download" SASHELP.VMACRO to a sas7bdat, then use Upload SAS Data Set to copy to any library on your remote server.
Thanks all for the input.
If the code fails i don't want large file to be orphaned in the users personal folder. That is why i want to transfer it to work directly.
It seems the best solution is:
Have you tried SYSRPUT or SYSLPUT?
SYSLPUT looks appropriate in this case:
You can choose which session to pass the macro variable to, if you have multiple open using the REMOTE session ID and REMOTE option.
@invalid wrote:
In EG i can per program choose either Local (windows machine with SAS EG) or SASapp (unix server with SAS running) to run the sas code.
I can use File Copy task to copy a file between the two. But then I need to "hardcode" the same path in TWO programs (one running on SASApp and one running on local).
If the project is shared between users i must make sure all users have access to that folder to transfer a file SASapp <-> local. To get around this i want it to be dynamic. Ideally i would like to copy a dataset between SASapp WORK and Local WORK, (ie %sysfunc(pathname(work,L)) evaluated on respective machine). But then SASApp need to know the path to WORK on the Local machine.
Can i set a macro variable on SASApp and then transfer that value to the local session somehow?
SYSRPUT and SYSLPUT apply to SAS/CONNECT -- when you have two SAS sessions talking directly to each other. That's SAS <--> SAS.
But with your typical EG setup, you don't have SAS/CONNECT in the middle. It's EG connecting to your local SAS, and EG connecting to your remote SAS. EG uses SAS Integration Technologies for this work. SAS Integration Technologies supports [any client]<-->SAS, where [any client] might be EG, SAS Add-In for MS Office, SAS DI Studio, etc.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.