View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi,
i have a field which is of S9(4). when we view it thru copy book it will display as +1000, -2000,+4000,-3000, respectively,
i have to replce -ve value with zero. but problem here is i dont know the position to replace the sign.since sign will be stored internlly,if i know the position i can replce using below sort card.
OUTREC IFTHEN=(WHEN=(pos???,1,CH,EQ,C'-'),
OVERLAY=(pos:C'+0 ')
is there any wayy we can identify and replace -ve value with zero?
Regds,
useit |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
S9(4) doesn't tell us much. Is it zoned, packed, or binary?
Whichever, define it in your sort card, test it for less than zero, if it is, it is negative so make it zero, else leave it alone because it is positive. |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
Use Sub string to identify the 'Minus sign' and replace it with Zero using FINDREP. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
elango_K wrote: |
Use Sub string to identify the 'Minus sign' and replace it with Zero using FINDREP. |
A poor idea since it isn't know what format the data is in, there may not be byte for the sign!![/b] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Also, there is no minus-sign to test for. The "-" diesnt really exist, but is added by the code that displays the value.
Quote: |
OUTREC IFTHEN=(WHEN=(pos???,1,CH,EQ,C'-'),
OVERLAY=(pos:C'+0 ') |
Can't be done as per your post, there is no actual "-". S9(4) means a bit or some number of bits will be the sign (depending on the data definition (binary, packed-decimal, zoned-decimal).
Show the value of this field in hex without using the copybook display. |
|
Back to top |
|
|
|