Data patching using DFSORT?



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

Data patching using DFSORT?

Postby jimscholes » Tue Sep 22, 2009 10:03 pm

Hi,

I want to patch some data in the master file but have no idea how to do it using SORT/ICETOOL.

Master File A:

0030000123456789....................1E.............. (1000 bytes)
0030000223456789....................2E.............. (1000 bytes)
0030000323456789....................2E.............. (1000 bytes)
0030000423456789....................2E.............. (1000 bytes)
0030000523456789....................1E.............. (1000 bytes)
0030000623456789....................2A.............. (1000 bytes)
where first 16 byte is a unique key value, offset 160-161 contains a S9(2) signed numeric value (stores a counter value)

Work File B:

0030000223456789..........2A....... (200 bytes)
0030000423456789..........1A....... (200 bytes)
0030000523456789..........1C....... (200 bytes)
where first 16 byte is a unique key value, offset 55-56 contains a S9(2) signed numeric value; key in work file B always exists in master file A.

Now, I want to add up the counter value for matching key and replace this value in master file A.

Final output file C looks like

0030000123456789....................1E.............. (1000 bytes)
0030000223456789....................4F.............. (1000 bytes)
0030000323456789....................2E.............. (1000 bytes)
0030000423456789....................3F.............. (1000 bytes)
0030000523456789....................2H.............. (1000 bytes)
0030000623456789....................2A.............. (1000 bytes)

Please help.

Regards,
Jim
jimscholes
 
Posts: 6
Joined: Tue Sep 15, 2009 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Data patching using DFSORT?

Postby skolusu » Tue Sep 22, 2009 11:46 pm

Jim,

The following JCL will give you the desired results

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=Your 200 byte work file,DISP=SHR
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE) 
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  OUTREC BUILD=(1,16,161:55,2,1000:X)                       
/*                                                         
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=Your 1000 byte master file,DISP=SHR
//         DD DSN=&&T1,DISP=SHR                             
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION NZDPRINT,EQUALS                                   
  SORT FIELDS=(1,16,CH,A)                                   
  SUM FIELDS=(161,2,ZD)                                     
/*                                                         
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: Data patching using DFSORT?

Postby jimscholes » Wed Sep 23, 2009 1:59 am

Thanks skolusu. I got the desired results.

After the sum, there are some records that have a new counter value of 0. If I want to have an output file that only contains counter value > 0, can I do it in STEP0200 as well? Or should I have another step to filter out records that have counter value > 0?
jimscholes
 
Posts: 6
Joined: Tue Sep 15, 2009 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Data patching using DFSORT?

Postby Frank Yaeger » Wed Sep 23, 2009 2:22 am

Yes, you can do it in STEP0200 with an OUTFIL INCLUDE=(...) statement.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post