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, I need to read 10 rows at a time and add the result to end result and loop again another next 10 rows and add it end result until finshis all the rows in the table .I appreacite if any one have suggestion about this issue.
TABLE FILE TESTFILE
BY TESTFIELD
WHERE READLIMIT EQ 1000
ON TABLE HOLD AS MASLIST
END
-*=======================================
-SET &LOOPCNT=&LINES;
-SET &I=1;
-REPEAT ENDREPEAT WHILE &I LT &LOOPCNT;
-TYPE I &I
TABLE FILE MAS_LIST
PRINT
FILENAME_UPPER
WHERE (ROW_NUM EQ &I.EVAL)
ON TABLE SAVE AS MASITEM
END
-RUN
-SET &HLD_FIL_NAME = IF (&I.EVAL) GT 1 THEN 'FINALLST' ELSE 'FEXCOUNT&I.EVAL';
DEFINE FILE FEXDETAILS
MASFILE/A50='&MSTRNAME';
END
TABLE FILE FEXDETAILS
BY FEX_NAME AS 'FEXCOUNT'
BY MASFILE
WHERE CODE_LINE CONTAINS '&MSTRNAME'
ON TABLE HOLD AS &HLD_FIL_NAME
END
-RUN
-IF &HLD_FIL_NAME EQ 'FINALLST' GOTO SKP_MORE;
TABLE FILE FINALLST
BY FEXCOUNT
BY MASFILE
ON TABLE HOLD AS FINALLST
MORE
FILE FEXCOUNT&I.EVAL
END
-SKP_MORE
-SET &I=&I+1;
-ENDREPEAT1
TABLE FILE FINALLST
PRINT *
ON TABLE PCHOLD FORMAT HTML
END
This message has been edited. Last edited by: FP Mod Chuck,
By reading 10 rows at a time are you meaning instead of having just one row per loop when doing
WHERE (ROW_NUM EQ &I.EVAL)
ON TABLE SAVE AS MASITEM
You would want 10 rows at a time?
If that is the case can instead of using ROW_NUM can divide ROW_NUM by ten and use that to limit instead. so something like this
COMPUTE ROW_NUM_GROUP/I3 = (ROW_NUM-1)/10;
Would ignore the remainder and only have 0 - 99. (The -1 is so that the first group will have ten instead of nine values) That way the save file would have ten rows instead of one in each iteration of the loop if you change there WHERE to look at that group compute instead.
WHERE (ROW_NUM_GROUP EQ &I.EVAL)
Forgot to also mention will need to divide how you get the value for &LOOPCNT by 10 as well or will loop too many times.
If is more getting ten values onto one line to be able to use a -READ to read all ten at once would need an additional field as above that would use the MOD function and do an across value to put it into something like FILENAME_UPPER1, FILENAME_UPPER2, FILENAME_UPPER3, etc. If only working with hold/save files or that isn't what you would be wanting can ignore using the MOD function.
Would you please explain your expected results... It sounds like you'll get all the rows in the table anyway. Are you expecting to see only Ten Rows on the screen at a time? If so, consider LINES-PER-PAGE / Pagination (Basic WebFOCUS functionality)
quote:
and add it end result until finshis all the rows in the table
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005