Page 1 of 1

Help in creating Comma separated file

PostPosted: Fri Apr 25, 2008 6:11 pm
by bond_ajay
Hi,

can some one help with a dfsort to get a comma separated file from a FB flat file. The requirement is to remove all the leading/trailing spaces from the field and put a comma separator instead.

ex: my layout contains;
col-1: 5 bytes
col-2: 3 bytes
col-3: 10 bytes
col-4: 10 bytes
col-5: 10 bytes

ex rec (no quotes in actual record): " 123 10xyz abc" (there is no value for the col-5)

Req Output: "123,10,xyz,abc"

Thanks
Ajay

Re: Help in creating Comma separated file

PostPosted: Fri Apr 25, 2008 9:10 pm
by Frank Yaeger
Here's a DFSORT job that will do what you asked for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/38)
//SORTOUT DD DSN=...  output file (FB/38)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(1,38,SQZ=(SHIFT=LEFT,MID=C','))
/*