Dynamic Delimiter

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
tatireddi
Participant
Posts: 22
Joined: Sun Oct 22, 2006 11:00 pm

Dynamic Delimiter

Post by tatireddi »

Hi,

I have requirement, where the sequential file generated as same output file with different delimiter values say (|,~,-).

This i have to give for different datamarts.

Now If I pass the delimiter value as a job parameter it will help me to use one job to generate the files (for n number of delimeters), else i have to create a job for each delimiter.

How to configure Dstage to have the delimiter value taken as the input parameter?
Regards

Srinivas
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

Just add a parameter to your job like

Code: Select all

pDelimiter
and in teh sequential stage, in the Delimiter part add

Code: Select all

#pDelimiter#
If all these datamarts want the same data just with a different delimiter these is no need to run the job with all the logic in many times.

Run the job once creating on of the file, then have a separate job that simply reads that file and creates all the copies with different delimiters.

Someone will probably suggest using a funky perl script or awk command that will do this even quicker.
Regards,

Nick.
tatireddi
Participant
Posts: 22
Joined: Sun Oct 22, 2006 11:00 pm

Post by tatireddi »

Hi Nick:

The usage of the parameter is giving error. it specifies you have to pass either a ASCII code or Hexa. The same is for the quote also.I can't have e different quote character. for null quotes i have to specify 000.

I want to parameterize so that i can execute for whichever delimiter i want to process else i have to process for standard and then use unix commands.
Regards

Srinivas
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I doubt you can parametrize the delimiter. Process it in unix using awk. Dont do a global replace as the delimiter might appear in quoted data and it will be replaced as well.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply