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

Moving Signed numeric to Comp-3


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raj_mainframe08

New User


Joined: 11 Sep 2007
Posts: 65
Location: Gurgaon

PostPosted: Tue Sep 15, 2009 8:41 pm
Reply with quote

I have 1 record in input file with value

-639.54

I need to move this to S9(3)V9(2) COMP3 so that the above field can be converted to comp3 with the correct sign.

Note: The - sign in the input file can be anywhere depending on the actual value of the record i.e it can be -39.54

Can somebody please help me with this. Thanks.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Sep 15, 2009 8:54 pm
Reply with quote

See the NUMVAL intrinsic function in the Language Reference Manual.
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 15, 2009 10:04 pm
Reply with quote

Hello,

Just a caution . . .

If the signed value is created by some proven program, NUMVAL can be your friend. If this data is from some kind of data-entry and the values have not been validated, NUMVAL abends if the value is not valid. . .
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts Convert HEX to Numeric DB2 3
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top