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, for &VARIABLE12 even if the value is other than 'A' on &OP_DSP its always giving 'AUSTRALIA QLY'.not going to other GOTO, why? can any one help me out.
here in my code: -IF &VARIABLE12 EQ 'A' THEN GOTO DSP_A; -IF &VARIABLE12 EQ 'B' THEN GOTO DSP_B; -IF &VARIABLE12 EQ 'C' THEN GOTO DSP_C; -IF &VARIABLE12 EQ 'D' THEN GOTO DSP_D; -TYPE VARIABLE12 &VARIABLE12
I think you might need to add an ELSE for the values other than A,B,C,D. What's happening here is that if the values are not A,B,C or D; the code lets you to the next statement where value "AUSTRALIA QLY' is set.
After all the IFs, try this: -IF &VARIABLE12 EQ 'D' THEN GOTO DSP_D ELSE GOTO LBL_END
or you can put any other logic(setting any default value) in the ELSE, as per your requirements.
I NEVER use a -IF that does not have some sort of ELSE. That assures that EVERY possible value is accounted for and handled in some way.
To accomplish your -SETs, Jack's got the best way using a DECODE. To accomplish you branching for some other purpose, try:
-IF &VARIABLE12 EQ 'A' THEN GOTO DSP_A ELSE
- IF &VARIABLE12 EQ 'B' THEN GOTO DSP_B ELSE
- IF &VARIABLE12 EQ 'C' THEN GOTO DSP_C ELSE
- IF &VARIABLE12 EQ 'D' THEN GOTO DSP_D ELSE
- GOTO LBL_END;
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Hi all, I think you should not write -GOTO LBL_END; but -GOTO LBL_END No ';' in a -GOTO Statement But, as so many, since -IF statement requires a ';', you come to think that -GOTO is on the same logic That's why Old Focusians always let a space before ';' -GOTO LBL_END ; is not the best way to write, but it works. It doesn't search for a Label -LBL_END; but for the Proper Label -LBL_END
Same Remark with -SET : ';' compulsory and -DEFAULT(s): No ';' but ',' allows different variables to be Defaulted on a single line Cordially and Focusely PS : This Rule is so old, that, perhaps, it's not longer true. NotWithstanding, untill I die, I'll never write -GOTO WAY_OUT; ( As I'll never begin a Focus Statement in Position 1, which I let to the '-' of DM => So I see, at first sight if I'm playing with Focus or with DM... Which is rather important to know. And which DS hides ... But, Do I like DS ? Anyway DS doesn't care much about my loving or not ...)
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO
If you are displaying the value in your -TYPE statement then you haven't matched any of the conditions or your GOTO would have bypassed it. Have you followed j.gross's advice and checked the length? Also it is case sensitive, is your value 'A' or 'a'?
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
Keep on writing. I enjoy your posts though I don't always understand them.
At any rate, your GOTO comments are correct. However, in Darin's example his -GOTO is part of the ELSE in an IF statement and as such should be followed by the semicolon.
Misunderstood, once more ... Should I love that ? I was not refering to Darin's example, but to the first message by rp. That's typical of my (too often) being misunderstood. I should have specified that. But an old Fool / Focusian (*) like me just cannot not know, inside his guts, the difference between -IF and -GOTO syntax Anyway, thanks for the kindness of the message Cordially and Focusely (*) As you prefer. Not mutually exclusive.
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO
-IF 'MAP' EQ 'MAP' THEN GOTO MAP
- ELSE IF 'MAP' EQ 'DETAIL' THEN GOTO DETAIL
- ELSE GOTO PERIOD;
0 ERROR AT OR NEAR LINE 76 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC305) SPECIFIED LABEL NOT FOUND: PERIOD
I thought this might be spelling error, so I tried the GUI DM to pick up the label; it might be the semi-colon played the trick on me, tried switch the conditions around and still didn't work.
I tried the simple goto and it recognize the label and gave me the report I wanted. So it got to be something wrong with my if-else structure. Please help.
-GOTO PERIOD <== this one works
-IF '&LEVEL' EQ 'MAP' THEN GOTO MAP
- ELSE IF '&LEVEL' EQ 'DETAIL' THEN GOTO DETAIL
- ELSE GOTO PERIOD; <== this one doesn't work
-IF '&FDIV' NE 'ALL' THEN GOTO PERIOD <== this one doesn't work
- ELSE GOTO &LEVEL;
Thanks,
Hua
Developer Studio 7.6.11 AS400 - V5R4 HTML,PDF,XLS
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008
Hua, take the quotes off the amper variable. This works:
-IF &LEVEL EQ 'MAP' THEN GOTO MAP
- ELSE IF &LEVEL EQ 'DETAIL' THEN GOTO DETAIL
- ELSE GOTO PERIOD;
-MAP
-TYPE IN MAP
-EXIT
-DETAIL
-TYPE IN DETAIL
-EXIT
-PERIOD
-TYPE IN PERIOD
-EXIT