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.
Hi all, I am trying to implement a programming solution where i have to create a define field dynamically from a list of amper variables. The number of amper variable may vary and the define definition should automatically take the new added amper variable into it's definition. The structure of define field is like this.
ABC/A20=IF CODE IN (&GRP1) THEN GROUP1 ELSE IF CODE IN (&GRP2) THEN GROUP2 ELSE IF CODE IN (&GRP3) THEN GROUP3 ......... ELSE CODE;
I was trying to do this with a loop but not able to make it in single line. Can somebody please advise.
ThanksThis message has been edited. Last edited by: Kerry,
2 assumptions: 1. You have a variable, &GRP0, which contains the number of variables 2. This number is not greater than 16 (unless the number of nested IFs has increased...)
With these assumptions in mind, here is a solution:
-* File Chirag01.fex
...
ABC/A20=
-REPEAT #GRPS FOR &I FROM 1 TO &GRP0;
IF CODE IN (&GRP.&I) THEN GROUP&I ELSE
-#GRPS
CODE;
...
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
No, I don't want to make it to single line. I thought define field accept definition given in single line only. As i was getting error with my initial try with repeat loop. But Daniel solution worked for me. But unfortunately in my case the number is going to be more than 16.
One alternative is to use a loop to create a DEFINE for each group pair and check the value of the previous DEFINE before proceeding with the current one. The last DEFINE should contain the final value. I have not tested this code so it may require some tweaking - particularly the number of dots before EXISTS; some .EVALs might also be needed.
TEST0/A20 = 'XXXXXXXX';
-REPEAT ENDREPEAT1 FOR &I FROM 1 TO 100 ;
-SET &PI = &I - 1 ;
-IF &GRP.&I..EXISTS EQ 0 GOTO QUITREPEAT1 ;
TEST&I/A20 = IF TEST&PI NE 'XXXXXXXX' THEN TEST&PI ELSE IF CODE IN (&GRP.&I) THEN GROUP&I ELSE 'XXXXXXXX';
-ENDREPEAT1
-QUITREPEAT1
-*
ABC/A20 = TEST&PI ;
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007