Page 1 of 1

How to convert delimited file to fixed width file.

Posted: Thu Feb 07, 2008 4:25 am
by prashanthgovindaraj
How to convert delimited file(comma delimited) to fixed width file?. Kindly advise.

Posted: Thu Feb 07, 2008 5:11 am
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.

Posted: Thu Feb 07, 2008 7:10 am
by Ragunathan Gunasekaran
Use a copy or modify stage instead of the transformer. Using transformer for all purpose should be restrained

Posted: Thu Feb 07, 2008 7:18 am
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.

Posted: Thu Feb 07, 2008 8:01 am
by dspxlearn
How about converting all the fields of target sequential stage data types to Char. :?:

Posted: Thu Feb 07, 2008 2:12 pm
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.