John In my opinion the emphasis in your reply is wrong. Not only is there no checking that the source bytes are correct unpacked decimal bytes but you may very well want there to be no check performed. An example doesn't come to mind right now - perhaps someone else still interested in this topic has one - but I'm sure in the past I have used this very feature of the PACK instruction in order to achieve some programming objective.
This is definitely not a bug as supposed by Paul (gil) but a potentially useful feature. As was evident in the original post, there is no checking of the input and, as you pointed out, there is no checking of the output. Another point that those who have come to the world of the 360 instruction set (and its later accretions) only recently from more rigid worlds - as I sometimes detect - is that there are a number of instructions which are documented as being made available for specific functions but which, when you dig down to what they actually do, you can see can be used in ways outside the documented function. It's now you need to recall that the instructions were created in order to be efficient using the hardware of the early 1960s, the days when memory truly was "core". I used to marvel - to myself only, of course! - at just how complex the EDMK instruction was compared to others which it was possible to accept could be implemented relatively cheaply. Chris Mason On Tue, 26 Aug 2008 08:40:07 -0500, McKown, John <[EMAIL PROTECTED]> wrote: >> -----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 ...). > >-- >John McKown ---------------------------------------------------------------------- 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