>> Fetch & Select corrupt "status" variable with decimal columns
>>
>From: Jonathan Leffler
>
>This could be done by amending the c4gl script to add (yet another)
>processing step, this time using sed on the .c file. Add the lines
>below immediately after the line "P4=1":
>
> tmp=${TMPDIR:-/tmp}/c4gl.$$
> trap 'rm -f ${tmp}.1; exit 3' 1 2 3 13 15
>
>After each use of $FGLC3 (there are two of them), add:
>
> sed 's/status = (status < 0 && chkprec(&\\(.*\\), \\([0-9]*\\))) ? -1226 : \\
> status;/if (status == 0 && chkprec(&\\1, \\2)) status = -1226;/' \\
> $FBASE.c > ${tmp}.1
> mv ${tmp}.1 $FBASE.c
Jonathan,
Ghastly hack!! I don't care. It works. Thanks a lot! Your interest
and support is greatly appreciated.
My code however does not look like yours. I have got lines that
look like this:
status = (chkprec(&wamount, 1538)) ? -1226 : 0;
instead of
status = (status < 0 && chkprec(&wamount, 1538)) ? -1226 : status;
which i changed to this:
if (status == 0 && chkprec(&\\1, \\2)) status = -1226;
It does of course, change every occurance of this code ie. does not limit
itself to just code after a SELECT or FETCH.
I would suspect that any place in the program that used the "status"
variable and a decimal COULD BE adversely affected depending on the
circumstances. I half-heartdly tried to find such a place, no success
yet.
This place would be were "status != 0" before the chkprec code.
--
Michael J. Kuhn Consultant phone:410-254-7060
Email: kuhn@rhlab.com or kuhn%rhlab@uunet.uu.net or uunet!rhlab!kuhn
c/o Baltimore Rh Typing Laboratory, Inc. phone:410-225-9595