[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | VAX/DEC COBOL |
Notice: | Kit,doc,performance talk info-->DIR/KEY=KIT or DOC or PERF_TALK |
Moderator: | PACKED::BRAFFITT |
|
Created: | Mon Feb 03 1986 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3250 |
Total number of notes: | 13077 |
3193.0. "Default current/check=all, occurs, decinv??" by KERNEL::PULLEY (Come! while living waters flow) Wed Feb 05 1997 04:16
Hi,
The program below, on OpenVMS v7.1 Alpha, Cobol v2.4-863--well I'm not sure
if it should do this but...
This is when compiling the program /check=all, (or decimal).
If I make H-PURC, not subscripted, or take off the default current, it's fine.
If I leave it as is and run it I get:-
PURC=
%SYSTEM-F-DECINV, decimal invalid operand, PC=0000000000030160, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
Now if the array is meant to be initialised implicitly, then it probably
is trying to put something as a default into that field, which it won't like.
But, if arrays aren't initialised, I'd expect other variables not to be also.
Current workaround is cobol/check=(all,nodecimal)...
Took a look through the DEC Cobol users manual 11.2.5, but only got this far.
Thanks for any comments/suggestions,
Steve.
IDENTIFICATION DIVISION.
PROGRAM-ID. HMTEST.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
01 H-FIELDS.
02 H-FILLER OCCURS 30.
03 H-PURC PIC 999.
PROCEDURE DIVISION.
MAIN SECTION.
LA-1.
DISPLAY "PURC=" LINE 7 COLUMN 1 ERASE LINE.
ACCEPT H-PURC (1) LINE 7 COLUMN 10
PROTECTED NO BLANK CONVERSION DEFAULT CURRENT.
LA-999.
STOP RUN.
T.R | Title | User | Personal Name | Date | Lines |
---|
3193.1 | More info on /CHECK=DECIMAL | PACKED::BRAFFITT | | Wed Feb 05 1997 06:21 | 48 |
| >Now if the array is meant to be initialised implicitly, then it probably
>is trying to put something as a default into that field, which it won't like.
The DECINV occurs on the ACCEPT.
DEC COBOL's /CHECK=DECIMAL is more complete for DISPLAY numeric data
than the decimal data checking you get by default with VAX COBOL and
the VAX hardware. For example, there is no decimal data validation
with VAX COBOL for this particular ACCEPT.
The DEC COBOL User Manual compatibility chapter has this information on
/CHECK=DECIMAL:
The results of numeric comparisons with VAX COBOL and DEC COBOL are
undefined with invalid decimal data. DEC COBOL includes the
/CHECK=DECIMAL and -check decimal features to do a more complete
analysis of invalid decimal data. These options can be particularly
helpful when you are migrating programs to DEC COBOL.
If you do an ADD before the ACCEPT, you can see better what is
happening (both DEC COBOL /CHECK=DECIMAL and VAX COBOL give DECINV on
the ADD):
IDENTIFICATION DIVISION.
PROGRAM-ID. HMTEST.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
01 H-FIELDS.
02 H-FILLER OCCURS 30.
03 H-PURC PIC 999.
PROCEDURE DIVISION.
MAIN SECTION.
LA-1.
DISPLAY "***C3193***".
ADD 0 TO H-PURC (1).
DISPLAY "PURC=" LINE 7 COLUMN 1 ERASE LINE.
ACCEPT H-PURC (1) LINE 7 COLUMN 10
PROTECTED NO BLANK CONVERSION DEFAULT CURRENT.
DISPLAY "***END***".
LA-999.
STOP RUN.
|
3193.2 | Thanks. | KERNEL::PULLEY | Come! while living waters flow | Wed Feb 05 1997 11:52 | 5 |
| So DEC Cobol's checking is more complete than VAX Cobol.
Do I take ti that, the difference between a subscripted field, (where
the decinv errors is triggered), and a nonsubscripted field, (where
there's no error), is just part of the undefined results the
manual mentions.
|
3193.3 | See VAX/DEC COBOL User Manual (p. 5-18/-19) | PACKED::BRAFFITT | | Wed Feb 05 1997 12:10 | 18 |
| > Do I take ti that, the difference between a subscripted field, (where
> the decinv errors is triggered), and a nonsubscripted field, (where
> there's no error), is just part of the undefined results the
> manual mentions.
There is a good table which shows the default initial value for various
classes of data items.
DEC COBOL V2.3 User Manual (p. 5-19)
VAX COBOL V5.4 User Manual (p. 5-18)
Data Item Type Default Initial Value
--------------------------------------
Numeric Zero
Index-name Occurrence number one
Index data item Undefined
Tables Undefined
All others Spaces
|