SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Find out the Job Flow name in batch session

Accepted Solution Solved
Reply
Super User
Posts: 5,255
Accepted Solution

Find out the Job Flow name in batch session

Hi,

Does anybody know if there is a way to get the name of the job flow that the current running SAS job is deployed from?

Our jobs are scheduled from SMC and are Scheduled to Windows Task Scheduler, and some of out jobs can be deployed from different job flows (daily, weekly and so on).

Br

Linus

Data never sleeps

Accepted Solutions
Solution
‎10-04-2011 03:10 PM
Super Contributor
Posts: 356

Find out the Job Flow name in batch session

Hi Linus.

My thoughts (could be completly wrong Smiley Wink)

I don't think the batch SAS Session running would know this, unless you passed a parameter in the batch command.  The job flow name is known in the Metadata and possibly the scheduler of your choice. 

We are using LSF, and there is an option to include the flow name in the Log of each batch sas session, not sure if that is available for the windows scheduler.  But when trying to find this option I can't seem to find it anymore...

What and how are you wanting to use this information?

Barry

View solution in original post


All Replies
Solution
‎10-04-2011 03:10 PM
Super Contributor
Posts: 356

Find out the Job Flow name in batch session

Hi Linus.

My thoughts (could be completly wrong Smiley Wink)

I don't think the batch SAS Session running would know this, unless you passed a parameter in the batch command.  The job flow name is known in the Metadata and possibly the scheduler of your choice. 

We are using LSF, and there is an option to include the flow name in the Log of each batch sas session, not sure if that is available for the windows scheduler.  But when trying to find this option I can't seem to find it anymore...

What and how are you wanting to use this information?

Barry

Super User
Posts: 5,255

Find out the Job Flow name in batch session

I have a couple of jobs that will be called from different flows.In my case a job could be run as a daily, weekly and monthly batch.

I was looking for a way to dynamically tell the job in which context it is running, so I can base some logic on that fact. And I thought that naming of the low could be one way.

I investigated this a bit further, and I found out that if a job is part of multiple, I could adjust the startup command and a -sysparm, which is independent from the startup command of the same job in a different flow.

I have also seen that 9.3 (we're currently on 9.2) you could set an environment variable specific for a flow. If this works as I understand the documentation, it would also work for us.

I look into the flow name in the log file name thing...

/Linus

Data never sleeps
SAS Employee
Posts: 36

Find out the Job Flow name in batch session

The deployed job and the job flow objects are both stored in metadata.  It is possible to walk the metadata relationships to get this name of the flow if the flow was created in SAS management console. 

Super User
Posts: 5,255

Find out the Job Flow name in batch session

It has crossed my mind. It isn't really the quick fix that I was looking for...Smiley Wink

But even so, to search the metadata during batch execution, I still need to know the metadata id for the deployed job flow membership (or whatever that object type is called). I can't really picture how that would work.

Br

Linus

Data never sleeps
Super User
Posts: 5,255

Find out the Job Flow name in batch session

including the flow name in log file name is an option for the Scheduling server.

And we're probably go with that solution, by having a naming convention for flow names.

And in the autoexec_usermods we just pick out the information need by using getoption('LOG').

Thanks for the tip!

/Linus

Data never sleeps
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 607 views
  • 0 likes
  • 3 in conversation