How to convert delimited file to fixed width file.

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
prashanthgovindaraj
Participant
Posts: 13
Joined: Tue Oct 30, 2007 8:33 am
Location: Chennai

How to convert delimited file to fixed width file.

Post by prashanthgovindaraj »

How to convert delimited file(comma delimited) to fixed width file?. Kindly advise.
dhanashreepanse
Participant
Posts: 25
Joined: Fri Jan 11, 2008 12:49 am
Location: Pune, India

Post by dhanashreepanse »

Read the input in a sequential file. Put a transformer after that. Put another sequential file stage and set the property "Record Length" to Fixed.
Ragunathan Gunasekaran
Participant
Posts: 247
Joined: Mon Jan 22, 2007 11:33 pm

Post by Ragunathan Gunasekaran »

Use a copy or modify stage instead of the transformer. Using transformer for all purpose should be restrained
Regards
Ragu
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Actually, in this case just do a Sequential Stage -> Sequential Stage. If your delimited file has VarChar fields you will have to use a modify or transform stage to convert the datatypes to fixed width ones.
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

How about converting all the fields of target sequential stage data types to Char. :?:
Thanks and Regards!!
dspxlearn
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Remember that Format and Column properties are properties of the Link, not of the stage. In a job with only two Sequential File stages there is only one link, so any change will be manifested on both ends of the link. You will need an intermediate stage, probably a Modify stage. You might also like to be alert to the effect of APT_STRING_PADCHAR environment variable which, by default, will pad your Char fields with 0x00 characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply