Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 -> COBOL Programming
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    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

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8119
Location: East Dubuque, Illinois, USA

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: 29
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: 2150
Location: At my coffee table

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

Senior Member


Joined: 22 Apr 2006
Posts: 6258
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

Site Director


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

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: 29
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 1 Tue Jul 25, 2017 12:12 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us