Focal Point
[SOLVED] EXTRA column in HOLD file

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2097079096

December 13, 2018, 07:56 PM
sh98110
[SOLVED] EXTRA column in HOLD file
I am running the following code under 8.2.01m:

TABLE FILE CAR
SUM
CNT.DST.MODEL
MIN.MODEL
MAX.MODEL
CNT.DST.COUNTRY
MIN.COUNTRY
MAX.COUNTRY
ON TABLE HOLD FORMAT ALPHA
END
? HOLD

My question is, why is there an extra field in my HOLD file?

DEFINITION OF HOLD FILE: HOLD
FIELDNAME ALIAS FORMAT
MODEL E01 I9
MODEL E02 A24
MODEL E03 A24
MODEL E04 A24
COUNTRY E05 I9
COUNTRY E06 A10
COUNTRY E07 A10
COUNTRY E08 A10

The extra values are E02 and E06- the other columns are what you would see without the HOLD file.

I know that WebFOCUS is generating the column, because ON TABLE SET HOLDLIST PRINTONLY removes it- I just don't understand the reasoning.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
December 14, 2018, 03:24 AM
Frans
As you mentioned it, HOLDIST PRINTONLY prevents this automatic adding of fields. I think it's just one of those things that sneaked into the program once as default, which they can't change because of backwards compatibility.

The solution is easy, just put SET HOLDLIST = PRINTONLY in edasprof and that will be your systemwide default.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
December 14, 2018, 09:17 AM
MartinY
To have 100% exact answer, you may need to talk with IB support team.
But here my explanation, which I think is not that far from the exact one.

It's all about internal process (matrix).
When you perform CNT.DST.MODEL, internally the system is first find the DST (distinct) value from MODEL and stores it in its internal matrix.
Then it use this "new" internal field to perform the CNT (count) and have the result returned to you.
So as for internal MODEL fields, you have two of them :
- one which is alpha (A24) that contains the distinct values (which is probably E02)
- one which is int (I9) : the count (from the distinct values)

So as Frans stated, it's always a good idea to have the SET HOLDLIST = PRINTONLY in effect to avoid confusion.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
December 14, 2018, 09:18 AM
jgelona
This is another one of those things they don't teach anymore.

By default your output file will have all fields in your SUM/PRINT statements and all the fields used in COMPUTE statements. The CNT.DST, MIN, MAX prefixes are treated in the internal matrix like a COMPUTE. Because you are using SUM, the last MODEL and last COUNTRY will also be in the output unless you use HOLDLIST=PRINTONLY somewhere.

If you have over 20+ years of code like we do, I'd be careful about putting this in the edasprof. You could have code that depends on these "extra" fields being the HOLD files. You could end up with programs that stop working.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
December 14, 2018, 10:06 AM
Frans
That's why I think if you have a younger environment, it's important to set it in edasprof to avoid this kind of implicit dependencies.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
December 19, 2018, 09:07 AM
Doug
👍 I like that idea Frans, I normally add "ON TABLE SET HOLDLIST PRINTONLY", as well as ON TABLE SET ASNAMES ON" in my fexes to be specific. However, with the development being pushed toward IA instead of AS, the SETing of HOLDLIST in edaprof is an excellent idea. If can always be reversed in the fexes as needed.
quote:
The solution is easy, just put SET HOLDLIST = PRINTONLY in edasprof and that will be your system-wide default.





   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206