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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.