COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  New compiler option: NUMCHECK

    Posted Thu August 17, 2017 04:28 AM

    Hi,

    In version 5.2 with the new option NUMCHECK, if it is set as (PAC,ABD) I understand that it means that the program will abend if a COMP-3 sending field contains invalid Packed Decimal data.

    What is the difference between this and a good old S0C7 abend?

    Thanks

    DannyAmir


  • 2.  Re: New compiler option: NUMCHECK

    Posted Thu August 17, 2017 09:38 AM

    The difference is that NUMCHECK will check a data item of specified type (packed, zoned, or binary, depending on your choice of suboptions) whenever the item is used as a sender. If you have invalid data in one of those data items, NUMCHECK guarantees an abend at the first point at which invalid data is detected. A S0C7, on the other hand, requires that the data be invalid in certain ways (specifically, digits that aren't x'0' through x'9' and sign codes that aren't x'A' through x'F' for packed) AND that the invalid data be used with a hardware instruction that will abend. Besides guaranteeing the abend at the earliest possible point, NUMCHECK also can validate data based on your NUMPROC settings. Specifically, if you use NUMPROC(PFD) and a non-preferred sign, all the hardware instructions will happily handle that data, while NUMCHECK will correctly abend. (NUMCHECK does indeed allow all possible signs when NUMPROC(NOPFD) is specified).

    Mike Chase


  • 3.  Re: New compiler option: NUMCHECK

    Posted Thu August 17, 2017 10:31 AM

    Thanks Mike, I think that explains if for me. I'll be interested to see how our programs behave differently with the new option set as (PAC,ABD)

    DannyAmir