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.
In Mainframe FOCUS, I am developing a report where I wish to have one or two lines of record information, including totals for some fileds, and then I want to have detail lines print below this total line.
How might I get totals or subtotals into the subhead line and then print the detail lines below this line?
Thank you in advance, and looking forward to any and all replies.This message has been edited. Last edited by: webmeister,
Create two hold files, one with the details and one with the subtotals. Add an extra by field in both hold files. Say 'A' for the subtotals and 'B' for the details. Combine the two hold files to one and create a report on the combined hold file with the extra field as first (invisible) sort field .
Based on that same field you can get the subtotals bold or cursive.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
SET ASNAMES=ON
TABLE FILE CAR
SUM FUEL_CAP AS 'TOTAL_FUEL_CAP'
BY COUNTRY
ON TABLE HOLD AS HOLD1
END
TABLE FILE CAR
PRINT FUEL_CAP AS 'DETAIL_FUEL_CAP'
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS HOLD2
END
MATCH FILE HOLD1
PRINT TOTAL_FUEL_CAP
BY COUNTRY
RUN
FILE HOLD2
PRINT DETAIL_FUEL_CAP
BY COUNTRY
BY CAR
BY MODEL
AFTER MATCH HOLD OLD-OR-NEW
END
TABLE FILE HOLD
PRINT
DETAIL_FUEL_CAP
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBHEAD
" Total Fuel Cap for <COUNTRY is <TOTAL_FUEL_CAP "
ON COUNTRY SKIP-LINE
END
WF 8 version 8.2.04. Windows. In focus since 1990.
Posts: 189 | Location: pgh pa | Registered: October 06, 2004
You can use prefix operators with fields in subheads so somthing like the following should get what you want.
TABLE FILE CAR
SUM CAR RCOST DCOST
BY COUNTRY
BY CAR
ON COUNTRY SUBHEAD
"Total for Country <COUNTRY <ST.RCOST <ST.DCOST"
ON COUNTRY SUBFOOT
" "
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=SUBHEAD, COLOR='RED',$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=4,POSITION=RCOST,$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=6,POSITION=DCOST,$
$
ENDSTYLE
END
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
On second thought, that won't get correct totals. Try this instead:
DEFINE FILE CAR
RCOST1/D9C=RCOST;
DCOST1/D9C=DCOST;
END
TABLE FILE CAR
SUM RCOST1 WITHIN COUNTRY NOPRINT
DCOST1 WITHIN COUNTRY NOPRINT
CAR RCOST DCOST
BY COUNTRY
BY CAR NOPRINT
ON COUNTRY SUBHEAD
"Total for Country <COUNTRY <ST.RCOST1 <ST.DCOST1"
ON COUNTRY SUBFOOT
" "
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=SUBHEAD, COLOR='RED',$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=4,POSITION=RCOST,$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=6,POSITION=DCOST,$
$
ENDSTYLE
END
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
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
To all of you for responding and suggesting so quickly, a big thank you! I'll put those suggestions into my project...and it should work. I had my head wrapped too tightly into the project and could not see the forest for the trees.
Remember that SUBHEAD always takes the values of inserted data from the first line of the sortgroup. So one can do away with DEFINEs and use a plain multi-set request:
TABLE FILE CAR
SUM RCOST NOPRINT DCOST NOPRINT
BY COUNTRY
PRINT RCOST DCOST
BY COUNTRY
ON COUNTRY SUBHEAD
"<COUNTRY<RCOST<DCOST"
ON COUNTRY SUBFOOT
" "
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=SUBHEAD, HEADALIGN=BODY, $
TYPE=SUBHEAD, ITEM=2, JUSTIFY=RIGHT, $
TYPE=SUBHEAD, ITEM=3, JUSTIFY=RIGHT, $
ENDSTYLE
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
And something more. In 7.6.7 there is a new SET command:
SET DUPLICATECOL={ON | OFF}
And the example in the documentation (page 43, 767snf.pdf):
Displaying Reports With Multiple Display Commands
The following request sums current salaries and education hours for the entire EMPLOYEE
data source and for each department:
TABLE FILE EMPLOYEE
SUM CURR_SAL ED_HRS
SUM CURR_SAL ED_HRS BY DEPARTMENT
END
With DUPLICATECOL=ON, the output has separate columns for the grand totals and for the
departmental totals:
CURR_SAL ED_HRS DEPARTMENT CURR_SAL ED_HRS
-------- ------ ---------- -------- ------
$222,284.00 351.00 MIS $108,002.00 231.00
PRODUCTION $114,282.00 120.00
With DUPLICATECOL=OFF, the output has one column for each field. The grand totals are
on the top row of the report, and the departmental totals are on additional rows below the
grand totals:
DEPARTMENT CURR_SAL ED_HRS
---------- -------- ------
$222,284.00 351.00
MIS $108,002.00 231.00
PRODUCTION $114,282.00 120.00
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
Thanks for replying, however.... we are an archaic FOCUS site, running FOCUS 7.1, and the DUPLICATECOL will not therefore help. If you have another idea or two, I would love to hear them, but it would have to be for an older release of mainframe FOCUS.
Maybe working out my suggestion will help you a bit.
SET ASNAMES=ON
DEFINE FILE CAR
GROUPCODE/A1='A';
DCAR/A10='';
DMODEL/A10='';
END
TABLE FILE CAR
SUM FUEL_CAP
BY GTOUPCODE
BY COUNTRY
BY DCAR AS CAR
BY DMODEL AS MODEL
ON TABLE HOLD AS HOLD1
END
DEFINE FILE CAR
GROUPCODE/A1='B';
END
TABLE FILE CAR
PRINT FUEL_CAP
BY GROUPCODE
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS HOLD2
END
-RUN
TABLE FILE HOLD1
PRINT *
ON TABLE HOLD AS HOLD3
MORE
FILE HOLD2
END
-RUN
TABLE FILE HOLD3
PRINT FUEL_CAP
BY GROUPCODE NOPRINT
BY COUNTRY
BY CAR
BY MODEL
END
This will give you the totals on the first line and then the details .
If you want a subtotal too, you can create a 3th HOLD file for that.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
DEFINE FILE CAR
TTL_CST/D12.2=DEALER_COST;
TTL_SLS/D12.2=SALES;
END
TABLE FILE CAR
SUM
TTL_CST NOPRINT
TTL_SLS NOPRINT
BY COUNTRY
PRINT DEALER_COST SALES
BY COUNTRY
BY CAR
ON COUNTRY SUBHEAD
"TOTAL <TTL_CST <TTL_SLS"
END
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