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.
Does your data have the case number tied to each line of information? Computes are performed at the aggregate(or for each record) after a sort or if no sort then for each record. Might be you need to do some creative selection with a where total, put in a hold file and then do the COMP. Or COMPUTE a COMP for each line then do some other selection. I see this as a multiple step process.
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
Okay, had a few moments to play and here is what I came up with ( not pretty may not be even what you want ):
-SET &ECHO=ALL; SET ASNAMES = ON FILEDEF LRECL80_UNO DISK D:\FOCUS\UNO\QUALOUT\TEST.TXT DEFINE FILE LRECL80_UNO COUNTER/I2 = IF COUNTER EQ 4 THEN 1 ELSE COUNTER + 1; KEY/I2 = IF COUNTER EQ 1 THEN KEY + 1 ELSE KEY; CASE/A4 = EDIT (LINE80,'9999'); PCT/A4 = EDIT (LINE80,'$$$$$999'); PCTN/I4 = EDIT (PCT); ATV/A1 = EDIT(LINE80,'$$$$$$$$$9'); ATVN/I1 = EDIT(ATV); END -* DEFINES NOT NEEDED IF YOU HAVE MFD -* LRECL80_UNO IS JUST A FAKE OUT TO DO 80 COLUMN RECORDS HAVE TO DEFINE THE FIELDS IN -* THE PROGRAM -* CREATE SOME FIELDS TO HELP TABLE FILE LRECL80_UNO PRINT CASE PCTN ATVN COMPUTE HAS100/I1 = IF PCTN EQ 100 THEN 1 ELSE 0; COMPUTE AVX/I1 = ATVN; BY KEY BY PCTN BY ATVN ON TABLE HOLD AS HOLD1 END -* RESORT AND PULL FIRST AND LAST CALCULATED IN PREVIOUS JOB AS IT DOES LOW TO HIGH -* NOW SORT HIGH TO LOW TABLE FILE HOLD1 SUM HAS100 FST.AVX AS FAVX LST.AVX AS LAVX BY KEY PRINT CASE PCTN ATVN AVX BY KEY BY HIGHEST PCTN BY HIGHEST ATVN ON TABLE HOLD AS HOLD2 END -*NOW PUT THE COMP ON EACH CASE LINE TABLE FILE HOLD2 PRINT KEY CASE PCTN ATVN HAS100 COMPUTE COMP/I1 = IF HAS100 EQ 0 THEN FAVX ELSE LAVX; ON TABLE HOLD AS HOLD3 END -* NOW IF YOU ONLY WANT THE LINE OF THE CASE THAT APPLIES TABLE FILE HOLD3 PRINT KEY CASE PCTN ATVN COMP COMPUTE WANTED/I1 = IF HAS100 GT 0 AND COMP EQ ATVN AND PCTN NE 0 THEN 1 ELSE IF HAS100 EQ 0 AND PCTN EQ 0 AND COMP EQ ATVN THEN 1 ELSE 0; NOPRINT WHERE TOTAL WANTED EQ 1 END