Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Coverting Zoned Decimal Data

141 views
Skip to first unread message

Douglas McCrea

unread,
Jun 15, 1999, 3:00:00 AM6/15/99
to
We've downloaded data from a mainframe which is in "Zoned Decimal Data"
or "Signed Decimal Data" format. An example of which is:

000001160} would convert to -116
000003407N would convert to -340.75
001169345O would convert to -116934.56
0000000395 would convert to 3.95

The information on the mainframe cannot change format. We've been using
an AS/400 to covert the information in a roundabout way, but will be
abandoning the AS/400 platform soon and will need to convert the data
into an Access database. There are too many variations to program into a
module. Has anyone heard of this data type? If so, is there a module,
piece of software, or conversion available for this data? We are trying
to put this in Access, but I couldn't find any references either in my
developer's manual or in Access. Does anyone have any ideas?

-Doug

_______________________
Douglas McCrea
Computer Systems Manager
RCSC&SA Business Office
dmc...@rci.rutgers.edu


Daniel Hicks

unread,
Jun 16, 1999, 3:00:00 AM6/16/99
to
Douglas McCrea wrote:
>
> We've downloaded data from a mainframe which is in "Zoned Decimal Data"
> or "Signed Decimal Data" format. An example of which is:
>
> 000001160} would convert to -116
> 000003407N would convert to -340.75
> 001169345O would convert to -116934.56
> 0000000395 would convert to 3.95
>
> The information on the mainframe cannot change format. We've been using
> an AS/400 to covert the information in a roundabout way, but will be
> abandoning the AS/400 platform soon and will need to convert the data
> into an Access database. There are too many variations to program into a
> module. Has anyone heard of this data type? If so, is there a module,
> piece of software, or conversion available for this data? We are trying
> to put this in Access, but I couldn't find any references either in my
> developer's manual or in Access. Does anyone have any ideas?

This is EBCDIC zoned decimal. The sign is stored in the "zone" of the
low-order digit. ORing the low digit with a 0xF0 (240 decimal) will
make the low-order digit visible. The formula for sorting out the sign
is a bit complicated, but for "well formed" data you should be safe
assuming that a zone with an even value or the value 0xF (15) is plus,
with other odd values being minus.

Flatiron Solutions, Inc.

unread,
Jun 17, 1999, 3:00:00 AM6/17/99
to
Hi,

We have a product, Mainframe Data Engine 2000, that does exactly what
you're looking for. MDE 2000 takes data from mainframe sources,
including the zoned decimal fields you've referred to and populates
Microsoft Access databases directly. It will also handle many other
types of fields, complex COBOL record structures and Y2K date
remediation, all on-the-fly. Please feel free to call or email if you
have any questions or need more information.

James Davidson
Flatiron Solutions ,Inc.
jdav...@flatironsolutions.com
212 645-3838
www.flatironsolutions.com


In article <3766B734...@nospam.rutgers.edu>,


Douglas McCrea <dmc...@nospam.rutgers.edu> wrote:
> We've downloaded data from a mainframe which is in "Zoned Decimal
Data"
> or "Signed Decimal Data" format. An example of which is:
>
> 000001160} would convert to -116
> 000003407N would convert to -340.75
> 001169345O would convert to -116934.56
> 0000000395 would convert to 3.95
>
> The information on the mainframe cannot change format. We've been
using
> an AS/400 to covert the information in a roundabout way, but will be
> abandoning the AS/400 platform soon and will need to convert the data
> into an Access database. There are too many variations to program
into a
> module. Has anyone heard of this data type? If so, is there a module,
> piece of software, or conversion available for this data? We are
trying
> to put this in Access, but I couldn't find any references either in my
> developer's manual or in Access. Does anyone have any ideas?
>

> -Doug
>
> _______________________
> Douglas McCrea
> Computer Systems Manager
> RCSC&SA Business Office
> dmc...@rci.rutgers.edu
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

David L. Cobb

unread,
Jul 21, 1999, 3:00:00 AM7/21/99
to
Douglas McCrea wrote:

> We've downloaded data from a mainframe which is in "Zoned Decimal Data"
> or "Signed Decimal Data" format. An example of which is:
>
> 000001160} would convert to -116
> 000003407N would convert to -340.75
> 001169345O would convert to -116934.56
> 0000000395 would convert to 3.95
>

Try this.

This is set for a 10 character mainframe number with an implied decimal
(picture 9(8).99 for cobol programs)

' get Zoned Decimal item
ZDamount = Mid$(filedata, 41,10)
' determine if value is negative
op = InStr("}JKLMNOPQR", Right(ZDamount, 1))
If op > 0 Then
ZDamount = "-" & Left(ZDamount, 9) + Trim(Str(op - 1))
End If
' set decimal place for currency
Newamount = CDbl(ZDamount) / 100

David L. Cobb
BeechMere Associates, Inc.


David L. Cobb

unread,
Jul 23, 1999, 3:00:00 AM7/23/99
to
Chuck Grimsby wrote:

> Function cvrtpacked(nmbrin As String, PAD As Integer) As String

This is picky, but this routine really converts Zoned decimal numbers, not
packed numbers.

0 new messages