Sort record without disturbing Trailer record



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

Sort record without disturbing Trailer record

Postby vishnusrini » Mon Apr 18, 2011 10:48 am

Hi,

I want to sort a file without disturbing Trailer record. I used below code, but it is not working.

OPTION COPY
INCLUDE COND=(1,1,CH,NE’T')
OUTREC IFTHEN=(27,8,CH,A,
37,7,CH,A)

In trailer record first character is ‘T’, so I used above code, but unsuccessful.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: Sort record without disturbing Trailer record.

Postby NicC » Mon Apr 18, 2011 3:42 pm

What is not working? I believe that is you want to SORT then you should not be doing a COPY.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Sort record without disturbing Trailer record.

Postby BillyBoyo » Mon Apr 18, 2011 7:59 pm

If you sort on the position of the trailer indicator first - and assuming you have logical values for header and data records - your trailer will be "undisturbed", as far as the order of the file is concerned.

As NicC has pointed out, if you want to sort the file, you will have to use the sort package to do a SORT not a COPY. And not OMIT the trailer (exclude it) which is what you seem to have coded so far.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort record without disturbing Trailer record.

Postby skolusu » Mon Apr 18, 2011 10:14 pm

vishnusrini,


The syntax you show is not a valid syntax. As billy mentioned you are performing copy operation rather than sorting. If your intention is to sort the values at pos 27 for a length of 8 and pos 37 for a length of 7 you can use DFSORT's DATASORT operator like shown below

//STEP0100 EXEC PGM=ICETOOL   
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*       
//IN       DD DSN=your input file,DISP=SHR
//OUT      DD SYSOUT=*                           
//TOOLIN   DD *                                   
  DATASORT FROM(IN) TO(OUT) TRAILER USING(CTL1)     
//CTL1CNTL  DD *                                   
  SORT FIELDS=(27,8,CH,A,37,7,CH,A)
//*


Check this link for complete description of the datasort operator

http://publibz.boulder.ibm.com/cgi-bin/ ... E1CA50/7.6?
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Sort record without disturbing Trailer record.

Postby vishnusrini » Fri Apr 22, 2011 11:40 am

ok thanks, it is working fine.
vishnusrini
 
Posts: 32
Joined: Wed Jul 07, 2010 2:55 pm
Location: India,bangalore
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post