Fixed width columns on the target file.

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
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Fixed width columns on the target file.

Post by Shree0410 »

Hi, I have to create a target file with fixed width column, but each column has to be seperated by a comma(target system requirement).

If I check the 'Fixed-width column' box on the inputs/format tab, the delimiter and the quote character will disabled.

Can you suggest on how to get thru this .

Using the target file type as .csv will solve this?
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

keep the delimiter as comma and use char instead of varchars.
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post by Shree0410 »

does that make it fixed width columns?
Also, I do not want the quote character.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

no it will not make it a fixed width file but it will fix the length of your columns.

you can get rid of the quote character by typing 000 instead of quote
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Fixed width file and a delimitted file are two different formats. A fixed width cannot be delimitted and a delimitted cannot be fixed width. If you want the length of the columns from then source to be preserved and have a delimiter then do as Rohit suggested, but dont call it fixed width.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
clshore
Charter Member
Charter Member
Posts: 115
Joined: Tue Oct 21, 2003 11:45 am

Post by clshore »

Append a comma to each field except the last.
Redefine the width of each column by one.
Write them as fixed width.

Carter
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Define additional, intermediate Char(1) columns and set the value of each to ",". Generate imaginative names (like Filler1, Filler2, or Comma1, Comma2 and so on) for these columns.

In the Sequential File stage that writes the file, specify fixed-width format. Use the Display field in the Columns grid to specify the width of each column in the file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Why do you want it in fixed width and comma delimted?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply