Need to read dates from BBX/PRO5 Business Basic files

We are converting some BBX/Pro5 Business Basic data files for a customer.
I can read all of the fields in the file except for the DATE fields, which are stored in some kind of packed format.

Here's an example of the file layout:
-------------------------------------------------------------------------------------------------------------------
REF NAME               DESCRIPTION                            MASK/FORMAT   POSITION
PAYMENT DATE      CURRENT PAYMENT DATE      MMDDYY B   1(45,3)
   ENCRYPT WITH:         DECRYPT WITH:

DUE DATE               CURRENT DUE DATE                MMDDYY B   1(48,3)
   ENCRYPT WITH:         DECRYPT WITH:

DISCOUNT DATE    INVOICE DISCOUNT DATE      MMDDYY B   1(45,3)
   ENCRYPT WITH:         DECRYPT WITH:
-------------------------------------------------------------------------------------------------------------------

Opening the file and reading into a string variable results in garbage.
Since the field is only 3 bytes, there must be some way to define a field other than as a string.

Does anyone still remember this and would be willing to point me in the right direction?

Thanks!

John -Z-
LVL 1
John ZupancicAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sarabandeCommented:
can you open the file in a hex editor as a binary file and post the 3 bytes of  one of the dates?

3 bytes is 24 bits what allows for example to use 5 bits (1 ... 31) for day, 4 bits (1 ... 12) for month, 11 bits (0 ... 2048) for year (and still have 4 bits left).

Sara
John ZupancicAuthor Commented:
Thanks for the reply but I figured it out.

The original programmer (late 80's/early 90's) had used "creative" programming to convert the MM DD YY segments into the upper end of the ASCII character set.

I found some snippets of old code and figured out how to decode it.

Thanks again.

John -Z-

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
John ZupancicAuthor Commented:
I figured out the problem on my own.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.