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

Passing Job name as a Parameter to the SAS DI Job

Reply
Occasional Contributor
Posts: 10

Passing Job name as a Parameter to the SAS DI Job

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

Super Contributor
Posts: 318

Re: Passing Job name as a Parameter to the SAS DI Job

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

Super Contributor
Posts: 349

Re: Passing Job name as a Parameter to the SAS DI Job

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

Occasional Contributor
Posts: 10

Re: Passing Job name as a Parameter to the SAS DI Job

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

SAS Employee
Posts: 21

Re: Passing Job name as a Parameter to the SAS DI Job

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

Occasional Contributor
Posts: 10

Re: Passing Job name as a Parameter to the SAS DI Job

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


Super Contributor
Posts: 318

Re: Passing Job name as a Parameter to the SAS DI Job

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

SAS Employee
Posts: 21

Re: Passing Job name as a Parameter to the SAS DI Job

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

Ask a Question
Discussion stats
  • 7 replies
  • 1880 views
  • 0 likes
  • 4 in conversation