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.
Below is my code that I am having an issue with. Currently... CURRENTDAY = 20160906, TIMESTAMP = 20160906
It works, but backwards. The 2 dates match so it should GOTO STOPPROCESS and end up with no rows, but instead it goes to STARTONE and provides the TIMESTAMP date. WHat am I doing wrong here? If the dates match it should error out. If they don't match, TIMESTAMP should be provided.
DEFINE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG CURRENTDAY/YYMD = &YYMD; END
TABLE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG BY CURRENTDAY BY TOTAL LOWEST COMPUTE TIMESTAMP/YYMD = HDATE(LOAD_TIMESTAMP, 'YYMD'); ON TABLE HOLD AS TEMPONE END
- IF TEMPONE.TEMPONE.TIMESTAMP NE TEMPONE.TEMPONE.CURRENTDAY THEN GOTO STARTONE; - ELSE GOTO STOPPROCESS;
-STARTONE
TABLE FILE TEMPONE PRINT TIMESTAMP END
-STOPPROCESS
TABLE FILE TEMPONE PRINT TIMESTAMP WHERE TIMESTAMP EQ 1; ENDThis message has been edited. Last edited by: RMM,
In Dialogue Manager (scripting language), you cannot reference columns in a table (reporting language).
I don't think this is correct syntax:
BY TOTAL LOWEST COMPUTE TIMESTAMP/YYMD = HDATE(LOAD_TIMESTAMP, 'YYMD');
You need to -READFILE (or -READ) to put data into Dialogue Manager variables to make the GOTO work. Something like this:
DEFINE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG
CURRENTDAY/YYMD = &YYMD;
END
TABLE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG
PRINT
COMPUTE TIMESTAMP/YYMD = HDATE(LOAD_TIMESTAMP, 'YYMD');
BY CURRENTDAY
BY TOTAL LOWEST 1 TIMESTAMP
ON TABLE HOLD AS TEMPONE
END
-RUN
-READFILE TEMPONE
-IF &TIMESTAMP NE &CURRENTDAY THEN GOTO STARTONE ELSE GOTO STOPPROCESS;
-STARTONE
TABLE FILE TEMPONE
PRINT
TIMESTAMP
END
-RUN
-GOTO FOCENDREP
-STOPPROCESS
TABLE FILE TEMPONE
PRINT
TIMESTAMP
WHERE TIMESTAMP EQ 1;
END
-RUN
-FOCENDREP
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
To extend on what Francis saysm Dialog Manager (lines starting with a dash "-") are a preprocessing script. It runs before the FOCUS code (TABLE FILE etc, not Dialog Manager), and can be used to control program flow, and the FOCUS code its self.
Everything seems to work until the -READFILE part. Below is the error I receive. checkprocessed is the name of the script we have been working on. THe first hold works, but the issue arises after that.
09/07/2016 10:26:55 (ICM18015) DEP_3: procedure checkprocessed started. 09/07/2016 10:26:55 0 NUMBER OF RECORDS IN TABLE= 16 LINES= 16 09/07/2016 10:26:55 09/07/2016 10:26:55 (FOC370) THE FIELDNAME USED IN JOIN CANNOT BE FOUND IN THE FILE: TEMPONE.TEMPONE.LLBCMPN 09/07/2016 10:26:55 0 ERROR AT OR NEAR LINE 16 IN PROCEDURE homeapps/modzelewski/checkprocessed 09/07/2016 10:26:55 (FOC2907) ERROR WITH DIALOGUE MANAGER COMMAND: -READFILE TEMPONE
DEFINE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG CURRENTDAY/YYMD = &YYMD; END
TABLE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG PRINT COMPUTE TIMESTAMPS/YYMD = HDATE(LOAD_TIMESTAMP, 'YYMD'); BY CURRENTDAY ON TABLE HOLD AS TEMPONE END -RUN
-READFILE TEMPONE
-IF &TIMESTAMPS NE &CURRENTDAY THEN GOTO STARTONE ELSE GOTO STOPPROCESS;
-STARTONE
TABLE FILE TEMPONE BY TIMESTAMPS END
-STOPPROCESS
TABLE FILE TEMPONE BY TIMESTAMPS WHERE TIMESTAMPS EQ 1; END
There is no JOIN, in which why I am stumped on this one.
I know that I am not that knowledgeable in my WebFocus, but I am trying in light of not much reading material out there compared to other languages and the fact my boss won't send me to any classes when I have asked. I feel like I am doing everything tied with one arm behind my back.
Try the following: 1- Process your code and add -EXIT right after
TABLE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG
PRINT COMPUTE TIMESTAMPS/YYMD = HDATE(LOAD_TIMESTAMP, 'YYMD');
BY CURRENTDAY
ON TABLE HOLD AS TEMPONE
END
-RUN
-EXIT
You will then confirm that your HOLD file generation works.
2- Remove previous -EXIT, add a -RUN after the READFILE and print variable's value:
It turned out that the issue was with the TEMPONE name being used. I changed it and now run into a different issue. Issue stated below...
09/08/2016 10:48:03 (ICM18122) Request - homeapps/RMM/pf_testdayend submitted. 09/08/2016 10:48:03 (ICM18015) DEP_0: procedure checkdayend started. 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 09/08/2016 10:48:03 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 09/08/2016 10:48:03 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 09/08/2016 10:48:03 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0 09/08/2016 10:48:03 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 09/08/2016 10:48:03 09/08/2016 10:48:03 0 HOLDING HTML FILE ON PC DISK ... 09/08/2016 10:48:03 09/08/2016 10:48:03 09/08/2016 10:48:03 (ICM18039) DEP_0 checkdayend Return Code = 0
09/08/2016 10:48:03 (ICM18015) DEP_3: procedure checkprocessed started. 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 323 LINES= 323 09/08/2016 10:48:03 09/08/2016 10:48:03 TIMESTAMPS= 20160908, CURRENTDAY= 20160908 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 322 LINES= 1 09/08/2016 10:48:03 09/08/2016 10:48:03 html 09/08/2016 10:48:03 head 09/08/2016 10:48:03 meta name="HandheldFriendly" content="True" 09/08/2016 10:48:03 meta name="PalmComputingPlatform" content="True" 09/08/2016 10:48:03 title WebFOCUS Report /title 09/08/2016 10:48:03 /head 09/08/2016 10:48:03 body 09/08/2016 10:48:03 table border cellpadding=1 09/08/2016 10:48:03 tr 09/08/2016 10:48:03 td 09/08/2016 10:48:03 table cellpadding=0 width="100%" tr 09/08/2016 10:48:03 td 09/08/2016 10:48:03 PAGE 1 /td /tr /table /td 09/08/2016 10:48:03 /tr 09/08/2016 10:48:03 tr 09/08/2016 10:48:03 td valign=BOTTOM 09/08/2016 10:48:03 TIMESTAMPS /td 09/08/2016 10:48:03 /tr 09/08/2016 10:48:03 tr 09/08/2016 10:48:03 td 09/08/2016 10:48:03 2016/09/08 /td 09/08/2016 10:48:03 /tr 09/08/2016 10:48:03 /table 09/08/2016 10:48:03 /body 09/08/2016 10:48:03 /html 09/08/2016 10:48:03 0 HOLDING HTML FILE ON PC DISK ... 09/08/2016 10:48:03 09/08/2016 10:48:03 09/08/2016 10:48:03 (ICM18039) DEP_3 checkprocessed Return Code = 0
It states that there is a record, in which the next procedure should run, but it doesn't. I added a custom condition where &RECORDS EQ 1 as well. You can see the first proc works fine and processes over to the proc in question. Below is the code again...
DEFINE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG CURRENTDAY/YYMD = &YYMD; END
TABLE FILE FACT_SALES_REBATE_DISCOUNT_COMPANY_DAY_AGG PRINT COMPUTE TIMESTAMPS/YYMD = HDATE(LOAD_TIMESTAMP, 'YYMD'); BY CURRENTDAY ON TABLE HOLD AS XXXHANSOLO END -RUN
09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 323 LINES= 323 09/08/2016 10:48:03 09/08/2016 10:48:03 TIMESTAMPS= 20160908, CURRENTDAY= 20160908 09/08/2016 10:48:03 0 NUMBER OF RECORDS IN TABLE= 322 LINES= 1
quote:
It states that there is a record, in which {sic} the next procedure should run, but it doesn't.
RMM: What's your issue? The values matched, and control passed to -STARTONE; the TABLE request was run and produced a formatted report with one line (since the value of LOAD_TIMESTAMP, and hence TIMESTAMPS, is uniform throughout the file).
Once you produce formatted output in a ReportCaster job, the music stops -- them's the rules -- so if there is another procedure downstream in your code it cannot be reached.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005