How to Sort two files with special arrangement in output fil



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

How to Sort two files with special arrangement in output fil

Postby Praveen Kumar Reddy » Wed Aug 04, 2010 9:33 pm

Hi Could any help me out in meeting this special requirement.
I have two files with record structure as follows:
File1:
FIELD11A FIELD12A
FIELD21A FIELD22A
FIELD31A FIELD32A

File2:
FIELD11B FIELD12B
FIELD21B FIELD22B
FIELD31B FIELD32B

The output file should be like
The first record of output file contains the first field of first record of file1 and second field of first record of file2
The second record contains the first field of second record of file1 and second field of second record of file2
.
.

Output file:

FIELD11A FIELD12B
FIELD21A FIELD22B
FIELD31A FIELD32B
Praveen Kumar Reddy
 
Posts: 5
Joined: Wed Aug 04, 2010 8:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to Sort two files with special arrangement in output fil

Postby skolusu » Wed Aug 04, 2010 10:51 pm

Praveen Kumar Reddy,

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports the JOINKEYS function which can do this kind of thing much more easily.

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//INA      DD *                                 
FIELD11A FIELD12A                               
FIELD21A FIELD22A                               
FIELD31A FIELD32A                               
//INB      DD *                                 
FIELD11B FIELD12B                               
FIELD21B FIELD22B                               
FIELD31B FIELD32B                               
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                 
  OPTION COPY                                   
  JOINKEYS F1=INA,FIELDS=(20,8,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(20,8,A),SORTED,NOSEQCK
  JOIN UNPAIRED                                 
  REFORMAT FIELDS=(F1:1,9,F2:10,9)               
//JNF1CNTL DD *                                 
  INREC OVERLAY=(20:SEQNUM,8,ZD)                 
//JNF2CNTL DD *                                 
  INREC OVERLAY=(20:SEQNUM,8,ZD)                 
//*



For complete details on JOINKEYS and the other new functions available with the Nov, 2009 DFSORT PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000174
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: How to Sort two files with special arrangement in output fil

Postby Praveen Kumar Reddy » Sun Aug 08, 2010 6:39 pm

Thanks Skolusu its working
Praveen Kumar Reddy
 
Posts: 5
Joined: Wed Aug 04, 2010 8:30 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post