IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to reverse sign on a comp-3 field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
norm.flynn

New User


Joined: 08 Jan 2013
Posts: 20
Location: usa

PostPosted: Fri Apr 05, 2013 3:26 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Apr 05, 2013 4:13 am
Reply with quote

Use the following control cards.
Code:

//SYSIN    DD *
  OPTION COPY   
  INREC OVERLAY=(3:3,4,PD,MUL,-1,PD,LENGTH=4)
//*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 05, 2013 5:28 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
Search our Forums:

Back to Top