How do I pass a defined macro from a EG job to EG defined stored process without using the prompts function in stored process.
for example in EG, I have two jobs, Job A is a normal EG job , Job is a stored process
in job A i have
%LET LOCATION=C:\TE;
In Job B(stored process) I have
LIBNAME A "&LOCATION";
DATA A.A;
A=1;
RUN;
how do I make job B recognize macro variable &location
The Workspace Server and Stored Process Server are distinct processes that do not communicate with each other. Common environments are delivered through metadata or configuration at startup, but will stay static within each process unless deliberately changed.
Defining a macro variable as %global in the autoexec only means that the variable will be global for each process, but never across processes. And you still need to assign it a value in each process, either through setting in the autoexec or within each program or EG session.
If you want to share definitions dynamically across your whole SAS environment, you need to set up mechanisms to do that. You could store such information in centrally located datasets, or you could write those to SAS program files that are %included when needed.
Keep in mind that each process then must read such information repeatedly to stay current!
Put global definitions for both Workspace Server and Stored Process Server into
appserver_autoexec_usermods.sas
in your SASApp directory in your configuration tree.
Hi KurtBremser, I have defined %global location; in the appserver_autoexec_usermods, I don't get get error message anymore but it is still unable to pass the value from JOB A to JOB B.
The Workspace Server and Stored Process Server are distinct processes that do not communicate with each other. Common environments are delivered through metadata or configuration at startup, but will stay static within each process unless deliberately changed.
Defining a macro variable as %global in the autoexec only means that the variable will be global for each process, but never across processes. And you still need to assign it a value in each process, either through setting in the autoexec or within each program or EG session.
If you want to share definitions dynamically across your whole SAS environment, you need to set up mechanisms to do that. You could store such information in centrally located datasets, or you could write those to SAS program files that are %included when needed.
Keep in mind that each process then must read such information repeatedly to stay current!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.