Page 1 of 1

job parameter

Posted: Fri Feb 01, 2008 4:00 pm
by dodda
hello

i have a delimited sequential file as source and i need to produce fixed width file. my problem is i have a column called DEP which holds same values (all values in the column are 111)

DEP(column name)

111
111
111
111
111

and i need to produce a fixed widht sequential file with DEP columns value appending to it

FILENAME.111.dat
a job parameter would be needed in this case i guess but dont know where to start
can some body throw a light on it.

Regards

Posted: Fri Feb 01, 2008 5:01 pm
by ray.wurlod
The Sequential File stage that writes the file will have Format properties that specify fixed width. The data types will not include VarChar (or any other variable-width data type). You may, therefore, need an intermediate Copy, Modify or Transformer stage to map the column data types.

Posted: Fri Feb 01, 2008 5:03 pm
by kcbland
If what you are saying is that within the same file this column contains the same values, and that distinct value needs to be used as part of the filename, then use some unix commands to get the value. A simple combination of "head -n1 filename|cut -d"|" -f42" will return the value in the 42 column of a | delimited file.

If you're saying that you N files each named and containing only the rows for that value, no luck. You'll have to write a parser.