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.
I need to determine a data effective date that will be displayed in my reports. The method to determine this date is as follows, first I need to run an Oracle query and based on the result (which is just a number) either run another Oracle query and display a date (today - 1 day) or display a date (today - 2 days). Does anyone have any suggestions on how to accomplish this?
Will you be running your queries against the Oracle tables using SQL passthrough, or with TABLE FILE commands? Do you need to access the data from Dialog Manager variables, or from the DEFINE FILE section?
For a start before getting more info, here is how to get date - 1 and date - 2 in from the DEFINE FILE section:
DEFINE FILE CAR TODAY/YYMD = &YYMD; DATEMINUS1/YYMD = DATEADD(TODAY, 'D', -1); DATEMINUS2/YYMD = DATEADD(TODAY, 'D', -2); END
Regards, Sean
------------------------------------------------------------------------ PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
Posts: 210 | Location: Ottawa | Registered: November 03, 2005
I'll be using SQL passthrough. In regard to your other question, I'm not sure; chances are the logic that determines the date would be in its own procedure and therefore the result would be pulled into another procedure so would a DEFINE FILE be the most efficent way?
Here is a simple sample of what I think you are trying to accomplish. How your 2 table reads fit in, I'm unclear, but this will hopefully give you the idea. Note that I haven't been able to figure out how SQL passthrough works to read data from a table, so I use the TABLE FILE method:
If the hold was in the format: ON TABLE HOLD AS HOLDFILE
then you would have to specify: -READ HOLDFILE &SEATCNT.A3
But with no hold file name specified, it defaults to HOLD.
The A3 means that the field &SEATCNT will be loaded with 3 alphanumeric characters from the hold file. You will need to adjust this to suit your particular requirements.
------------------------------------------------------------------------ PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
Posts: 210 | Location: Ottawa | Registered: November 03, 2005
Hi again, Ok, I've got it working to the point where the correct date is determined however I'm having trouble displaying that date on the report; I receive
quote:
(FOC295) A VALUE IS MISSING FOR: &EFF_DATE
. However, when I display the variable (-? &EFF_DATE) there is a value, what am I missing?
This is my code: ENGINE SQLORA SET DEFAULT_CONNECTION DBTEST SQL SQLORA PREPARE SQLOUT FOR select num from dual ; END
TABLE FILE SQLOUT PRINT NUM ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE HOLD FORMAT ALPHA ON TABLE SET HTMLCSS ON END
-RUN -READ HOLD &NUM1.D20.2 -IF &NUM1 NE 2 THEN :NoRefresh;
ENGINE SQLORA SET DEFAULT_CONNECTION DBTEST SQL SQLORA PREPARE SQLOUT FOR select num from dual ; END
TABLE FILE SQLOUT PRINT NUM ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE HOLD FORMAT ALPHA ON TABLE SET HTMLCSS ON END
-SET &NUM2 = 0;
-RUN -READ HOLD &NUM2.D20.2 -SET &EFF_DATE = IF &NUM2 EQ 1 THEN &DATEMINUS1 ELSE :NoRefresh; -:NoRefresh -SET &EFF_DATE = IF &NUM1 NE 2 THEN &DATEMINUS2;
TABLE FILE CAR PRINT CAR FOOTING "&EFF_DATE " ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SET ONLINE-FMT HTML ON TABLE SET HTMLCSS ON END
-SET &EFF_DATE = IF &NUM2 EQ 1 THEN &DATEMINUS1 ELSE :NoRefresh; -:NoRefresh -SET &EFF_DATE = IF &NUM1 NE 2 THEN &DATEMINUS2;
The ELSE part of the IF statement is redundant, since you are jumping to the next line, which you will execute regardless. Perhaps you want the :NoRefresh one line further down.
But the reason for the error is likely that you are not achieving a scenario where &EFF_DATE is getting set. For example, if &NUM2 is not equal to 1 and &NUM1 is equal to 2.
So be sure to initialize &EFF_DATE, and revisit the component quoted above so that you cover off all possible scenarios. Use the -TYPE command to see what your amper variables are set to.
------------------------------------------------------------------------ PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
Posts: 210 | Location: Ottawa | Registered: November 03, 2005
Ok, I've come across my next obstacle and have yet to find a solution.
I need to store the amper variable value in a field/column to store as a hold file which will be referenced in another procedure.
Having the variable in the heading or footing does not make it available outside of the procedure. I've tried creating a virtual field via a define as well as utilizing the compute function, neither seem to work. Any suggestions are greatly appreciated!