Focal Point
[SOLVED] specified label not found

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1641064403

October 28, 2008, 11:04 PM
awk7
[SOLVED] specified label not found
if you have a label like IBTRAD

ex.
if &LINES EQ 0 THEN GOTO IBTRAD


-IBTRAD

Question: should the last statement before the label -IBTRAD be an END or EXIT only?

My issue is trying to create a SQLSCRIPT that uses UNION when multiple items are selected

ex.
if &IBR = 'Y' then ' ' else goto IBTRAD; (when executed it gives the FOC305 error)
-IBDIR
select....
from...
where...

if &IBT = 'Y' then ' ' else goto IBTRANS;
-IBTRAD
union
select ....
from ...
where ...

This message has been edited. Last edited by: Kerry,
October 29, 2008, 01:44 AM
Michael
quote:
if &IBT = 'Y' then ' ' else goto IBTRANS;


I think the if statements need to be replaced by something like this:
-if &IBR EQ 'Y' then ' ' else goto IBTRAD;
-if &IBT EQ 'Y' then ' ' else goto IBTRANS;
October 29, 2008, 03:43 AM
Tony A
Why not just have -
-IF &IBR NE 'Y' THEN IBTRAD;
-IF &IBT NE 'Y' THEN IBTRANS;

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
October 29, 2008, 08:39 AM
awk7
the issue is not the goto...it is the LABEL NOT BEING FOUND... the &ibd, &ibtd, &ibtr and &ibr can be set to 'Y' when selected in a drop down
namely IBDIR (if selected, set &ibd to 'Y')
IBTRAD ( " &ibtd " )
IBTRANS ( " &ibtr " )
IBRESS ( " &ibr " )

if &ibd = 'Y' then ' ' else goto IBTRAD
-IBDIR
select....

-IBTRAD
if &ibtd = 'Y' then ' ' else goto IBTRANS
union
select ....

-IBTRANS
IF &ibtr = 'Y' then ' ' else goto IBRESS
union
select ...

-IBRESS
if &ibr = 'Y' then ' ' else goto NOMORE
union
select ...
-NOMORE
(script is not exactly correct, just pointing
the idea of using union in the select)

The goal is to create a single script (using UNION) to extract all selected type of records (IBTRAD, IBDIR...etc). Any other approach that
you can suggest?
October 29, 2008, 08:53 AM
PBrightwell
Have you tried what Tony suggested? Be sure you have the semicolon at the end. Also be sure it begins in position 1, no indentation. And in answer to your other question:

Question: should the last statement before the label -IBTRAD be an END or EXIT only?

Do you want the code following -IBTRAD to be executed? If not, then you want an -EXIT or a -GOTO before it, an END will not stop the execution.

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


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
October 29, 2008, 09:10 AM
GinnyJakes
And, as Michael said above, the dash in front of the IF. That should be -IF.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 29, 2008, 09:27 AM
jgelona
-IF &IBD NE 'Y' THEN IBTRAD;
-IBDIR
select....

-IBTRAD
-IF &IBTD NE 'Y' THEN GOTO IBTRANS;
union
select ....

-IBTRANS
-IF &IBTR NE 'Y' THEN GOTO IBREST;
union 
select ...

-IBREST
-IF &IBR NE 'Y' THEN GOTO NOMORE;
union
select ...
-NOMORE
END
-RUN



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
October 29, 2008, 04:52 PM
Waz
As many have said..

Here is the syntax of the -IF command

-IF expression [THEN] GOTO label1[;] [ELSE GOTO label2[;]] [ELSE IF...[;]] 


The command -IF must end with a semicolon ( ; ) to signal that all logic has been specified. Continuation lines must begin with a hyphen (-) and lines must break between words.

This was taken directly from the documentation.

Awk7, from the way this was coded, I do beleive that you don't have a good understanding of the {Web}FOCUS language, I think it would be a good idea for you to get training or at lease have a good look at the manuals.

A link to search documentation is at the top of the page.


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!