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