Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

COBOL Programming :: RE: Inspect statement

$
0
0
Author: Robert Sample
Posted: Mon Jun 06, 2016 10:28 pm (GMT 5.5)

Quote:
Is there any reason why? If yes, how can this be resolved?
If you don't know the internal representation for a COMP-3 variable, you need to read the Enterprise COBOL Programming Guide manual to find out - try page 53 of the version 6.1 manual. A PIC S9(02) COMP-3 variable will take TWO bytes and if the absolute value of the variable is less than 10, then the first byte will have a LOW-VALUE in it. As far as resolving the issue, you have multiple choices:
1. Do not use that INSPECT statement
2. Change the COMP-3 variables to USAGE DISPLAY
3. Modify the INSPECT to work on variables except the COMP-3 variables
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


Viewing all articles
Browse latest Browse all 9405

Trending Articles