May 17, 2017, 01:34 PM
Danny-SRL[Share] SET HOLDLIST=PRINTONLY, ASNAMES=ON and DST. - a side effect
An interesting bug(?) feature(?).
See the following:
SET ASNAMES=OFF
SET HOLDLIST=ALL
TABLE FILE CAR
PRINT DST.MPG
ON TABLE HOLD AS TMPOBD
END
?FF TMPOBD
FILENAME= TMPOBD
MPG E01 D6
MPG E02 D6
SET ASNAMES=OFF
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
PRINT DST.MPG
ON TABLE HOLD AS TMPOBD
END
?FF TMPOBD
FILENAME= TMPOBD
MPG E01 D6
SET ASNAMES=ON
SET HOLDLIST=ALL
TABLE FILE CAR
PRINT DST.MPG
ON TABLE HOLD AS TMPOBD
END
?FF TMPOBD
FILENAME= TMPOBD
DISTINCT E01 D6
MPG E02 D6
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
PRINT DST.MPG
ON TABLE HOLD AS TMPOBD
END
?FF TMPOBD
FILENAME= TMPOBD
DISTINCT E01 D6
Say that you want to get all the distinct values of MPG in order to JOIN them to some other file.
If you are not aware that ASNAMES=ON and HOLDLIST=PRINTONLY (they are set in EDASPROF for example), your JOIN is going to cause an error: MPG unknown in file TMPOBD.
May 18, 2017, 05:14 AM
Dave
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
TABLE FILE CAR
SUM DST.MPG AS 'MPG'
ON TABLE HOLD AS TMPOBD
END
?FF TMPOBD
?
May 22, 2017, 02:53 AM
Danny-SRLDave,
Of course with the AS clause MPG will be the fieldname.
At a customer site there was
TABLE FILE CAR
PRINT DST.MPG
ON TABLE HOLD AS TMPOBD
END
after which a JOIN using MPG.
All this worked well until somebody put
SET HOLDLIST=PRINTONLY in EDASPROF.
To be free of side effects, I usually code the SET parameters in the TABLE request.
Cave focum!
May 22, 2017, 03:23 AM
DaveOh yeah,
I misread your post. I though it was more of a : "look what happend!".
I thought is was an easy fix.
...and yes. This happens. But that goes for all settings in EDASPROF.