using DFSORT



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

using DFSORT

Postby tina64 » Tue Jun 29, 2010 3:42 pm

hi guys,
i want to merge 2 files using DFSORT with these condition: having 5 records of first file and then 1 record of second one, and goes like this until it reaches the end of files...

i would appreciate if i get any answers....
tina64
 
Posts: 7
Joined: Tue Jun 29, 2010 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: using DFSORT

Postby skolusu » Tue Jun 29, 2010 9:45 pm

tina64,

Assuming that your both input files are FB recfm with an LRECL of 80 , the following DFSORT JCL will give you the desired results

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                 
//SORTOUT  DD DSN=&&HDR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)     
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  OUTFIL REMOVECC,HEADER1=('$$$')                               
//*                                                             
//STEP0200 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=Your first input file,DISP=SHR
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=Your second input file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(82:SEQNUM,8,ZD,START=4)),     
  IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(81:ID=1)),   
  IFTHEN=(WHEN=(81,1,ZD,EQ,1),                                   
  OVERLAY=(82:82,8,ZD,DIV,+5,M11,LENGTH=8)),                     
  IFTHEN=(WHEN=(81,1,ZD,EQ,2),OVERLAY=(82:SEQNUM,8,ZD,START=0)) 
  SORT FIELDS=(82,8,CH,A),EQUALS                                 
  OUTFIL OMIT=(82,8,ZD,EQ,0),BUILD=(1,80)                       
//*
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


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post