Replace a small integer value in a record



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

Replace a small integer value in a record

Postby johndutcher » Fri Mar 27, 2015 10:14 pm

I am so close to having a need to update two small integer fields in a file with the code below......but both overlays place the 'result' of the addition into columns 1 and 2 of
the records instead of the columns expected (56,57 and 33,34) ....Does anyone see why ?

//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(56,2,BI,EQ,14),
OVERLAY=(56,2,BI,ADD,+5,TO=BI,LENGTH=2)),
IFTHEN=(WHEN=(33,2,BI,EQ,15),
OVERLAY=(33,2,BI,ADD,+5,TO=BI,LENGTH=2))
/*

Columns 1 and 2 are replaced in the output record ???
johndutcher
 
Posts: 2
Joined: Fri Mar 27, 2015 10:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Replace a small integer value in a record

Postby BillyBoyo » Sat Mar 28, 2015 12:08 am

With OVERLAY you have to tell where you want the value to go. The default for fixed-length records is to start at position one, and for variable-length records to start at position five (the first byte of data).

You probably want OVERLAY=(33:33,2,BI,ADD,+4,TO=BI,LENGTH=2) and similar for the other one.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Replace a small integer value in a record

Postby johndutcher » Sat Mar 28, 2015 6:27 pm

Hi.....YES.....thanks for fast action response......works very well now.
As a long time mainframer.....I am increasingly amazed at what can be accomplished without a line of COBOL code.
What a timesaver !!
johndutcher
 
Posts: 2
Joined: Fri Mar 27, 2015 10:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Replace a small integer value in a record

Postby BillyBoyo » Sat Mar 28, 2015 7:48 pm

Me too :-)

As a long time Mainframer, you'd also perhaps prefer the sister site, link second from the right at the bottom of the page. Lots of examples there (and here).

There is extensive documentation available (Getting Started and Application Programming Guide, plus various papers including Smart DFSORT Tricks) at the DFSORT pages on the web.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post