pacdecimal files, anyone dealt with them?

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

pacdecimal files, anyone dealt with them?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:18 pm

by pillick >> Wed, 18 Dec 2002 2:06:27 GMT

The raw data I have to load into my jade database is in pacdecimal format. Can anyone explain to me what that is, and how I might go about unpacking it?

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: pacdecimal files, anyone dealt with them?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:18 pm

by allistar >> Wed, 18 Dec 2002 3:22:39 GMT
The raw data I have to load into my jade database is in pacdecimal format. Can anyone explain to me what that is, and how I might go about unpacking it?

If you mean "packed decimal" then you may find this interesting:

http://www2.hursley.ibm.com/decimal/DPDecimal.html

You would have to read the file into a binary structure and do bitwise operations on it. I don't think this would be very efficient in Jade, coding it in C (or C++) would be faster.

Regards,
Allistar.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: pacdecimal files, anyone dealt with them?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:18 pm

by cnwjhp1 >> Mon, 27 Jan 2003 5:33:29 GMT

We have dealt with packed decimal (also called bcd), in addition to ebcdic. You could use something based on this sort of thing

vars
s,t,u,v:String;
i,j,k,l:Integer;
cc:Character;begin

foreach i in 1 to k do
cc:=s.Character;
t:=(cc.Integer/16).Integer.String;
u:=u&t;
t:=(cc.Integer mod 16).String;
u:=u&t;
endforeach;
return u.Integer;

Presumably this is in a fixed-format file, so some string positions, etc could be hard-coded. It would be faster in C, but the difference in speed may not be important to you. If the numbers can be negative, watch out for the sign digits. You may have to ask the data provider about the sign - I think it could be leading or trailing.

Cheers,
John P


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests

cron