How to pass year and month fro ma sequencer to the job

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
venkata pradeep
Participant
Posts: 7
Joined: Tue Jul 27, 2010 5:50 am
Location: bangalore

How to pass year and month fro ma sequencer to the job

Post by venkata pradeep »

Hi,

I have a requierment like i am extarcting the data from a query using teradata stage and in that for automation i need to pass year and month to the query.

The year and month should be pass from the sequencer becuase it will take the values when ever we run the seq and pass it to the job inside.


Please suggest ...?

Rd,
pradeep.
p.v.pradee preddy
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I suggest using DataStage job parameters for this.
ankursaxena.2003
Participant
Posts: 96
Joined: Mon May 14, 2012 1:30 pm

Post by ankursaxena.2003 »

Extract Date -----> Read file -------> Extract Query

Above the structure of the Job Sequence.
First you Extract the Date and write on to a file.

In the next stage you read the file using cat command in Execute command(ExecCommand).

And in the Extract Job write the below code in Value Expression in Job Activity.

Field(Convert(@FM, "", ExecCommand.$CommandOutput),',',1)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Note that there would be no need for the "extract date - write/read file" steps if you're just talking the current year / month. A routine could easily return them.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bhasds
Participant
Posts: 79
Joined: Thu May 27, 2010 1:49 am

Post by bhasds »

Hi Venkata,

If you need to pass current year and month from sequence as a parameter then you can use Oconv function in the expression grid of the Job activity.

Code: Select all

Oconv(Date(),"DYM[4,2]")
Post Reply