Hello,
i have a problem with calculate the corret field length for some DB-fields on a i5.
i have a DB-Table with some fields:
FIRNR 00004P00
BERNR 00007P00
KTOKZ 00001A
GN0GR 00001P00
K FIRNR SIGNED
K BERNR SIGNED
when i call i5_info on every field: (comment and headings not shown in this post)
name => FIRNR
PcType => 1
PcLen => 2
AsType => 6 == PACKED
AsLen => 3
AsDec => 0
allowNull => 0
varLen => 0
i5_fieldlength : 2
name => BERNR
PcType => 2
PcLen => 4
AsType => 6 == PACKED
AsLen => 4
AsDec => 0
allowNull => 0
varLen => 0
i5_fieldlength: 4
name => KTOKZ
PcType => 0
PcLen => 1
AsType => 0 == CHAR
AsLen => 1
AsDec => 0
allowNull => 0
varLen => 0
i5_fieldlength: 1
name => GN0GR
PcType => 1
PcLen => 2
AsType => 6 == PACKED
AsLen => 1
AsDec => 0
allowNull => 0
varLen => 0
i5_fieldlength: 2
first Question: for what stand PcType? and what are the differnces between PcType 0, 1 and 2 ?
second : How can i calculate the correct length for PACKED fields?
i found this site:
http://publib.boulder.ibm.com/iseries/v ... HDRPADECFO
that says: 2 * n - 1 ; n = AsLen
so:
FIRNR: 2*3 -1 = 5 <= this should 4?
BERNR: 2*4 - 1 = 7
GN0GR: 2 * 1 - 1 = 1
Regards
Manuel

