On Thu, 26 Jun 2008 07:58:34 -0500, McKown, John
<[EMAIL PROTECTED]> wrote:

>How about:
>
>1) Check all I/O statements for correct execution (COBOL FILE STATUS).
>This includes OPEN and CLOSE. If the file is a VSAM file, then be sure
>to put the VSAM FILE STATUS in any messages in addition to the normal
>FILE STATUS. This can be a life saver. As an example, we had a normal
>FILE STATUS say something like "record too large". Programmer went crazy
>looking at the record. The actual problem was that the record being
>added was updating the keys in an AIX and there were too many base keys
>for the alternate key. The "record too large" was the AIX record, not
>the data record.
>
>2) Check for overflow / underflow in all arithmetic operations with an
>ON SIZE ERROR clause. Unless, of course, you want to silently loose any
>high order digits. I think this will also catch division by 0 errors.
>
>3) Verify that PIC 9 USAGE DISPLAY or PACKED-DECIMAL actually contain
>valid decimal information before using, unless you can be assured that
>they cannot be incorrect. The only way that I can think of to do this is
>if the data comes from somethink like DB2 which enforces correctness.
>
>--
>John McKown
>Senior Systems Programmer
>HealthMarkets
>Keeping the Promise of Affordable Coverage
>Administrative Services Group
>Information Technology
>

Hello John,

I apologize to answer you so late. Thank you for the information.

In point 3, do you mean that each variable defined with these usage clauses
must be checked before to be read? I would have thought that it was
sufficient to use the IF var IS NUMERIC statement when a PIC X is assigned
to a PIC 9 variable. What are you thinking about this?

Do you think that potential bugs can be generated by bad redefines clauses?

Regards

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to