Hello Peggers and Happy New Year!
I have a little problem for you, so you can get those alcohol infested brains in gear again.
I'm trying to make a procedure to calculate table/row size - basically the same as tabanalysis, but from 4GL.
It works - kind of. Some tables are off by a few bytes per row. I've found out, that this is caused by dictionary changes. Somehow tabanalysis uses information from before the tables were changed.
Can anybody shed some light on this?
Any other comments to the routines are also welcome.
calcTableSize.p contains the function/procedures to do the calculations.
I hope you can help
Regards
Mike
Oh I almost forgot - Progress 9.1B
Sample program to run the routines:
def var hProc as handle no-undo.
def var hBuf as handle no-undo.
def var iTotLen as dec no-undo.
def var iMinLen as dec no-undo.
def var iMaxLen as dec no-undo.
def var iNum as int no-undo.
def var iNumCol as int no-undo.
run calcTableSize.p persistent set hProc.
if not valid-handle( hProc ) then do:
MESSAGE "Could not load calcTableSize"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
return.
end.
for each _File where _File._File-number > 0 and _File._File-number < 32000:
run getTableSize in hProc( output iTotLen, output iMinLen, output iMaxLen,
output iNumCol, output iNum, _File._File-name ).
disp
_File._File-name label "Name"
iNum label "Records"
iTotLen label "Size"
iMinLen label "Min"
iMaxLen label "Max"
iTotLen / iNum label "Mean"
iNumCol label "Num Col".
end.
delete procedure hProc.
I have a little problem for you, so you can get those alcohol infested brains in gear again.
I'm trying to make a procedure to calculate table/row size - basically the same as tabanalysis, but from 4GL.
It works - kind of. Some tables are off by a few bytes per row. I've found out, that this is caused by dictionary changes. Somehow tabanalysis uses information from before the tables were changed.
Can anybody shed some light on this?
Any other comments to the routines are also welcome.
calcTableSize.p contains the function/procedures to do the calculations.
I hope you can help
Regards
Mike
Oh I almost forgot - Progress 9.1B
Sample program to run the routines:
def var hProc as handle no-undo.
def var hBuf as handle no-undo.
def var iTotLen as dec no-undo.
def var iMinLen as dec no-undo.
def var iMaxLen as dec no-undo.
def var iNum as int no-undo.
def var iNumCol as int no-undo.
run calcTableSize.p persistent set hProc.
if not valid-handle( hProc ) then do:
MESSAGE "Could not load calcTableSize"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
return.
end.
for each _File where _File._File-number > 0 and _File._File-number < 32000:
run getTableSize in hProc( output iTotLen, output iMinLen, output iMaxLen,
output iNumCol, output iNum, _File._File-name ).
disp
_File._File-name label "Name"
iNum label "Records"
iTotLen label "Size"
iMinLen label "Min"
iMaxLen label "Max"
iTotLen / iNum label "Mean"
iNumCol label "Num Col".
end.
delete procedure hProc.