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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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