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.
Joel, From your example it is hard to understand what you want to achieve. You have twice across "England France Italy" Under CAR you have "Alpha Romeo", "Jaguar", "Peugeot". Could you be a bit more precise?
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
-* File Joel1.fex
DEFINE FILE CAR
DC/A12='DEALER_COST';
RC/A12='RETAIL_COST';
END
TABLE FILE CAR
SUM DC DEALER_COST RC RETAIL_COST
BY COUNTRY
BY CAR
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE' OR 'ITALY';
ON TABLE SAVE AS JOEL
END
-RUN
FILEDEF JOELM DISK JOEL.MAS
-RUN
-WRITE JOELM FILENAME=JOEL , SUFFIX=FIX
-WRITE JOELM SEGMENT=JOEL, SEGTYPE=S0
-WRITE JOELM FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A10, ACTUAL=A10, $
-WRITE JOELM FIELDNAME=CAR, ALIAS=E02, USAGE=A16, ACTUAL=A16, $
-WRITE JOELM SEGMENT=CST, PARENT=JOEL, OCCURS=VARIABLE
-WRITE JOELM FIELDNAME=CODE, ALIAS=E03, USAGE=A12, ACTUAL=A12, $
-WRITE JOELM FIELDNAME=COST, ALIAS=E04, USAGE=D7, ACTUAL=A07, $
-RUN
TABLE FILE JOEL
SUM COST
BY CAR
ACROSS CODE AS ''
ACROSS COUNTRY AS ''
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
You can avoid the Dialog Manager manipulation, by use of the McGuyver technique, as discussed in recent posts. The crux is to transform the Dealer Code and Retail Code captions from field-names into ACROSS sort values.
Essentially the technique uses a join to double the set of reportable records, and establishes a single DEFINEd numeric variable to hold values of DEALER_COST or RETAIL_COST, depending on a sort-key variable with "Dealer Code" and "Retail Code" as its values. Your report request will SUM [the defined numeric field] BY Car ACROSS [the new key field] AS '' ACROSS Country AS ''
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Jack stole my thunder, but here's the code I came up with: JOIN BLANK WITH DEALER_COST IN CAR TO BLANK IN FSEQ
DEFINE FILE CAR BLANK / A1 = ' '; COST_TYPE/A11 = IF COUNTER EQ 1 THEN 'DEALER_COST' ELSE 'RETAIL_COST'; COST_AMOUNT/D7 = IF COUNTER EQ 1 THEN DEALER_COST ELSE RETAIL_COST; END
TABLE FILE CAR PRINT COST_AMOUNT BY COUNTRY BY CAR BY COST_TYPE WHERE COUNTER LE 2 ON TABLE HOLD END
TABLE FILE HOLD SUM COST_AMOUNT BY CAR ACROSS COST_TYPE ACROSS COUNTRY END
Jeff WebFOCUS 8.0.09, Unix-Win-z/OS FOCUS 7.3.1 on z/OS
It's important to include a WITH anchor in the define of BLANK, corresponding to the anchor point of the JOIN.
I have my own utility fex to set up the McGuyver file:
-* File MakeSeq.fex
-DEFAULTH &FILE=FSEQ, &KEY=BLANK, &COUNTER=COUNTER, &FIRST=1, &LAST=100
EX -LINES 7
EDAPUT MASTER, &FILE, CV, MEM
FILE=&FILE, SUFFIX=FOC, $
SEGNAME=FSEQ1, SEGTYPE=S1, $
FIELD=&KEY, , A1, ACCEPT=' ', INDEX=I, $
SEGNAME=FSEQ2, SEGTYPE=S1, PARENT=FSEQ1, $
FIELD=&COUNTER, , I4, $
END
CREATE FILE &FILE
MODIFY FILE &FILE
FREEFORM &KEY &COUNTER
MATCH &KEY &COUNTER
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA
-REPEAT SEQ.LOOP FOR &I FROM &FIRST TO &LAST ;
' ', &I, $
-SEQ.LOOP
END
The parameters allow the caller to tailor the range of Counter values stored in the focus file (and the filename and fieldnames as well). The END line after the EX -LINES block is for clarity; it's harmless, and saves the day if the count is 1 over
For the present case:
EX SESSION/CAR5
-* File CAR5.fex
EX BASEAPP/MAKESEQ FIRST=1,LAST=2,FILE=FOCSEQ,KEY=NADA
JOIN CLEAR *
JOIN NADA WITH DEALER_COST IN CAR TO NADA IN FOCSEQ
DEFINE FILE CAR
NADA/A1 WITH DEALER_COST =;
FIELD/A12 WITH COUNTER =
DECODE COUNTER (
1 'Dealer Cost'
2 'Retail Cost'
ELSE ' ');
Value/D12.2 WITH COUNTER =
IF COUNTER EQ 1 THEN DEALER_COST ELSE
IF COUNTER EQ 2 THEN RETAIL_COST ELSE 0;
Country/A10 =LCWORD(10,COUNTRY,'A10');
Car/A16 =LCWORD(16,CAR,'A16');
END
TABLE FILE CAR
SUM Value AS ''
BY Car AS ''
ACROSS COUNTER NOPRINT
ACROSS FIELD AS ''
ACROSS Country AS ''
WHERE CAR IN ('ALFA ROMEO' 'JAGUAR' 'PEUGEOT');
END
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005