Delimit and put on next line



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

Delimit and put on next line

Postby kamal » Mon Jun 30, 2008 11:50 am

My i/p is like
there are 3 fields and these are delimited by ",".
Just want thse fields one by one on different lines.
e.g
i/p :
123;ANDB;890
3455;SGDH;7899


o/p should be:
123
ANDB
890
3455
SGDH
7899

can this be done using SORT?
kamal
 
Posts: 48
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Delimit and put on next line

Postby Frank Yaeger » Mon Jun 30, 2008 9:38 pm

Here's a DFSORT job that will do what you asked for. I assumed the maximum length of a field is 20, but you can change the job accordingly for the correct maximum length.

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=...  output file (FB)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL PARSE=(%01=(ENDBEFR=C';',FIXLEN=20),
                %02=(ENDBEFR=C';',FIXLEN=20),
                %03=(FIXLEN=20)),
         BUILD=(%01,/,%02,/,%03)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/supp ... tmpub.html
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