Page 1 of 1

reformat comparism results

Posted: Tue Dec 06, 2011 7:58 pm
by bernix
i have compared the content of 2 files and reformated the differences. now i've got a file that looks like (records are in sorted order)

AAA0010
AAA0015
BBB0000
BBB0100
CCC1200
CCC0100

i'd like to submit to my business partner a file that looks like

AAA;0010;0015
BBB;0000;0100
CCC;1200;0100

any suggestions?

Posted: Tue Dec 06, 2011 11:25 pm
by Frank Yaeger
Based on the little bit of information you've given and assuming that you have two records for each key in positions 1-3, you can use a DFSORT/ICETOOL job like the following to get the output you requested from the input you showed:

Code: Select all

//S1    EXEC  PGM=ICETOOL                                   
//TOOLMSG DD SYSOUT=*                                       
//DFSMSG  DD SYSOUT=*                                       
//IN DD *                                                   
AAA0010                                                     
AAA0015                                                     
BBB0000                                                     
BBB0100                                                     
CCC1200                                                     
CCC0100                                                     
//OUT DD SYSOUT=*                                           
//TOOLIN DD *                                               
RESIZE FROM(IN) TO(OUT) TOLEN(14) USING(CTL1)               
//CTL1CNTL DD *                                             
  INREC BUILD=(1,7)                                         
  OUTFIL FNAMES=OUT,BUILD=(1,3,C';',4,4,C';',11,4)          
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

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

Posted: Wed Dec 07, 2011 7:55 pm
by bernix
thanks for your help !