On 26 Aug 2008 08:04:56 -0700, in bit.listserv.ibm-main you wrote:

>I Agree with the IF NOT NUMERIC.  When you read data into an area, the
>validity of the data is not checked.  The Data Truncation Option on the
>compiler does not check the validity of the data at runtime.  It is up
>to the application programmer to edit the data and check the validity of
>that data.  The "IF NOT NUMERIC and IF NUMERIC" is a great way to test
>the validity of a alphanumeric field for numeric data. The way I
>remember it, the programmer has to do a redefine of the field and give
>it a PIC X characteristic, then issue an IF NOT NUMERIC on the
>alphanumeric field.

I am not certain if PIC X(n) will allow sign zones on the low order
byte.  PIC S9(n) will allow plus and minus sign zones and may disallow
fields without a sign on the specified position depending on the
NUMPROC option.  PIC 9(n) means that all digits must be numeric.  And
then there are the rules for SIGN IS SEPARATE. 
>
>Regards,
>
>Don
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
>Behalf Of Mansell, George R.
>Sent: Tuesday, August 26, 2008 9:52 AM
>To: IBM-MAIN@BAMA.UA.EDU
>Subject: Re: Enterprise COBOL v3.4.1 run time issue
>
>Pack of FOW123 followed by zap and unpack would do this without a data
>exception. Only changes the zones C,D,E. Probably pic 999999 ==> pic
>999999. Why not use If not numeric?
>
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
>Behalf Of McKown, John
>Sent: Tuesday, August 26, 2008 8:40 AM
>To: IBM-MAIN@BAMA.UA.EDU
>Subject: Re: Enterprise COBOL v3.4.1 run time issue
>
>> -----Original Message-----
>> From: IBM Mainframe Discussion List
>> [mailto:[EMAIL PROTECTED] On Behalf Of Paul Gilmartin
>> Sent: Monday, August 25, 2008 9:45 AM
>> To: IBM-MAIN@BAMA.UA.EDU
>> Subject: Re: Enterprise COBOL v3.4.1 run time issue
>> 
>> On Mon, 25 Aug 2008 08:26:19 -0600, Steve Comstock wrote:
>> 
>> >K Zafirop wrote:
>> >>
>> >The value
>> >> passed is the arithmetic truncation of the string. For example a 
>> >> string 'FOW123' is passed with value '666123'.
>> >
>> >I'm confused here. How can the string 'FOW123' have a value '666123'?
>> >The string is its value.
>> >
>> It appears as if something is doing a Pack and ignoring data errors.
>> 
>> -- gil
>
>There is no "data error" possible with a PACK instruction. The
>programmer must validate that his input is valid before doing a PACK.
>Now, it is possible that the PACK instruction will create output which
>is not a valid packed decimal number. But that will not be detected
>until another decimal instruction tries to use it (such as ZAP, or AP,
>or SP, or ...).

----------------------------------------------------------------------
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