[SOLVED] Simple Question: Variable Comparison Problem
Hello, everyone! First let me first point out that I am VERY new to WebFOCUS development, so please bear with me...
Anyway, I'm having a simple variable comparison problem. Basically what I'm trying to do is check and see if a variable is 'N', and if it is I want to skip over a section. This is what I have:
Sadly, ( EXPECT_TAX_CLASS EQ N ) always evaluates to false, even if it displays on the repport as N.
Can anyone please point out the problem?This message has been edited. Last edited by: Fran Fitzpatrick,
version 7.6.10 on windows all available formats
September 20, 2010, 12:00 PM
Francis Mariani
In Dialogue Manager, variables are coded with '&'. Your IF statement should look like this:
-IF &EXPECT_TAX_CLASS EQ 'N' GOTO NOTRACEID;
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
September 20, 2010, 12:05 PM
Fran Fitzpatrick
Perhaps it is not a "variable" then? The values was pulled from a database and stored as such:
------- TABLE FILE ECP001H01 PRINT EXPECT_TAX_CLASS/A1 ..... other stuff ..... 'ECP001H01.SEG01.EXPECT_TAX_CLASS' ..... other stuff .....
Does that help? As I said, it prints as either Y or N on the report and in the database it is only Y or N: " Expect Tax Class: < EXPECT_TAX_CLASS"
version 7.6.10 on windows all available formats
September 20, 2010, 01:18 PM
Tom Flynn
Fran,
If this is in a HEADING, put a DEFINE above the TABLE request and remove the Dialogue Manager code:
DEFINE FILE ECP001H01
XHD1/A20 = IF EXPECT_TAX_CLASS EQ 'Y' THEN '<+0>' || Trace ID: ' | TRACE_ID ELSE ' ';
END
HEADING or SUBHEAD
"Expect Tax Class: <EXPECT_TAX_CLASS"
" "
"<XHD1"
" "
If it is in a SUBHEAD, you could do the above or:
ON SORTNAME SUBHEAD
"Expect Tax Class: <EXPECT_TAX_CLASS"
" "
"<+0>Trace ID: <TRACE_ID"
" "
WHEN EXPECT_TAX_CLASS EQ 'Y'
ON SORTNAME SUBHEAD
"Expect Tax Class: <EXPECT_TAX_CLASS"
" "
" "
WHEN EXPECT_TAX_CLASS NE 'Y'
I don't know why you would need a spot marker <+0> ?
EDIT: Take the space out between the < and the column name, i.e.,
<EXPECT_TAX_CLASS - this way < EXPECT_TAX_CLASS - not this way
IF you did that so it would show on the Forum, wrap your code within the RED code tags(top right on the toolbar) or click the Options link on the left and check Disable HTML...
Welcome to the Forum...
hthThis message has been edited. Last edited by: Tom Flynn,
First of all, your answer was absolutely perfect! The printing out of the EXPECT_TAX_CLASS was only there for debug purposes, and yes, there was only a space there so I could get it to show up on the forums (thanks for the code tags tip).
Please note: the spot marker is there because I'm leveraging the other code around it. My next task is to make the 'Trace ID:' text bold, which I figure the <+0> is some way of identifying that text. Right now I am looking into where they make the other (very similar) fields bold, and it looks like they are doing:
We don't have your data, nor, access to it. Also, we don't know your environment/data warehouse, etc. So, we ask that people with problems/learning use the source database's from the IBI application folder, IBISAMP. You are only displaying partial code which is impossible to "guess" what you need help in.
To access those data sources, at the top of the fex, do this:
? PATH -EXIT
This will list all the application folders. If IBISAMP is there, it is part of your application path; if not, it will be when you do this:
APP PREPENDPATH IBISAMP -RUN ? PATH -EXIT
Now, IBISAMP will be the first folder in the path. So with that, here is an example that "may" help you:
APP APPENDPATH IBISAMP
-RUN
DEFINE FILE EMPDATA
DUMMY/A1 = ' ';
COMPANY/A20 = 'ACME Company';
END
TABLE FILE EMPDATA
PRINT
TITLE AS ''
SALARY AS ''
HIREDATE/YYMD AS ''
DUMMY AS ''
DUMMY AS ''
BY DIV AS ''
BY DEPT AS ''
BY LASTNAME AS ''
HEADING
"This is Line 1 Centered"
"This is Line 2 Left-Justifed"
"This is Line 3 Right-Justified"
ON DIV SUBHEAD
"______________________________________________________________________________________________________________"
"<COMPANY Last <+0> Job <+0> <+0> Hire"
" Division <+0> Department <+0> Name <+0> Title <+0> Salary <+0> Date"
"______________________________________________________________________________________________________________"
ON TABLE SET PAGE-NUM OFF
ON TABLE SET LINES 9998
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
GRID=OFF,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
BOTTOMGAP=0.011333,
TOPGAP=0.011333,
$
TYPE=HEADING,
STYLE=BOLD,
HEADALIGN=BODY,
JUSTIFY=CENTER,
$
TYPE=HEADING,
LINE=1,
JUSTIFY=CENTER,
COLOR=ORANGE,
COLSPAN=6,
$
TYPE=HEADING,
LINE=2,
JUSTIFY=LEFT,
COLSPAN=6,
$
TYPE=HEADING,
LINE=3,
JUSTIFY=RIGHT,
COLOR=BROWN,
COLSPAN=6,
$
TYPE=SUBHEAD,
HEADALIGN=BODY,
JUSTIFY=CENTER,
$
TYPE=SUBHEAD,
LINE=2,
ITEM=1,
COLOR=RGB(255 51 153),
COLSPAN=2,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=2,
ITEM=2,
COLOR=RED,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=2,
ITEM=3,
COLOR=PURPLE,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=2,
ITEM=5,
COLOR=RGB(0 255 102),
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=3,
ITEM=1,
COLOR=NAVY BLUE,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=3,
ITEM=2,
COLOR=GREEN,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=3,
ITEM=3,
COLOR=RED,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=3,
ITEM=4,
COLOR=PURPLE,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=3,
ITEM=5,
COLOR=RGB(0 0 255),
JUSTIFY=CENTER,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=3,
ITEM=6,
COLOR=RGB(0 255 102),
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=1,
COLSPAN=8,
JUSTIFY=LEFT,
STYLE=BOLD,
$
TYPE=SUBHEAD,
LINE=4,
COLSPAN=8,
JUSTIFY=LEFT,
STYLE=BOLD,
$
END
-EXIT
Thanks, Tom! Your suggestions have helped so much. I basically took your information and leveraged it against the existing information there to make it work.