copying a VB file and changing one field



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

copying a VB file and changing one field

Postby tjenkins99 » Sat Feb 20, 2010 9:18 pm

Hello!
I would like to use DFSORT to copy a VB file and change just one field in the record.
I have successfully used the FIND and REPLACE parameter as follows:

//SYSIN DD *
OPTION COPY
INREC FINDREP=(INOUT=(C'AA20100218',C'BB20100218'))
/*

But, I would like to be more precise in case the string C'AA20100218' occurred more than once
within the record.
I used the following statements:

//SYSIN DD *
OPTION COPY
INREC FIELDS=(1:1,4,11,2,CHANGE=(2,C'AA',C'BB'))

I received a RC=0 but each record in the file only contained the field BB - all of the other fields are
missing.
Since the files are VB, I specified 1:1,4 to account for the 4-byte RDW field.
The only field I want to change is the 2-byte field starting at offset 11.

Could somebody point out what else I am missing?
Thanks.
Tom
tjenkins99
 
Posts: 2
Joined: Sat Feb 20, 2010 8:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: copying a VB file and changing one field

 

Re: copying a VB file and changing one field

Postby Frank Yaeger » Tue Feb 23, 2010 12:19 am

Here's two different ways to change AA to BB in positions 11-12 with DFSORT:

//SYSIN DD *
  OPTION COPY                                               
  INREC FINDREP=(STARTPOS=11,ENDPOS=13,INOUT=(C'AA',C'BB')) 


//SYSIN DD *
  OPTION COPY                                                   
  INREC OVERLAY=(11:11,2,CHANGE=(2,C'AA',C'BB'),NOMATCH=(11,2))
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: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: copying a VB file and changing one field

Postby tjenkins99 » Tue Feb 23, 2010 8:03 pm

Hi Frank,

Thank you very much.
Those control cards gave me exactly what I needed.

Tom
tjenkins99
 
Posts: 2
Joined: Sat Feb 20, 2010 8:11 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post