IBM Support

The NUMCHECK compiler option now validates the contents of an alphanumeric data item used as a sender to a numeric data item in a MOVE statement.

News


Abstract

The COBOL V6.2 August, 2020 PTF UI71111 (on RSU2009) and the COBOL V6.3 September, 2020 PTF UI71591 (on RSU2012) improved the functionality of NUMCHECK by adding a check to validate the contents of an alphanumeric data item used as a sender to a numeric data item in a MOVE statement. A subsequent PTF corrected an issue with the length of the data being checked in the alphanumeric sender.

Content

NUMCHECK is an Enterprise COBOL V5.2+ compiler option that can be used to help detect the use of invalid PACKED-DECIMAL, USAGE DISPLAY, and BINARY/COMP/COMP-4 data. 

Recent PTFs (in V6.2 and V6.3 only) have improved the functionality of NUMCHECK by adding a check for valid numeric data in alphanumeric data items that are used as senders when the receiver of the MOVE is numeric.  This check was added because the compiler treats an alphanumeric sender as a numeric integer when the receiver of the MOVE is numeric.

The following 2 sets of PTFs made changes to the NUMCHECK behavior for alphanumeric senders:

1. Enhanced NUMCHECK to check the contents of alphanumeric senders when the receiver of the MOVE is numeric (no APAR issued):

  • UI71111 (Enterprise COBOL V6.2 August 2020, RSU2009)
  • UI71591 (Enterprise COBOL V6.3 September 2020, RSU2012)

2. Modified NUMCHECK to check only the portion of the alphanumeric sender being MOVEd to the numeric receiver (no APAR issued).  (Previously, it was incorrectly checking the full contents of the alphanumeric sender):

  • UI72970 (Enterprise COBOL V6.2 December 2020) 
  • UI72712 (Enterprise COBOL V6.3 November 2020)


Consider the following program:

000200  PROGRAM-ID. SAMPLE.
...
000700  01 WS-DATA-ITEMS.                                 
000800       05  PIC-X            PIC X(10) VALUE '01.01.2015'.
000900       05  PIC-9-4          PIC 9(04).                  
001000       05  PIC-9-6          PIC 9(06).                  
001100                                                               
001200  LINKAGE SECTION.                                       
001300  PROCEDURE DIVISION.                                    
001400       MOVE PIC-X TO PIC-9-4.                                                    
001500       DISPLAY 'PIC-9-4 = ' PIC-9-4.                 
001600       MOVE PIC-X TO PIC-9-6.                                  
001700       DISPLAY 'PIC-9-6 = ' PIC-9-6.                 
001800       GOBACK.
----------------------------------------------------------------------------------------------------

Before applying PTF #1 - UI71111 (V6.2) or UI71591 (V6.3)

When compiled with NUMCHECK(ZON, MSG), the compiler only recognizes the non-numeric data in the zoned-decimal sender on line 17:

IGZ0279W The value X'F14BF2F0F1F5' of data item PIC-9-6 at the time of reference by statement number 
         1 on line 17 in program SAMPLE failed the NUMERIC class test or contained a value larger than 
         the PICTURE clause as detected by the NUMCHECK compiler option.

When compiled with NUMCHECK(ZON, ABD), the compiler only recognizes the non-numeric data in the zoned-decimal sender on line 17:

IGZ0278S The contents of data item PIC-9-6 at the time of reference by statement number 
         1 on line 17 failed the NUMERIC class test or contained a value larger than 
         the PICTURE clause as detected by the NUMCHECK compiler option. 
         From compile unit SAMPLE at entry point SAMPLE at compile unit offset 
         +000002D2 at entry offset +000002D2 at address 269002D2.
----------------------------------------------------------------------------------------------------

After applying PTF #1 - UI71111 (V6.2) or UI71591 (V6.3)

When compiled with NUMCHECK(ZON, MSG), two messages are issued:

IGZ0279W The value X'F0F14BF0F14BF2F0F1F5' of data item PIC-X at the time of reference by statement number 
         1 on line 14 in program SAMPLE failed the NUMERIC class test or contained a value larger than 
         the PICTURE clause as detected by the NUMCHECK compiler option.

Notice that the full contents of PIC-X are incorrectly being checked, instead of just the last 4 digits that will be moved to PIC-9-4. This message should not have been received.

IGZ0279W The value X'F14BF2F0F1F5' of data item PIC-9-6 at the time of reference by statement number 
         1 on line 17 in program SAMPLE failed the NUMERIC class test or contained a value larger than 
         the PICTURE clause as detected by the NUMCHECK compiler option.

Notice that the warning correctly occurred for line 17, but it did not occur on line 16, which it also should have.

When compiled with NUMCHECK(ZON, ABD), one message is issued:

IGZ0278S The contents of data item PIC-X at the time of reference by statement number 
         1 on line 14 failed the NUMERIC class test or contained a value larger than  
         the PICTURE clause as detected by the NUMCHECK compiler option. 
         From compile unit SAMPLE at entry point SAMPLE at compile unit offset 
         +00000318 at entry offset +00000318 at address 26900318.

Notice that the full contents of PIC-X are incorrectly being checked, instead of just the last 4 digits that will be moved to PIC-9-4. This message should not have been received. Instead, the abend should have occurred on line 16.

----------------------------------------------------------------------------------------------------

After applying PTF #2 - UI72970 (V6.2) or UI72712 (V6.3)

When compiled with NUMCHECK(ZON, MSG), two messages are correctly issued:

IGZ0279W The value X'F14BF2F0F1F5' of data item PIC-X at the time of reference by statement number 
         1 on line 16 in program SAMPLE failed the NUMERIC class test or contained a value larger than 
         the PICTURE clause as detected by the NUMCHECK compiler option.
IGZ0279W The value X'F14BF2F0F1F5' of data item PIC-9-6 at the time of reference by statement number 
         1 on line 17 in program SAMPLE failed the NUMERIC class test or contained a value larger than 
         the PICTURE clause as detected by the NUMCHECK compiler option.

When compiled with NUMCHECK(ZON, ABD), the correct message is issued:

IGZ0278S The contents of data item PIC-X at the time of reference by statement number 
         1 on line 16 failed the NUMERIC class test or contained a value larger than 
         the PICTURE clause as detected by the NUMCHECK compiler option. 
         From compile unit SAMPLE at entry point SAMPLE at compile unit offset 
         +00000316 at entry offset +00000316 at address 26900316.
----------------------------------------------------------------------------------------------------

[{"Line of Business":{"code":"LOB35","label":"Mainframe SW"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS6SG3","label":"Enterprise COBOL for z\/OS"},"ARM Category":[{"code":"a8m0z00000007yxAAA","label":"COBOL->COBOL Documentation"}],"ARM Case Number":"","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"All Version(s)"}]

Document Information

Modified date:
05 October 2021

UID

ibm16430297