Passing delimiter as a parameter

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
ravij
Premium Member
Premium Member
Posts: 170
Joined: Mon Oct 10, 2005 7:04 am
Location: India

Passing delimiter as a parameter

Post by ravij »

Hi,

Can we pass the delimiter in a file as a parameter? I want to pass delimter at runtime. Is it possible. Please give me the solution for this problem.
thanks in advance.
Ravi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ravij,

the sequential file stage delimiter does not accept parameter values, so you cannot use a parameter for this as part of your normal stage definitions.

Fortunately, there is a workaround for this problem for you.

Read your sequential file with no delimiters into a single column in the source stage. Then pass this to a transform stage which then replaces your delimiter (passed in as a parameter) in a conversion like "CONVERT(DelimParameter,CHAR(001),In.BigColumn)" with char(1) [SOH]. You can choose your temporary delimiter as another character if CHAR(1) occurs in your file.

Then pass this a to sequential file stage that is a named pipe. You need to write to the pipe with the settings you read the sequential file; but the trick is that you now define the other side of the pipe with the normal settings and column definitions for the sequential file, with the exception of setting the delimiter to the value that you converted in the transform.
Post Reply