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

identify the position of SIGN?


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

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Tue Sep 27, 2011 5:03 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Tue Sep 27, 2011 5:30 pm
Reply with quote

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

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Tue Sep 27, 2011 9:00 pm
Reply with quote

Use Sub string to identify the 'Minus sign' and replace it with Zero using FINDREP.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Sep 27, 2011 9:06 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 27, 2011 10:25 pm
Reply with quote

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
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts How to identify the transaction categ... IMS DB/DC 3
No new posts Identify Program Insert DB2 7
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts Identify unused (junk) REXX scripts TSO/ISPF 30
Search our Forums:

Back to Top