As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Hi All, if I have a table like this with asnames=on: TABLE FILE CAR COUNT SALES BY COUNTRY BY CAR BY MODEL BY BODYTYPE ON TABLE COLUMN-TOTAL AS 'TOTALCNT' END -RUN
can I read the TOTALCNT as variable from this run to be able to reuse this total count somewhere in the report?
on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
If you want the number of lines from the report use &LINES.
If you want to use the total of a field try this.
DEFINE FILE CAR
TOTALCNT/I9 WITH BODYTYPE = 1 ;
END
TABLE FILE CAR
SUM TOTALCNT
ON TABLE SAVE AS TOTCNT
END
-RUN
-READ TOTCNT &TOTALCNT.A9.
-TYPE Total Count = &TOTALCNT
I think this will give you the output that you want.
SET ASNAMES=ON
TABLE FILE CAR
COUNT SALES AS 'TTL_CNT'
SUM CNT.SALES
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON TABLE HOLD AS CARCNT
END
?FF CARCNT
-EXIT
0 NUMBER OF RECORDS IN TABLE= 18 LINES= 18
FILENAME= CARCNT
TTL_CNT E01 I5
COUNTRY E02 A10
CAR E03 A16
MODEL E04 A24
BODYTYPE E05 A12
SALES E06 I5
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
can I read the TOTALCNT as variable from this run to be able to reuse this total count somewhere in the report?
The simple answer is no - column totals are not saved as part of any hold file. The AS phrase used in the ON TABLE COLUMN-TOTAL only modifies the label placed on the column-total line, it does not create any verb object that can be held. Since column-totals are not included in the hold file, it has no relevance.
That being said, there are a number of ways to still get the desired result as has been demonstrated. You can use the &LINES or &RECORDS variables after creating your hold file. You can use prefix operators such as TOT. or ST. to display the total count within headings,footings, subheadings, subfootings, etc. You can perform a count and then read that back in as a variable using -READ. You could even hold as format WP (this actually DOES save the COLUMN-TOTAL lines and then create a MASTER file to reread your output file and use define to find the column totals and somehow parse out the values you want.
So the long answer is yes, there is a way. Just not the way you had first envisioned. You'll get used to looked for several different ways to accomplish your task. The FOCUS language is great that way. Take your pick.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007