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 anyone have sample code that can create a variable to be used to set the number of times a LOOP will execute based on the result of a count of records, eg:
DEFINE FILE TABLE1 COUNT/I3 = 1; END
TABLE FILE TABLE1 SUM COUNT ON TABLE HOLD AS XYZ END -RUN
and use the value of the count to set the variable that controls the number of times a sunsequent LOOP will run further down the code?
&LINES or &RECORDS could work for you. They are variables that are created by FOCUS after every table call which contains the number of row in the data set (&LINES) and how many lines was read from the database (&RECORDS).
Posts: 406 | Location: Canada | Registered: May 31, 2004
g'day, i use &LINES. TABLE FILE CAR BY MODEL ON TABLE HOLD END -RUN -SET &NUMCARS = &LINES ; -REPEAT MYENDLOOP &NUMCARS TIMES TABLE FILE somethingelse ...do stuff END -RUN -MYENDLOOP -**** or use explicit kounter -SET &KOUNTER = 0; -MYTOPLOOP -SET &KOUNTER = &KOUNTER + 1; TABLE FILE something ..do stuff END -RUN -IF &KOUNTER LT &NUMCARS GOTO MYTOPLOOP; -*you're allright now
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Thanks all for your suggestions, I have only checked the posts now (been up to the eyeballs in work!) I'll leave the subject open and let you know how I go .
Susannah your suggestion has worked a treat, thank you very much, I have solved not just the coding issue but provided a tool to really boost productivity in a few key business areas I deal with.
great to know. Congratulations. Take a look at Pietro's suggestion...its slightly different, and also very important technique that will give you alot more ideas...You can not only count how many somethings there are...you can actually make a list of them, read them 1 at a time, and loop with an actual value of variable, not just a loop kounter. Be sure and come to Tech Summit in May in LasVegas and pick up lots more great ideas from everyone!
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003