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.
Hello. I'm trying to compute something with an SQL query, and use that value to determine what GOTO to jump to:
SQL SELECT MAX(cost) AS MAX_COST FROM ...; TABLE ON TABLE HOLD AS myReport END -RUN
TABLE FILE myReport PRINT COMPUTE myCost/I5 = MAX_COST; END ON TABLE HOLD AS myReport2 END
-IF myReport2.myCost EQ 10 THEN GOTO OUT; .... some other stuff done here ... -OUT
I know that myCost is 10 (I printed it), but I never jump to OUT. It's as if it ignores this value, or cannot reference it properly in myReport2. Any help appreciated.
1. Are you sure that the COST variable stored in SAVE is USAGE=I22 (or P22)? Check the MFD of the source table.
2. Add: -SET &MCOST='0000000000000000000000'; -* (or any string value 22 characters wide) to initialize &MCOST to the appropriate length before the -READ, instead of specifying format in the -READ
3. Add -TYPE ## &|MCOST: -TYPE ## '&MCOST' -TYPE ## *123456789.123456789.123456789. before and after the read, to verify what value &MCOST received (length, content).
4. Use EDIT() to force evaluation as an integer: -IF EDIT(&MCOST) EQ 10 ...
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
The best way for us to help you would be to post an example that we can run on our P.C's.
Here is an example of using Dialog Manager to read a value from a HOLD or SAVE file and then use the value for further processing. This example also illustrates that, in Dialog Manager, you can read a value as an alpha field, but use it in numeric calculations.
The problem you're encountering may be occuring because I22 is not a valid numeric format, there is a maximum length for Integer fields, I10, I think.
SET HOLDLIST=PRINTONLY TABLE FILE CAR PRINT RETAIL_COST/P22 WHERE RECORDLIMIT EQ 1 ON TABLE SAVE END -RUN -READ SAVE &RET_COST.A22
Pietro, your solution worked. Specifically, this line:
SET HOLDLIST=PRINTONLY
was very important. If I dont have this line, the code doesnt work (it then thinks that MYCOST field that I compute is 0 in my -IF statement, all the time).
One question that I have is: can you provide a code sample that reads from a HOLD file, not a SAVE file? I tried doing:
SET HOLDLIST=PRINTONLY TABLE FILE report1 PRINT COMPUTE MYCOST/I5 = MAX_COST; ON TABLE HOLD AS report2 END -RUN -READ report2 &MYCOST.I5
-IF &MYCOST GT 5 GOTO OVER_5;
But it complains that value for MYCOST is missing. What's the proper syntax? Thanks a lot.