Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the pack/unpack algorithm for the packed fields?

Status
Not open for further replies.

davidchardonnet

Programmer
Mar 21, 2001
167
0
0
FR
Hello,

I want to make a program on a PC that is able to unpack AS/400 data fields, after importing raw files. Do you know how I can do that?
I have no idea of how these fields are built.
Can you help me?

Thank you for your help.

David
 
hi,David
iSeries uses EBCDIC. under this env,

unpacked numeric fields are like these:
1234567+ 12345678-
------- --------
FFFFFFF FFFFFFFD
1234567 12345678

the packed numerics are like these:
???? ?????
---- -----
1357 ?2468
246F 1357D

.the last F of packed plus value
will be replaced by D(?) if the value is minus.
.the length of packed=int(unpacked/2)+1,so odd length
is efficient usage.
.internally, iSeries uses packed numerics when it calcs.

if u calc by these numerics under the PC
, u must convert them to ASCII.
 
Hi David,

If you've got Client Access there are some references you can use in VB to handle that for you. It's not too difficult. I've got sample code if you need it.

Trent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top