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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] GOTO Not Functioning Properly

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] GOTO Not Functioning Properly
 Login/Join
 
Silver Member
posted
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;
END

This message has been edited. Last edited by: RMM,


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Virtuoso
posted Hide Post
quote:
- IF TEMPONE.TEMPONE.TIMESTAMP NE TEMPONE.TEMPONE.CURRENTDAY THEN GOTO STARTONE;

Semicolon after STARTONE shouldn't be there. Have your ELSE on the same line and you'll see your error.

And you need another GOTO before STOPPROCESS to bypass this step if it's the goal otherwise all code will be processed.
- IF TEMPONE.TEMPONE.TIMESTAMP NE TEMPONE.TEMPONE.CURRENTDAY THEN GOTO STARTONE ELSE GOTO STOPPROCESS;

-STARTONE

TABLE FILE TEMPONE
PRINT
	TIMESTAMP
END

-GOTO XEXIT;

-STOPPROCESS

TABLE FILE TEMPONE
PRINT
	TIMESTAMP
WHERE TIMESTAMP EQ 1;
END

-XEXIT


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
RMM,

This looks like you may need some education.

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.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Waz,

DO you offer any free training education?

Francis,

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Virtuoso
posted Hide Post
quote:
09/07/2016 10:26:55 (FOC370) THE FIELDNAME USED IN JOIN CANNOT BE FOUND IN THE FILE: TEMPONE.TEMPONE.LLBCMPN


Your first error is above one.
The file TEMPONE cannot be read if it doesn't exist due to above error.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Free Training




Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
LOL. Using "Help" contents isn't much in dignified training.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Expert
posted Hide Post
But there certainly is a lot of scintillating reading.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
RMM,

You your error indicates that there is a JOIN in place, but your code does not show it.

Can you post the code.

My guess is that the JOIN issue is stopping the hold file from being created that is causing the -READFILE to failing.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Waz,

Here is the code...

-DEFAULTH &TIMESTAMPS = '';
-DEFAULTH &CURRENTDAY = '';

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.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Silver Member
posted Hide Post
Lol! Nice!
quote:
Originally posted by Francis Mariani:
But there certainly is a lot of scintillating reading.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Virtuoso
posted Hide Post
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:
-READFILE TEMPONE
-RUN

-TYPE TIMESTAMPS= &TIMESTAMPS, CURRENTDAY= &CURRENTDAY
-EXIT


3- Then if everything goes right, remove the previous -EXIT to process you whole code


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Silver Member
posted Hide Post
Thanks, Martin.

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...

-DEFAULTH &TIMESTAMPS = '';
-DEFAULTH &CURRENTDAY = '';

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

-READFILE XXXHANSOLO
-RUN

-TYPE TIMESTAMPS= &TIMESTAMPS, CURRENTDAY= &CURRENTDAY

-IF &TIMESTAMPS EQ &CURRENTDAY THEN GOTO STARTONE ELSE GOTO STOPPROCESS;

-STARTONE

TABLE FILE XXXHANSOLO
BY
TIMESTAMPS
END

-STOPPROCESS

TABLE FILE XXXHANSOLO
BY
TIMESTAMPS
WHERE TIMESTAMPS EQ 1;
END


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Expert
posted Hide Post
See if this helps...
Also notice the additional code, Bolded

-IF '&TIMESTAMPS.EVAL' EQ '&CURRENTDAY.EVAL' GOTO STARTONE ELSE GOTO STOPPROCESS;

-STARTONE
TABLE FILE XXXHANSOLO
BY
TIMESTAMPS
END
-RUN
-GOTO EOJ

-STOPPROCESS
TABLE FILE XXXHANSOLO
BY
TIMESTAMPS
WHERE TIMESTAMPS EQ 1;
END
-RUN
-EOJ


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Thanks. Unfortunately, that didn't work as well.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Virtuoso
posted Hide Post
quote:
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, 2005Report This Post
Silver Member
posted Hide Post
I changed the condition &RECORDS EQ 1 to &RECORDS GE 1 and this fixed it. Thanks you all who helped.


WebFOCUS 8
Windows, All Outputs
 
Posts: 47 | Registered: February 02, 2016Report This Post
Expert
posted Hide Post
Hi RMM,

Can you update the title of this thread (Edit your first post) and add [SOLVED] or [CLOSED].


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] GOTO Not Functioning Properly

Copyright © 1996-2020 Information Builders