[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::cobol

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

3228.0. "Forcing a deliberate data exception on the Alpha" by SWAM1::COHEN_RO (Ron Cohen: DTN 531-3742) Tue Apr 15 1997 14:02

    
    A customer is migrating his apllication from VMS(5.2)/Cobol(4.4) to
    Alpha(6.2)/Cobol(2.4).
    On the VAX a deliberate data exception is caused (adding a space to
    numerica data) forcing the program to abort with the following
    error messages:
    	%COB-F-INVDECDAT, invalid decimal data
    	$TRACE-F-FEEDBACK, symbolic stack dump follows....
    This is the intended result.
    
    On the Alpha the fatal abort does not happen. It produces all the
    mesages (finds the error - same as on the VAX) except for 
    the above two and then returns from
    the Declaratives section and continues with the program
    without aborting and producing a stack dump.
    
    The program behaves exactly the same on both systems except the
    VAX aborts (as intended) and the Alpha doesn't.
    
    A solution on the Alpha would be to replace the code with LIB$STOP
    but this would require a change in hundreds of programs.
    
    Is there something that can be done (a switch perhaps) to make the
    Alpha behave the same as the VAX.
    
    Thanks in advance.
    Ron
    
T.RTitleUserPersonal
Name
DateLines
3228.1WIBBIN::NOYCEPulling weeds, pickin' stonesTue Apr 15 1997 14:471
Do you compile with /CHECK=DECIMAL?  It's not set by default on Alpha.
3228.2/check=decimal was triedSWAM1::COHEN_RORon Cohen: DTN 531-3742Tue Apr 15 1997 15:313
    Yes, compiling with /CHECK=DECIMAL was tried but still received the
    same results. We are going to continue testing along these lines.....
    Any other suggestions?
3228.3Is the customer using USAGE DISPLAY?PACKED::BRAFFITTTue Apr 15 1997 16:0913
>    On the VAX a deliberate data exception is caused (adding a space to
>    numerica data) forcing the program to abort with the following
>    error messages:
>    	%COB-F-INVDECDAT, invalid decimal data
>    	$TRACE-F-FEEDBACK, symbolic stack dump follows....
    
    /CHECK=DECIMAL with DEC COBOL on Alpha handles some, but not all, of
    what the VAX decimal instructions do in terms of invalid decimal data
    checking.  In particular, /CHECK=DECIMAL handles USAGE DISPLAY but not
    USAGE COMP-3 (see HELP COBOL/CHECK for DEC COBOL).
    
    Which numeric data type is the customer using in the "add a space"
    code?
3228.4Working-stoage descriptionSWAM1::COHEN_RORon Cohen: DTN 531-3742Tue Apr 15 1997 16:4411
    Working-Storage
    
    	01  ws-a-space			value spaces.
    	    05  ws-kill-the-run		pic s9(1).
    
    Procedure
    
    	Add ws-kill-the-run to ws-kill-the-run.
    
    Thanks,
    Ron
3228.5PIC 9 does what you needPACKED::BRAFFITTTue Apr 15 1997 17:4729
$ cobol c3228/check=decimal
$ link c3228
$ run c3228
***C3228***
%SYSTEM-F-DECINV, decimal invalid operand, PC=0003012C, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC           abs PC      
 C3228  C3228  C3228                       17 000000000000012C 000000000003012C
 C3228                                      0 0000000000020340 0000000000030340
                                            0 FFFFFFFF81CE0914 FFFFFFFF81CE0914
    
*           <<< CLT::DISK$CLT_LIBRARY3:[NOTES$LIBRARY]COBOL.NOTE;1 >>>
*                               -< VAX/DEC COBOL >-
*================================================================================
*Note 3228.4     Forcing a deliberate data exception on the Alpha          4 of 4
*SWAM1::COHEN_RO "Ron Cohen: DTN 531-3742"            11 lines  15-APR-1997 15:44
*                        -< Working-stoage description >-
*--------------------------------------------------------------------------------
IDENTIFICATION DIVISION.
PROGRAM-ID. C3228.
ENVIRONMENT DIVISION.
DATA DIVISION.
Working-Storage SECTION.
01  ws-a-space			value spaces.
    05  ws-kill-the-run		pic 9.
Procedure DIVISION.
P0.	DISPLAY "***C3228***".
	Add 0 to ws-kill-the-run.
	DISPLAY "***END***".
3228.6Revised program to force invalid decimal dataPACKED::BRAFFITTWed Apr 16 1997 13:4423
    I talked on the phone with Ron.
    
    I asked him to suggest to the customer that they use CALL LIB$SIGNAL
    instead of using invalid decimal data checking in their declaratives to
    terminate their programs.
    
    We also revised the program as below.  Once Ron added STOP RUN, /OPT
    dataflow analysis discarded the ADD as unneeded.  The IF below is
    intended to force the optimizer NOT to discard the ADD.
    
IDENTIFICATION DIVISION.
PROGRAM-ID. C3228.
ENVIRONMENT DIVISION.
DATA DIVISION.
Working-Storage SECTION.
01  ws-a-space			value spaces.
    05  ws-kill-the-run		pic 9.
Procedure DIVISION.
P0.	DISPLAY "***C3228***".
	Add 0 to ws-kill-the-run.
	IF ws-kill-the-run = 1 THEN DISPLAY ws-kill-the-run.
	DISPLAY "***END***".
	STOP RUN.