How to pass coloumn value as a target file name

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

How to pass coloumn value as a target file name

Post by scorpion »

Can someone help me on "how to get the column value in target file name"?

For ex: In my source table

I have a column "Status" The values of that column may vary as

("RJ" or "RL" or "FD")

If staus="RJ" ........................I need to create a sequential file with name "RJ_FOUND.txt" in a folder "Found"

Else if status="RL"............. I need to create a sequential file with name "RL_FOUND.txt" in a folder""Found"

Else if status="RD"............. I need to create a sequential file with name "RD_FOUND.txt" in a folder "Found".


How do I acheive this?


Thanks in advance..
Thanx&Regards
scorpion
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Three separate output links from a Transformer, Filter or Switch stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Will the file be empty? You can easily do this with a few lines in a shell script.
psuedocode:
-isolate the column using awk
-grep for the value, if found create the file.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply