BookmarkSubscribeRSS Feed
kandasamy
Calcite | Level 5

Hi all.

I would like to know how to pass the job name as a parameter to the SAS DI job.

Please guide me on this

Regards

Kandasamy

7 REPLIES 7
milts
Pyrite | Level 9

Hi,

What version of DI Studio are you using? If I recall there's a macro variable named etls_jobname if I got it right. Try to check the generated code of your DI job.

Milton

shivas
Pyrite | Level 9

Hi,

Check this link to create parameter jobs in SAS DI.

http://support.sas.com/documentation/cdl/en/etlug/60948/HTML/default/viewer.htm#p1cqcd3acjwls2n0z9lm...

and check the global macro variable ...Hope it helps..

GLOBAL JOBID  A5YZWODR.BT000671

GLOBAL IOMSERVER  SASApp

GLOBAL _ARMAPNM "SAS Data Integration Studio"

GLOBAL ETLS_STARTTIME 23MAY12:16:36:23

GLOBAL ETLS_JOBNAME ParameterJob

Thanks,

Shiva

kandasamy
Calcite | Level 5

Thanks for your inputs

I have gone through the link and it is not fulfil my requirement

My requirement is, i need to build an user defined audit table

My jobs are running parallelly, all the jobs are assign to the one system audit table and records are getting inserted into it. I am having user defined audit where i need to pull the data from the system audit table and insert to the user defined audit table, so that i need to pass the job name and pick the records from the system audit table

EyalGonen
Lapis Lazuli | Level 10

Hi Kandasamy,

I just verified the previous replies you got and in the generated SAS code you have the "etls_jobName" macro variable which contains the current job name. So, you do not need to define a parameter for this as it is auto-generated for you in the code.  You can use this macro variable anywhere you like - including adding it to an audit table...

HTH,

Eyal

kandasamy
Calcite | Level 5

Hi

Thanks for your reply.

we need to pass the parameter from outside to SAS DI job

Requirement Scenario:

1) we have table (say AUDIT_TABLE) which has JOB_NAME column and other attributes (around 10 job_names records in one dataset)

2) our requirement is to fetch all the attribute details from AUDIT_TABLE for a particular job_name

3) need to design a job which will fetch all the attributes from the AUDIT_TABLE for a single job_name and load to the other attribute details to some other table

Clarification/Suggestion we required on below points

1) how to pass a parameter to sas job (passing parameter from one job to other job)

2) can it be achivable through any schedular program, if so please help us

Thanks

kandasamy


milts
Pyrite | Level 9

Hi Kandasamy,

Did I get the flow of your scenario correctly that for each record in your audit table contains a job name and some attributes and then the job will be executed with the parameters set for that record?

What I'm thinking is that you have a main job where which loops and reads each record in the audit table and then use %include to reference the sas file of that job.

Sorry if I didn't understand correctly what you are trying to attain.

Regards

EyalGonen
Lapis Lazuli | Level 10

Hi Kandasamy,

1. You can pass parameters from the scheduler to the DI job using the SYSPARM command line option. You get the value of the SYSPARM into a SAS macro variable called also SYSPARM. You can then use it as you want.

2. Not sure if this is relevant or not but you can use the Data Integration loop transformation to read the values of a table (audit table) and run another DI job each time passing it the current row value from the table as a parameter.

Eyal

sas-innovate-2024.png

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.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 4113 views
  • 0 likes
  • 4 in conversation