Change data at point of match



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

Change data at point of match

Postby Kevin Jenkins » Fri Dec 04, 2009 5:36 pm

Grateful to know if and how DFSORT can handle the following data manipulation. Latest maintenance is PTF UK900913 from July 2008.

In a sequential file, if character string "STX" is in position 1, and strings "5013546030160" and "5000169000001'" are also found somewhere (although their position can vary) in the same record, then modify only "5000169000001'" to "1A2B3C4D5E6F7'"

This is just one of 40+ conditional modifications I would like to make in the same jobstep.

Grateful in advance assistance you are able to offer.

Regards, Kevin
Kevin Jenkins
 
Posts: 16
Joined: Fri Dec 04, 2009 4:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Change data at point of match

Postby skolusu » Fri Dec 04, 2009 8:46 pm

Kevin Jenkins,

Assuming your input is FB and lrecl of 80 the following JCL will give you the desired results

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                       
STX          5013546030160       5000169000001 - SHOULD CHANGE         
STX   5013546030160       5000169000002 - UNTOUCHED                   
STX      5013546030160       5000169000001 - SHOULD CHANGE             
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'STX',AND,4,76,SS,EQ,C'5013546030160',
                      AND,4,76,SS,EQ,C'5000169000001'),               
        FINDREP=(INOUT=(C'5000169000001',C'1A2B3C4D5E6F7')))           
//*


The output of this is

STX          5013546030160       1A2B3C4D5E6F7 - SHOULD CHANGE   
STX   5013546030160       5000169000002 - UNTOUCHED               
STX      5013546030160       1A2B3C4D5E6F7 - SHOULD CHANGE       
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: Change data at point of match

Postby Kevin Jenkins » Fri Dec 04, 2009 8:52 pm

Skolsu

Many thanks for your response I'll test as soon as I am able. Appreciate you taking the time to respond.

Regards, Kevin
Kevin Jenkins
 
Posts: 16
Joined: Fri Dec 04, 2009 4:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Change data at point of match

Postby Kevin Jenkins » Thu Dec 10, 2009 9:57 pm

Skolsu

Many thanks for your advice, testing of which has proved successful.

Cheers, Kevin
Kevin Jenkins
 
Posts: 16
Joined: Fri Dec 04, 2009 4:46 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post