BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
_Dan_
Quartz | Level 8

Hi,

 

We're deploying a process whereby a check takes place and aborts the job if an exception occurs. There's going to be a macro variable in the code, let's call it AdminOverride, which is implicitly set to N. We'd like to set it to Y using the Trigger Flow > With Variables feature of Process Manager.

 

Now, I've done similar things before by using the -set command line feature, and then %sysget(Var) in the SAS code being run. It appears this isn't working based on the test I've done so far.

 

I have set a flow with three jobs. Each job tries to %sysget Var1, Var2 & Var3. I have tried four different methods of creating Var1, 2 & 3:

View > Global Variables > Add. I now have a Var1, 2 & 3 each with their own value. This didn't work.

 

On an exited flow, Right click > Set Variables > Add. I added JS_FLOW_VARIABLE_LIST as the Name and "Var1=Testing1" as the Value. This didn't work.

 

On the same exited Flow, Right click > Set Variables > Add. This time I just added Var1 as the Name and Testing_1 as the Value. This didn't work.

 

Finally, on the exited flow, I clicked ReRun and then ticked the "With variables" box. I added the string "Var1=Testing__1" (without quotes). This also didn't work.

 

So, if neither of these options presents the variable so that I can obtain it via %sysget, what am I supposed to use to obtain the value of Var1, 2 & 3?

1 ACCEPTED SOLUTION

Accepted Solutions
_Dan_
Quartz | Level 8

I've sorted this and here's the info for anyone who needs it.

 

In Process Manager you can set Global Variables via View > Global Variables. Add the variable name and its value.

 

In SAS Management Console, you'll want to right click the relevant job and go to its Properties, then, under the General tab, click 'Modify' where the Environmental Variables option exists. Add the Variable name here (so if you chose to add AllowOverride as the Variable Name and No as the Variable Value within Process Manager, you'll enter AllowOverride as the Variable Name here). Then just tick the box that states "Use the value of the user variable of the same name". The second box will be populated for you.

 

Then, to obtain the variable in the SAS code, you'll just use:

%let AllowOverride = %sysget(AllowOverride);
%put &=AllowOverride.;

 

At no point did I put any additional commands in the command to execute (i.e. -set Var1=) as it's all done for you in the background.

 

You can also set this using Trigger Flow > With Variables and writing the line Var1=Whatever.

View solution in original post

1 REPLY 1
_Dan_
Quartz | Level 8

I've sorted this and here's the info for anyone who needs it.

 

In Process Manager you can set Global Variables via View > Global Variables. Add the variable name and its value.

 

In SAS Management Console, you'll want to right click the relevant job and go to its Properties, then, under the General tab, click 'Modify' where the Environmental Variables option exists. Add the Variable name here (so if you chose to add AllowOverride as the Variable Name and No as the Variable Value within Process Manager, you'll enter AllowOverride as the Variable Name here). Then just tick the box that states "Use the value of the user variable of the same name". The second box will be populated for you.

 

Then, to obtain the variable in the SAS code, you'll just use:

%let AllowOverride = %sysget(AllowOverride);
%put &=AllowOverride.;

 

At no point did I put any additional commands in the command to execute (i.e. -set Var1=) as it's all done for you in the background.

 

You can also set this using Trigger Flow > With Variables and writing the line Var1=Whatever.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 869 views
  • 0 likes
  • 1 in conversation