[SOLVED] unwanted field prints in a COMPUTE using LAST
I have the following line in the PRINT statement of a TABLE FILE:
COMPUTE BATCH_SEQUENCE/P5L = IF AGENCY EQ LAST AGENCY THEN BATCH_SEQUENCE + 1 ELSE 1;
This COMPUTE is the 2nd field in the PRINT statement. The first field to PRINT is a DEFINEd field. The math and numbering works fine for the BATCH_SEQUENCE, but it also prints the AGENCY field right before the BATCH_SEQUENCE.
Further down in the PRINT statement, I have the following similar COMPUTE:
COMPUTE SUFFIX/P3L = IF AGENCY EQ LAST AGENCY THEN SUFFIX + 1 ELSE 1;
For this one, it correctly prints only the SUFFIX.
If I comment out the first COMPUTE, the 2nd COMPUTE still works fine. If I switch the positions of the 2 COMPUTEs the first one (which is the 2nd one shown above in this post) prints the AGENCY field.
If I delete that first DEFINEd field in the PRINT statement, the next COMPUTE (whichever of the two shown above is first in the PRINT statement) prints the AGENCY field.
Is there a way to prevent the printing of the AGENCY field in that first COMPUTE?This message has been edited. Last edited by: <Kathryn Henning>,
Thanks,
~Mark
WebFocus Client 7.703 WebFocus Reporting Server 7.705 Windows Server 2008 R2 Dev Studio 7.703 Apache Tomcat/6.0.20 Excel, PDF IWAY DM Server 7.705 DataMigrator 7.705
February 26, 2015, 11:33 AM
Tom Flynn
As the manual states, whenever you use a COMPUTE, all columns with the COMPUTE are held in the output file. Since AGENCY was in the initial COMPUTE, it won't add it again.
Use DEFINE or HOLD the data and print only the columns you want in another step, not just PRINT *...
Or you can add the AGENCY field yourself with a NOPRINT and use ON TABLE SET HOLDLIST PRINTONLY to prevent it from appearing in the holdfile.
WF 7.6.11 Output: HTML, PDF, Excel
February 26, 2015, 12:22 PM
folkey
I found the answer in a very old case of ours - sorry. It's pretty much the same as what Tewy said:
SOL: SET HOLDLIST=PRINTONLY, ensure that only PRINTed fields(those not referenced by a NOPRINT) will be placed in the HOLD file.
Thanks,
~Mark
WebFocus Client 7.703 WebFocus Reporting Server 7.705 Windows Server 2008 R2 Dev Studio 7.703 Apache Tomcat/6.0.20 Excel, PDF IWAY DM Server 7.705 DataMigrator 7.705