Help in creating Comma separated file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Help in creating Comma separated file

Postby bond_ajay » Fri Apr 25, 2008 6:11 pm

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
bond_ajay
 
Posts: 11
Joined: Wed Apr 02, 2008 9:53 am
Has thanked: 0 time
Been thanked: 0 time

Re: Help in creating Comma separated file

Postby Frank Yaeger » Fri Apr 25, 2008 9:10 pm

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','))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post