Page 2 of 2

Re: Copy Alternate Records from 2 Input files in to the Single O

PostPosted: Wed Jan 06, 2010 10:13 pm
by Frank Yaeger
Can you please provide more information Nov, 2009 DFSORT PTF software,because when I tried above syntax the job is getting abended.


You can find complete information on the Nov, 2009 PTF at:

http://www.ibm.com/support/docview.wss? ... g3T7000174

Ask your System Programmer to install the PTF.

Re: Copy Alternate Records from 2 Input files in to the Single O

PostPosted: Thu Jan 21, 2010 12:07 am
by skolusu
upendra_water,

Here is alternative way of doing it in a single step/pass of data if you don't have the Nov 2009 PTF installed.

we concatenate a single line HDR record before each file and then create a seqnum which will we use to sort and get the records in the desired order.
//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
HDR                                                                     
//         DD *                                                         
RECORD-1                                                               
RECORD-2                                                               
RECORD-3                                                               
RECORD-4                                                               
//         DD *                                                         
HDR                                                                     
//         DD *                                                         
RECORD-5                                                               
RECORD-6                                                               
RECORD-7                                                               
RECORD-8                                                               
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=(82,8,CH,A)                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(81:ID=1)),   
  IFTHEN=(WHEN=(81,1,ZD,EQ,1),OVERLAY=(82:SEQNUM,8,ZD,START=1,INCR=2)),
  IFTHEN=(WHEN=(81,1,ZD,EQ,2),OVERLAY=(82:SEQNUM,8,ZD,START=2,INCR=2)) 
  OUTFIL STARTREC=3,BUILD=(1,80)                                       
//*

Re: Copy Alternate Records from 2 Input files in to the Single O

PostPosted: Thu Jan 21, 2010 10:39 pm
by Frank Yaeger
For more information on the Nov, 2009 DFSORT PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000174

If you don't have this PTF installed, ask your System Programmer to install it (it's free).