- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Evaluating COBOL expression gives unexpected r...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2008 12:10 PM
тАО06-18-2008 12:10 PM
AlphaServer 800 5/333
OpenVMS V7.1-1H2
DEC COBOL V2.4
OpenVMS Alpha DEBUG Version V7.1-000
I'm not getting branching in my program the way I'm expecting to. I compare a variable whose value is zero (according to debug examine and evaluate)to see if it's less than one. Then if it is less than one, I move the value one to one of the variables.
Anyway, if you look at the debug list attached, the system is evaluating 0 < 1 as FALSE.
Both variables are PIC 9(3).
Although one is a redefine of a PIC X(3).
Solved! Go to Solution.
- Tags:
- COBOL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2008 12:13 PM
тАО06-18-2008 12:13 PM
Re: Evaluating COBOL expression gives unexpected result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2008 12:30 PM
тАО06-18-2008 12:30 PM
Re: Evaluating COBOL expression gives unexpected result
EISNER:: has COBOL 2.8 and OpenVMS Alpha V8.3.
Or post up a concise source code example reproducer of what you're doing here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2008 12:35 PM
тАО06-18-2008 12:35 PM
Re: Evaluating COBOL expression gives unexpected result
DBG> ev ORDER-BATCH-PS-PRINT-RUN
0
DBG> ev /hex ORDER-BATCH-PS-PRINT-RUN
202020
DBG> ev /bin ORDER-BATCH-PS-PRINT-RUN
00100000 0010000000100000
DBG> ev /dec ORDER-BATCH-PS-PRINT-RUN
2105376
I'll post again when I'm sure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2008 12:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2008 12:59 PM
тАО06-18-2008 12:59 PM
Re: Evaluating COBOL expression gives unexpected result
I'm getting the data from the rededined field and it previously had no data (undefined or spaces). Some records will have had the new numeric data written to the field and some not.
Looks like I can't test that field to determine whether it's been updated or not.
Let me make sure.
Thanks Hoff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2008 01:13 PM
тАО06-18-2008 01:13 PM
Re: Evaluating COBOL expression gives unexpected result
I thought that if I referred to the redefined (numeric) name in the expression, that the compiler would know to change the spaces to a zero. Or at least complain.
NOPE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-20-2008 04:21 AM
тАО06-20-2008 04:21 AM
Re: Evaluating COBOL expression gives unexpected result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-20-2008 05:50 AM
тАО06-20-2008 05:50 AM
Re: Evaluating COBOL expression gives unexpected result
Sometimes you just get stuck, and it helps just to define what you're seeing well enough to ask for help.
Turns out that in this case, if the redefined field hasn't been updated with numeric data then it always contains spaces.
So my comparison needed to be:
if redefined-variable = spaces
instead of
if redefined-variable < 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-20-2008 07:51 AM
тАО06-20-2008 07:51 AM
Re: Evaluating COBOL expression gives unexpected result
Level 66 RENAMES also is like that.