Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] read 10 rows at a time from the loop and add it to end result and loop again

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] read 10 rows at a time from the loop and add it to end result and loop again
 Login/Join
 
Gold member
posted
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,


WebFOCUS 8
Windows, All Outputs
 
Posts: 73 | Registered: April 06, 2016Report This Post
Virtuoso
posted Hide Post
Your code does not make sense for me (at least partially).

You are doing TABLE FILE MAS_LIST to SAVE to a file that is not used

How does ROW_NUM is defined ? With this code you will SAVE AS MASITEM as many time you loop and this for nothing

You filter WHERE CODE_LINE CONTAINS '&MSTRNAME' where &MSTRNAME is not defined anywhere

You have no where something that can limit to 10
You may need a loop in a loop


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
I'm at a loss how this is a spec for a BI platform. Could you share the use case for this?


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
Sorry for Mistype. Right now i am reading 1 row but my request is read 10 row at a time instead of 1 row.

   TABLE FILE TESTFILE
PRINT
COMPUTE ROW_NUM/I3 = ROW_NUM + 1;
BY TESTFIELD
WHERE READLIMIT EQ 1000
ON TABLE HOLD AS MAS_LIST
END
-RUN


WebFOCUS 8
Windows, All Outputs
 
Posts: 73 | Registered: April 06, 2016Report This Post
Gold member
posted Hide Post
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.


WF: 8201, OS: Windows, Output: HTML, PDF, Excel
 
Posts: 78 | Registered: November 08, 2010Report This Post
Expert
posted Hide Post
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, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] read 10 rows at a time from the loop and add it to end result and loop again

Copyright © 1996-2020 Information Builders