SORT reformat



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

SORT reformat

Postby bobpradeep » Wed Nov 16, 2011 3:45 am

Hello

I have a input file with the following format

   1234----1012         141516.......24 ...............51.................188
   <account number1><date...........>                    1
   <account number1><date...........>                    3 
   <account number1><date...........>                    3
   <account number1><date...........>                    3
   <account number1><date...........>                    2
   <account number2><date...........>                    1
   <account number2><date...........>                    3
   <account number2><date...........>                    2
   <account number3><date...........>                    1
   <account number3><date...........>                    2

a report records arranged based on the record type on column 51.
I need to generate the file with the following format

   1234----1012         141516.......24 ...............51.................188
   <account number1><date...........>                    1
   <account number1><date...........>                    2 
   <account number1><date...........>                    3
   <account number1><date...........>                    3
   <account number1><date...........>                    3
   <account number2><date...........>                    1
   <account number2><date...........>                    2
   <account number2><date...........>                    3
   <account number3><date...........>                    1
   <account number3><date...........>                    2

Records are needed to be sorted based on the column 51.

Please note, records type 3 is optional and record type 1 and 2 records are mandatory in the input file.

Thanks
BOB
bobpradeep
 
Posts: 1
Joined: Wed Nov 16, 2011 3:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: SORT reformat

Postby dick scherrer » Wed Nov 16, 2011 4:04 am

Hello and welcome to the forum,

When posting data, code, JCL, etc using the Code tag will preserve alignment and improve readability.

Your data has been "Code"d, but i messed up with the alignment - suggest you practice a bit (there is a Preview function so you can see your post as it will appear to the forum, rather than how it looks in the Reply Panel).

I'm not sure i understand what else is neede, but can this simply be sorted on col 51 primary and then the account number?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SORT reformat

Postby Frank Yaeger » Wed Nov 16, 2011 4:18 am

Bob,

It's not clear what you want. It looks like you want to sort by the account number and then by column 51, but I can't be sure. These DFSORT statements would give the expeced output you show, assuming that the account number is in positions 1-17:

  OPTION EQUALS                             
  SORT FIELDS=(1,17,CH,A,51,1,CH,A)         


If that's not what you want, then you need to do a better job of explaining what exactly it is that you do want. Show a better example of the records in your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.
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