BookmarkSubscribeRSS Feed
SASHunter
Obsidian | Level 7
Hi,

I have the following code that logs me into our Linux machine and does a rsubmit.

I want to get the Environmental variable for what (MMM) stands for on our Linux machine.
But I get the following error: WARNING: The argument to macro function %SYSGET is not defined as a system variable.

Can it not resolve this over there?

Here is the code that I am using:

%let linux1=our.machine.com 1234;

Options comamid=tcp remote=linux1;

** Point to the script you wish to use to connect to the remote host;
Filename RLINK 'M:\ADC-P\\sas\linux\tcpunix.scr';
Signon linux1;

data _null_;
call symput('monyr',"&mth.&yr.");
run;
%put the value being passed is &monyr;

rsubmit;
%sysrput rsysver = Remote SAS version number is &sysver..;
%sysrput monthtest = %sysget(MMM);
endrsubmit;

* Library on Linux machine;
libname mysas "/our/dir/sas/&monyr" server=linux1;

%put &rsysver;
%put &monthtest;
Signoff;

This is the log:

NOTE: SAS initialization used:
real time 0.07 seconds
cpu time 0.02 seconds

NOTE: Remote signon to LINUX1 complete.
463
464 data _null_;
465 call symput('monyr',"&mth.&yr.");
466 run;

NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


467 %put the value being passed is &monyr;
the value being passed is apr10
468
469 rsubmit;
NOTE: Remote submit to LINUX1 commencing.
1 %sysrput rsysver = Remote SAS version number is &sysver..;
2 %sysrput monthtest = %sysget(MMM);
WARNING: The argument to macro function %SYSGET is not defined as a system variable.
NOTE: Remote submit to LINUX1 complete.
470
471 * Library on Linux machine;
472 libname mysas "/cpspb/dev/sas/&monyr" server=linux1;
NOTE: Libref MYSAS was successfully assigned as follows:
Engine: REMOTE
Physical Name: /cpspb/dev/sas/apr10
473
474 %put &rsysver;
Remote SAS version number is 9.2.
475 %put &monthtest;

476 Signoff;
NOTE: Remote signoff from LINUX1 commencing.
NOTE: Libref MYSAS has been deassigned.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 0.48 seconds
cpu time 0.03 seconds

NOTE: Script file 'tcpunix.scr' entered.
NOTE: Remote signoff from LINUX1 complete.

---------------------------------------------------------------------------

If I am on the Linux machine and use %sysget inside a program, it gives me 'apr'.

Thanks for any help in understanding this.
Nancy
2 REPLIES 2
Peter_C
Rhodochrosite | Level 12
run the usual commands to verify the environment var exists
In the remote sas session, run the code
x set ;
Or package it into a filename pipe and prove that MMM exists
SASHunter
Obsidian | Level 7
This is what I had previously executed on the Linux :

/cpspb/dev/work> print $MMM
apr

and if I do the SET statement I see: MMM=apr

so why does it not resolve when I sign on to the Linux through RSUBMIT?

Thanks,
Nancy

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1643 views
  • 0 likes
  • 2 in conversation