Page 1 of 1

Dynamic Delimiter

Posted: Thu May 03, 2007 1:37 am
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?

Posted: Thu May 03, 2007 2:04 am
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.

Posted: Thu May 03, 2007 4:36 am
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.

Posted: Thu May 03, 2007 7:05 am
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.