BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
macrobo
Fluorite | Level 6

Hello all,

we are using LSF and Automic schedulers in 2 different SAS 9.4 DI environments.

In the environment using Automic it is possible to get some Automic Runtime attributes form automatic macro variables created while running a batch job:

run_id = %sysget(AUTOMIC_RUN_ID);
load_id = %sysget(AUTOMIC_LOAD_ID);
load_name = %sysget(AUTOMIC_LOAD_NAME);


Is there a possibility to get Runtime attributes while running a flow/job scheduled with LSF as automatic macro variables? 

 

LSF Runtime AttibutesLSF Runtime Attibutes

 

Any suggestions or other ideas? Thank you.

Robert

 

1 ACCEPTED SOLUTION

Accepted Solutions
ErikLund_Jensen
Rhodochrosite | Level 12

Hi @macrobo 

 

This is possible in LSF too. We use the following code, which is a snippet from a macro that is executed at start of every batchjob. 

 

%* collect information from actual job running under LSF;
%let ExecutionServer = %lowcase(&syshostname).odknet.dk;
%let ProcessID = &sysJobID;
%let LSB_UserID = %upcase(&sysuserid);
%let LSB_SourceFile = %sysfunc(getoption(sysin));
%let LSB_JobName = %sysget(LSB_JOBNAME);
%let LSB_flow = %scan(&LSB_JobName,3,%str(:));
%let LSB_FlowID = %scan(&LSB_JobName,1,%str(:));
%let LSB_Job = %scan(%scan(&LSB_JobName,4,%str(:)),1,%str({));
%let LSB_JobID = %sysget(LSB_JOBID);

 

Note that not all values are from LSF, but are collected here to come in the same "group" og macro variables for further use.

View solution in original post

2 REPLIES 2
ErikLund_Jensen
Rhodochrosite | Level 12

Hi @macrobo 

 

This is possible in LSF too. We use the following code, which is a snippet from a macro that is executed at start of every batchjob. 

 

%* collect information from actual job running under LSF;
%let ExecutionServer = %lowcase(&syshostname).odknet.dk;
%let ProcessID = &sysJobID;
%let LSB_UserID = %upcase(&sysuserid);
%let LSB_SourceFile = %sysfunc(getoption(sysin));
%let LSB_JobName = %sysget(LSB_JOBNAME);
%let LSB_flow = %scan(&LSB_JobName,3,%str(:));
%let LSB_FlowID = %scan(&LSB_JobName,1,%str(:));
%let LSB_Job = %scan(%scan(&LSB_JobName,4,%str(:)),1,%str({));
%let LSB_JobID = %sysget(LSB_JOBID);

 

Note that not all values are from LSF, but are collected here to come in the same "group" og macro variables for further use.

macrobo
Fluorite | Level 6

Thank you very much. This is exacly the solution.

 

Regards,

Robert

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1210 views
  • 2 likes
  • 2 in conversation