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.
My problem is regarding multiple repeat loops with same label name.This label name is changing dynamically.For example:
-SET ECHO=ALL; -SET &LOOP = 'LOOP'; -SET &N=1;
-REPEAT &LOOP WHILE &N LE 3; -TYPE ABC -TYPE &N -SET &N = &N+1; -&LOOP
-SET &LOOP= 'LOOP_P'; -SET &N=1; -REPEAT &LOOP WHILE &N LE 3; -TYPE XYZ -TYPE &N -SET &N = &N+1; -&LOOP
In the above code we are changing the value of '&LOOP' even then it is showing "DUPLICATE DASH REPEAT LABEL".I don't want to declare more than one LABEL for REPEAT loop.
in my opinion you can not change the labelname since the program first checks for the names. I think you should look for an other better option with static label names looping can be done without labels with counters. Search here for examples.
I see some other things that are incorrect... -SET ECHO=ALL; should be -SET &ECHO=ALL;
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
If you work through this logically you will realise that all the DM is resolved at initial execution and therefore the two -&LOOP labels will both be resolved to -LOOP. Even if you place -RUN DM at strategic points, you will never overcome the duplicate label problem.
Therefore you will have to resort to using a hardcoded label if you want this to work -
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
I did some testing of this and even if I use .EVAL on the &LOOP variables, when the -REPEAT loop needs to exit, it cannot find the ending -LOOP label. Ironically, the loop actually runs properly but only dies when it needs to exit.
Basically it looks like you cannot have an &VARIABLE for the ending label. WF seems to have a problem with this.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
Thanx a lot for your immediate responses!!!! Actually in the solution given above we are only changing the value of variable 'LOOP' by appending one counter variable.But what will happen if I want to change the vaue of "NEXTLOOP" at run time and use it as '&NEXTLOOP' .I think it will again raise the same issue.
In my report I need to execute REPEAT LOOP only.Please suggest me if there is some alternative or solution of my problem.
I can confirm for a fact that you cannot have Loop-labels with 'amper' variables. Here is a possible work around that you could use (only if the max loop counter is pre-defined) -
-SET &CNT=1; -REPEAT NDLOOP&CNT WHILE &N LE 3; ... ... -NDLOOP1 -NDLOOP2 -NDLOOP3 -NDLOOP4 -NDLOOP5 ... ... -NDLOOP20 -* The idea is to define a long list of -NDLOOP labels that essentially take the execution to the same place. The -REPEAT statement will accept amper variables for loop-label names and you use a different name every time. You trick the pgm into thinking it is going to a different place, but it is always going to the same section, with a whole bunch of dummy -Labels.
Hope that helps, Sandeep Mamidenna
------------------------------------------------------------------------------------------------- Blue Cross & Blue Shield of MS WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !!
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006
One of our internal resources reviewed the topic and here is the workaround provided:
-SET &ECHO=ALL;
-SET &LOOP= 'GUS';
-*USE A DIFFERENT NAME FOR &LOOP IN EACH STEP AS A WORKAROUND
-SET &NX=3;
-SET &N=1;
-REPEAT &LOOP WHILE &N LE 3;
-TYPE ABC
-SET &N = &N+1;
-&LOOP
-*NOTE &LOOP1
-SET &LOOP1= 'ANSEL';
-SET &N=1;
-REPEAT &LOOP1 WHILE &N LE 3;
-TYPE XYZ
-SET &N = &N+1;
-&LOOP1
This is an issue to be fixed. To request a fix from programming, you will need to contact Information Builders' Customer Support Services and open a new case. You may either call at 1-800-736-6130, or access online InfoResponse.
Hope this helps.
Cheers,
Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
Posts: 1948 | Location: New York | Registered: November 16, 2004
My question is, can i use the above code inside a “DEFINE” to create dynamic columns in the report. Please let me know... I too get the same error message while using the above code inside "Define".... (DUPLICATE DASH REPEAT LABEL).
Anthony : When you -SET a variable, it will be a Dialog-Manager variable and not a field within the file you are using in the DEFINE statement.
Using your initial concept, I have tried to build an example for you using the CAR file. Hope this helps -
<CODE> -SET &QT = '''' ; DEFINE FILE CAR FLD0/A3 WITH COUNTRY = '111'; -REPEAT LBL99 FOR &I FROM 1 TO 3 ; -SET &FLDX = 'FLD' | '&I.EVAL' | '/A4 WITH MODEL = ' | &QT | 'VALX' | &QT | ';' ; &FLDX.EVAL -LBL99 END TABLE FILE CAR PRINT MODEL SEATS FLD0 -REPEAT LBL99X FOR &I FROM 1 TO 3 ; -SET &FLDY = 'FLD' | '&I.EVAL' ; &FLDY.EVAL -LBL99X WHERE COUNTRY EQ 'ITALY' END -EXIT </CODE>
Sandeep Mamidenna
------------------------------------------------------------------------------------------------- Blue Cross & Blue Shield of MS WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !!
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006