Lookup output AS as parameter

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
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Lookup output AS as parameter

Post by vskr72 »

I have a lookup table which has a structure like this:

Code: Select all

Ref_File        Master_File
----------       -------------
a.txt              Ref_a.txt 
b.txt              Ref_b.txt 
c.txt              Ref_c.txt 
hen I lookup onthe table a.txt, the output is Ref_a.txt. I want to use this value as a parameter and pass it to a seq file stage which will fetch the data from actual file present in a directory whose name is Ref_a.txt. Pls suggest me how to handle this. Thank you
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

1)In first job ,lookup and write the value to a temporary file

2)use

Code: Select all

cat temp_file
in execute command activity and pass the

Code: Select all

$commad.output
as parameter to next job. Pass this parameter to filename in seqfile stage.

IHTH
pandeeswaran
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

write the shell script. inside the shell script--> call toe sql select statement
and pass the value to the next job.

select master_file from lookup_table where ref_file='a.txt'.
Srinu Gadipudi
mgsteiner
Premium Member
Premium Member
Posts: 42
Joined: Wed Aug 31, 2011 2:56 am
Location: St. Gallen - CH
Contact:

Re: Lookup output AS as parameter

Post by mgsteiner »

You can create a routine to set the $UserStatus variable to pass a parameter value out of that job to another:

Code: Select all

FUNCTION UpdateUserStatus(Arg1) Call DSSetUserStatus(Arg1) Ans = Arg1 
MGS
Post Reply