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
Basic DM question
 Login/Join
 
<Pietro De Santis>
posted
Hi,

Here's a vry basic DM problem I can't seem to get around.

This is a simplified piece of code that fails with the following error:

(FOC295) A VALUE IS MISSING FOR: TEST3



-DEFAULT &LEVEL = 3;

-SET &MAX_LEVEL = 2;

-SET &TEST1 = 'APPLE';
-SET &TEST2 = 'ORANGE';

-SET &FRUIT = IF &LEVEL GT &MAX_LEVEL THEN '' ELSE &TEST.&LEVEL;

-TYPE &FRUIT

Don't tell me I have to use clumsy GOTO's and labels to avoid this problem.

Any ideas?

Thanks,

Pietro.

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
<Vipul>
posted
Give me a piece of advice? How do you write a moderately complex piece of focus code without GOTOs and Labels.

Vipul
 
Report This Post
<WFUser>
posted
Do you have anything against -REPEAT?

-DEFAULT &LEVEL = 3;
-SET &MAX_LEVEL = 2;

-REPEAT STARTIT &MAX_LEVEL TIMES
-DEFAULT &TEST.&LEVEL = ' '
-STARTIT

-SET &TEST1 = 'APPLE';
-SET &TEST2 = 'ORANGE';
-SET &FRUIT = IF &LEVEL GT &MAX_LEVEL THEN '' ELSE &TEST.&LEVEL;
-TYPE &FRUIT
 
Report This Post
Platinum Member
posted Hide Post
Easier. Set a default value to &TEST.&LEVEL independently of &LEVEL value.


-DEFAULT &LEVEL = 3;
-SET &MAX_LEVEL = 2;

-SET &TEST1 = 'APPLE';
-SET &TEST2 = 'ORANGE';

-DEFAULT &TEST.&LEVEL = ' ' ;

-SET &FRUIT = IF &LEVEL GT &MAX_LEVEL THEN ' ' ELSE &TEST.&LEVEL;
-TYPE Fruit - &FRUIT[/code]Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
<Pietro De Santis>
posted
Nothing against -REPEAT, in fact I love it.

Nothing against -DEFAULT either.

Just assumed DM would stop parsing the line after the first condition becoming true, silly me.
 
Report This Post
Platinum Member
posted Hide Post
Thinking a little more, why do we need -IF?


-DEFAULT &LEVEL = 2 ;
-SET &MAX_LEVEL = 2;

-SET &TEST1 = 'APPLE';
-SET &TEST2 = 'ORANGE';
-DEFAULT &TEST.&LEVEL = ' ' ;

-SET &FRUIT = &TEST.&LEVEL ;
-TYPE Fruit - &FRUIT
And finally, I think that a simple DECODE is the best solution...

-DEFAULT &LEVEL = 3 ;
-SET &FRUIT = DECODE &LEVEL (1 'APPLE' 2 'ORANGE' ELSE ' ') ;
-TYPE Fruit - &FRUIT
Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders