Page 1 of 1

DFSORT OVERLAY

PostPosted: Mon Nov 14, 2011 6:22 am
by johnwp53
Hi,

I have a VB 8182 file with many different record lengths.
Anyone know of a way to include the last 80 byes of each record in the sort keys?

Re: DFSORT OVERLAY

PostPosted: Mon Nov 14, 2011 11:18 am
by dick scherrer
Hello,

Suggest consideration be given to creating this file with the "key" as the first 80 bytes, not the last.

Re: DFSORT OVERLAY

PostPosted: Mon Nov 14, 2011 10:08 pm
by skolusu
johnwp53 wrote:Hi,

I have a VB 8182 file with many different record lengths.
Anyone know of a way to include the last 80 byes of each record in the sort keys?


johnwp53,

Try the following DFSORT JCL which will give you the desired results
//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=Your input 8182 lrecl VB file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5,8178,JFY=(SHIFT=RIGHT),5))
  SORT FIELDS=(8102,80,CH,A)                                     
  OUTREC BUILD=(1,4,8183)                                       
//*

Re: DFSORT OVERLAY

PostPosted: Wed Nov 16, 2011 8:27 pm
by johnwp53
Thanks for responses. I also needed to sort on four fields in the first 120 bytes as well as fields in the last 80 byes. I resorted to accomplishing the task will a COBOL program.