Padding String With Blank
Posted: Thu Dec 08, 2005 5:00 am
Hi All,
I thought I had something very simple to do... but it's not !!
Here's the deal :
I have a dataset, containing string defined as CHAR.
Datas in these string have been TRIMMED.
I want to generate a flat file, fixed length, based on the structure of this Dataset... so I have to add 0,1 or more blank (space) to each field.
At the moment, I just take the Dataset and link it to a flat file.
I thought using the $APT_STRING_PADCHAR in the job creating the Flat File and setting it to " " (space value) would fill my field with blank. It's not.
I tried to set padchar options in the Flat File format properties, I tried in the column properties... nothing.
My Flat File is OK in windows environment, or in DS view data. My field are (seem to be) also padded with space when reading via notepad for example.
But in UNIX, there's no padding... it appears that it is filled with Null value, seen as space in Windows, not seen in UNIX.
Right now, I don't see any solution except propagating space by not "Trimming" my data... but it's not a good choice because of the join operations I have to use etc...
Have you got any advice to solve the Problem ?
ThanX
I thought I had something very simple to do... but it's not !!
Here's the deal :
I have a dataset, containing string defined as CHAR.
Datas in these string have been TRIMMED.
I want to generate a flat file, fixed length, based on the structure of this Dataset... so I have to add 0,1 or more blank (space) to each field.
At the moment, I just take the Dataset and link it to a flat file.
I thought using the $APT_STRING_PADCHAR in the job creating the Flat File and setting it to " " (space value) would fill my field with blank. It's not.
I tried to set padchar options in the Flat File format properties, I tried in the column properties... nothing.
My Flat File is OK in windows environment, or in DS view data. My field are (seem to be) also padded with space when reading via notepad for example.
But in UNIX, there's no padding... it appears that it is filled with Null value, seen as space in Windows, not seen in UNIX.
Right now, I don't see any solution except propagating space by not "Trimming" my data... but it's not a good choice because of the join operations I have to use etc...
Have you got any advice to solve the Problem ?
ThanX