Page 1 of 1

how output data are to be set as fixed length

Posted: Thu Jan 25, 2007 2:32 am
by simon
hi all

i have a question following

i am using Datastage 7.5.1A

i want all the output data are to be set as fixed length for each field

eg
row 1 "ab" "123" "dddd"
row 2 "abc" "12345" "aaaaaa"

i want output like this
row 1 "ab " "123 " "dddd "
row 2 "abc" "12345" "aaaaaa"

how can i set in sequential file thx in advance

Posted: Thu Jan 25, 2007 2:51 am
by ray.wurlod
Typically fixed width data files do not include quote characters; if you want these you will need to transform your data so that they have quotes - since reading quoted delimited fields from source will strip the quotes. The transformation will need to be such as to pad the string and then surround it with quotes.

That having been done, you need the fields' data type to be Char (not VarChar), so you will need to figure out the appropriate sizes by profiling your source data (what's the maximum length of each field?).

Then all you need to do is to set the record style to "Fixed" in the Sequential File stage.

fixed length

Posted: Thu Jan 25, 2007 2:58 am
by simon
even i didnt' use quotes ...it still doesn't work.....i wonder how can i set it in sequential file which make output data are "fixed length"
thx for ur help


ray.wurlod wrote:Typically fixed width data files do not include quote characters; if you want these you will need to transform your data so that they have quotes - since reading quoted delimited fields from source wi ...

Posted: Thu Jan 25, 2007 3:07 am
by ray.wurlod
Create a text file on the server that is fixed width format. Import its table definition, specifying that it is fixed width, and therefore you need to supply a comma-separated list of field widths.

On the Format tab of a sequential file slage click Load and load that table definition. On the Columns tab click Load and load the columns for the same table definition. Now, take a look at the Format properties again, and see how fixed width is specified.

Emulate that.