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     Duplicate Dash Labels

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Duplicate Dash Labels
 Login/Join
 
<priya>
posted
Hi All,

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.

Please help me in solving this problem.

Thanx in advance!!!
 
Report This Post
Virtuoso
posted Hide Post
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, 2006Report This Post
Expert
posted Hide Post
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, 2004Report This Post
Expert
posted Hide Post
Hi priya,

Has this issue been resolved?

Please try this: add a unique counter to &LOOP.
Something like this:

-SET &CNT=0;
-NEXTLOOP
-SET &CNT=&CNT+1;
-RUN
-SET &LOOP = 'LOOP'| &CNT.EVAL;
-SET &N=1;
-TYPE &LOOP  
-IF &CNT GE 5 GOTO  DONE;
-GOTO NEXTLOOP
-DONE 


THIS IS THE OUTPUT:
LOOP1
LOOP2
LOOP3
LOOP4
LOOP5

Hope this helps. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Virtuoso
posted Hide Post
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, 2003Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by kerry:
Hi priya,

Has this issue been resolved?

Please try this: add a unique counter to &LOOP.
Something like this:

-SET &CNT=0;
-NEXTLOOP
-SET &CNT=&CNT+1;
-RUN
-SET &LOOP = 'LOOP'| &CNT.EVAL;
-SET &N=1;
-TYPE &LOOP  
-IF &CNT GE 5 GOTO  DONE;
-GOTO NEXTLOOP
-DONE 


THIS IS THE OUTPUT:
LOOP1
LOOP2
LOOP3
LOOP4
LOOP5

Hope this helps. Smiler

Cheers,

Kerry


Kerry

I'm not sure this is the issue, the LOOP&CNT here is meant to be a new label and that will not work.




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, 2006Report This Post
<priya>
posted
Hi,

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.
 
Report This Post
Virtuoso
posted Hide Post
Priya

you should not make use of this goto functionality.

take a look here loop discussion
this is more or less your issue
good luck




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, 2006Report This Post
Platinum Member
posted Hide Post
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 !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Hi priya,

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. Big Grin

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
<Antony Gubert>
posted
Hi,

The following method won't raise an error....


-SET &SUB = 0 ;
-*
-REPEAT READRECC &NBR_RECS TIMES
-READ REPSAVE &R_SALES.D33.15
-SET &SALES&SUB = '&R_SALES.EVAL';
-SET &SUB = &SUB + 1;
-READRECC
-*


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).


Thanks

Antony
 
Report This Post
Platinum Member
posted Hide Post
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 !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report 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     Duplicate Dash Labels

Copyright © 1996-2020 Information Builders