Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
High values and low values into numeric datatype

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 10
Location: Chennai

PostPosted: Tue Feb 02, 2010 3:57 pm    Post subject: High values and low values into numeric datatype
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
References
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 4258
Location: Atlanta, GA

PostPosted: Tue Feb 02, 2010 4:03 pm    Post subject:
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: 10
Location: Chennai

PostPosted: Tue Feb 02, 2010 4:26 pm    Post subject:
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: 1746
Location: At my desk

PostPosted: Tue Feb 02, 2010 4:33 pm    Post subject:
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

Global Moderator


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

PostPosted: Tue Feb 02, 2010 4:51 pm    Post subject:
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

Global Moderator


Joined: 23 Nov 2006
Posts: 13598
Location: 221 B Baker St

PostPosted: Tue Feb 02, 2010 8:49 pm    Post subject:
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: 10
Location: Chennai

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

Thanks for your answers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1