Steve,

I am not sure how the AS400 packed decimal format is defined
internallly.  Is it the same as IBM mainframe definition?  IN
your unload file was the field unload as packed-decimal or was
it converted to zoned decimal?   The best approach would be for
the data file to contain the field in zoned decimal format.

Here are two references I found:
1. for packed-decimal format
http://www.simotime.com/datapk01.htm
2. for zoned-decimal format http://www.simotime.com/datazd01.htm

The following assumes that the field is in text format for the
field in zoned decimal format. You in essence need to separate
the field into two parts the right most digit whch contains the
signed part of the number and the second is the rest.

convert the right most digit to its unsigned text value 0 thru
9.
Catenate the left part to the value created as above
using the INT() function convert the text value to an integer
multiply the aboe integer value by -1 if it should be a negative
number.

With a little bit of deft coding using INT(),SSUB(),SLOC()
functions you code this as a oneline computed column

Jim Bentley

--- "Wills, Steve" <[EMAIL PROTECTED]> wrote:

> Y'all, anyone have any experience or tips about how to handle
> packed/zoned datatypes from an AS/400 (or other) extract?
> 
> I have a record layout and a flat-file/fixed extract and
> written a small
> command file to load the data.  It loads fine, but I am having
> trouble
> "aligning" the columns and data.  The problem is related to a
> number of
> fields typed as "ZONED".  I am trying to read and learn about
> this, but
> I wanted to bounce it off all of you, too.
> 
> Thanks,
> Steve in Memphis
> 
> PS - Not blinded by the hype.  The Tigers are GOOD, but they
> DID NOT
> PLAY like a #1 last night (CSTV) whereas Kansas looked (ESPN)
> ABSOLUTELY
> FABULOUS.
> 
>  
> J. Stephen Wills
> Program Manager, Research Informatics
> Office of the Vice Chancellor for Research
> University of Tennessee Health Science Center
> 62 S. Dunlap, Suite 400
> Memphis, TN  38163
> Office: 901-448-2389
> FAX    : 901-448-7133
> 
> 
> 


Jim Bentley
American Celiac Society
[EMAIL PROTECTED]
tel: 1-504-737-3293


      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


Reply via email to