Packed numeric fields

M

MArilyn

I need to import several mainframe files into a ACCESS
2000 database. There are several packed fields in these
files. Can you import them as is or is there a certain way
of handling this?
 
J

John Nurick

Hi Marilyn,

AFAIK Access doesn't understand these.

I'd probably use a Perl script to convert them into string
representations of decimal numbers and import the resulting file. It
should also be possible to import them as text fields and then use a
user-defined VBA function in a query to convert them into a numeric type
that Access does recognise.



I need to import several mainframe files into a ACCESS
2000 database. There are several packed fields in these
files. Can you import them as is or is there a certain way
of handling this?

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
J

Joe Fallon

"AFAIK Access doesn't understand these. "

IIRC Access can't even link to them.

I never tried to use them when I linked to AS/400 tables.
I had to tiptoe around them because they caused problems.

It has been a long time though and maybe things have changed.
--
Joe Fallon
Access MVP



John Nurick said:
Hi Marilyn,

AFAIK Access doesn't understand these.

I'd probably use a Perl script to convert them into string
representations of decimal numbers and import the resulting file. It
should also be possible to import them as text fields and then use a
user-defined VBA function in a query to convert them into a numeric type
that Access does recognise.



I need to import several mainframe files into a ACCESS
2000 database. There are several packed fields in these
files. Can you import them as is or is there a certain way
of handling this?

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
M

Marilyn

Thank you for responding John. I do not know Perl, so I am
going to try the Text/VBA route. Would I need to increase
the field length to compensate for the packed length?
-----Original Message-----
Hi Marilyn,

AFAIK Access doesn't understand these.

I'd probably use a Perl script to convert them into string
representations of decimal numbers and import the resulting file. It
should also be possible to import them as text fields and then use a
user-defined VBA function in a query to convert them into a numeric type
that Access does recognise.



I need to import several mainframe files into a ACCESS
2000 database. There are several packed fields in these
files. Can you import them as is or is there a certain way
of handling this?

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
J

John Nurick

Marilyn,

I'd import each packed number field into a text field containing as many
characters as there are bytes in the number. Then I'd create a new field
of the appropriate type and size to receive the number when I unpacked
it. This would typically be a Long, though for larger numbers or packed
numbers with implied decimals you'd need to use Currency or Decimal.

Finally I'd use a custom VBA function in an update query to convert the
packed numbers into "ordinary" numbers in the new field.

In case you need it, here
http://www.discinterchange.com/TechTalk_Packed_fields_.html is a useful
page explaining how packed fields work.


Thank you for responding John. I do not know Perl, so I am
going to try the Text/VBA route. Would I need to increase
the field length to compensate for the packed length?
-----Original Message-----
Hi Marilyn,

AFAIK Access doesn't understand these.

I'd probably use a Perl script to convert them into string
representations of decimal numbers and import the resulting file. It
should also be possible to import them as text fields and then use a
user-defined VBA function in a query to convert them into a numeric type
that Access does recognise.



I need to import several mainframe files into a ACCESS
2000 database. There are several packed fields in these
files. Can you import them as is or is there a certain way
of handling this?

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top