> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of K Zafirop
> Sent: Monday, August 25, 2008 9:02 AM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Enterprise COBOL v3.4.1 run time issue
> 
> Hi all,
> 
> One of our most curious programmers noticed that when he uses 
> READ or READ 
> INTO statement to parse alphanumeric data, a translation is 
> made. The value 
> passed is the arithmetic truncation of the string. For example a 
> string 'FOW123' is passed with value '666123'. As you can see X'F1' = 
> C6D6E6F1F2F3. The truncation made before assigning the value 
> to an element 
> so, using DTR instead of DTR has no effect. Do you think this 
> is a compiler or 
> LE issue?
> 
> 
> Thank you in advance

I'm a bit confused. But if you have some external datum which is
character 'FOW123' and read it into a COBOL data item which is defined
as "PIC 9(6) USAGE DISPLAY.", then what you are seeing in normal. The
problem is that when you then move that data to somewhere else, the code
generated does a CVD instruction. The CVD instruction pays no attention
to the high order nybble of the data, except for the last byte, in which
it the "zone" nybble is used as the sign nybble. If you want to make
sure that the input is valid, then do a 

IF variable IS NUMERIC 

or 

IF variable IS NOT NUMERIC

type test before using the datum.


--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.  

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