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

High values and low values into numeric datatype


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

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Tue Feb 02, 2010 3:57 pm
Reply with quote

Hi,

Can anyone say me that High values or low values can be moved into variable which has numeric Data type.

Ex: ABC PIC 9(3)
Is it possibleto code : move low-values into ABC or move high-values into ABC.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 02, 2010 4:03 pm
Reply with quote

What do you mean by (sic) "numeric Data type"? Zoned decimal? Packed decimal? Binary? Floating point? All are valid numeric data types in COBOL.

What results did you get when you attempted this yourself?
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Tue Feb 02, 2010 4:26 pm
Reply with quote

Hi Robert,

I Read that High-values and Low-values are alpha numeric where High-values have x(FF) and Low-values have x(00).
consider it as a display datatype ( As in my example i didnt mentioned any numeric Data type, Zoned decimal, Packed decimal, Binary, Floating point).


Now Can u tell me that High values or low values can be moved into variable which has numeric Data type(Display).
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 02, 2010 4:33 pm
Reply with quote

Figurative constants and alphanumeric literals must consist only of numeric characters and will be treated as numeric integer fields.

Figurative constants
Figurative constants are reserved words that name and refer to specific constant values.
HIGH-VALUE...
LOW-VALUE...
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Feb 02, 2010 4:51 pm
Reply with quote

Hint (for what Robert has asked): It is important to note that HIGH-VALUES and LOW-VALUES are ALPHANUMERIC in type, so you can't set numerically defined variables to this type (you would have to implicitly redefine the variable first). This is an annoying quirk of COBOL.
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 Feb 02, 2010 8:49 pm
Reply with quote

Hello,

Quote:
so you can't set numerically defined variables to this type (you would have to implicitly redefine the variable first).
And if you redefine a numeric field as pic x and move high-value to it, you may cause an abend. . .

Do not move high or low value to anything numeric . . . Saves grief later.
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Wed Feb 03, 2010 3:50 pm
Reply with quote

Thanks for your answers.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top