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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
nesting loops
 Login/Join
 
Member
posted
Here's my problem:
I have a proc that loops through a table and adds the appropriate values to a variable array. I have a second proc that loops through a table and divides the values in the rows by a given number.
I need to take the values in the array and use them as the divisor in the second proc. How do I use the first loop in the second loop?

Loop1:
-SET &NUM = 0;
-SET &A = 1;
LOOP WHILE &A LE &RECORDS
TABLE FILE T_ATCRC_CLNT_RPT_CARD_MTRC
SUM
COMPUTE &NUM = (YTD_VOL_Q/1000000) ; AS ''
BY MTRC_DESC_X AS ''
BY SLN_SRT NOPRINT AS ''
BY COMB_C AS ''
WHERE CUST_OWN_C EQ '&SEGMENT';
WHERE MTRC_C EQ 'TM1002';
ON TABLE HOLD AS TEMP
END
-RUN

Loop2:
-SET &NUM = 11.1492;
-SET &A = 1;
LOOP WHILE &A LE &RECORDS
TABLE FILE T_ATCRC_CLNT_RPT_CARD_MTRC
SUM
COMPUTE FVOL/D18.6 = (YTD_VOL_Q / &NUM) ; AS ''
BY MTRC_DESC_X AS ''
ACROSS SLN_SRT NOPRINT AS ''
ACROSS COMB_C AS ''
WHERE CUST_OWN_C EQ '&SEGMENT';
WHERE SCTN_SRT_N = 110;
END
-RUN

I need to change &NUM each time through the loop to the next value in the first array.

Thanks,
Mike
 
Posts: 9 | Registered: December 06, 2005Report This Post
Platinum Member
posted Hide Post
Store &NUM in your TEMP hold file as some column named say QUOTIENT, then in your second loop, perform a TABLE FILE TEMP, where you reference the column QUOTIENT in your calculations.


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders