View previous topic :: View next topic
|
Author |
Message |
norm.flynn
New User
Joined: 08 Jan 2013 Posts: 20 Location: usa
|
|
|
|
I have a file with a packed field, need to generate reversals, so want the input to be the same as the output with the sign reveresed, i.e multiply by -1.
Say the record is 80 bytes and the packed field starts in column 3 for a lenth of 4 bytes, with a picture of pic s9(05)v99 comp-3.
What would be the sort card to do this.
Thanks |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Use the following control cards.
Code: |
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(3:3,4,PD,MUL,-1,PD,LENGTH=4)
//* |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Or, subtract from zero:
Code: |
OPTION COPY
INREC OVERLAY=(3:+0,
SUB,
3,4,PD,
TO=PD,LENGTH=4)) |
Subtract is faster than multiply. One day, someone will have 100 fields to reverse on a 100m-record file and benefit from it :-) |
|
Back to top |
|
|
|