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     [SOLVED] Simple Question: Variable Comparison Problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Simple Question: Variable Comparison Problem
 Login/Join
 
Member
posted
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:

" Expect Tax Class: < EXPECT_TAX_CLASS"
" "
-IF ( EXPECT_TAX_CLASS EQ N ) THEN GOTO NOTRACEID;
" <+0>Trace ID: < TRACE_ID "
" "
-NOTRACEID

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
 
Posts: 18 | Registered: September 20, 2010Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
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
 
Posts: 18 | Registered: September 20, 2010Report This Post
Expert
posted Hide Post
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...

hth

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
Tom,

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:
 
TYPE=SUBHEAD,
     BY=4,
     LINE=3,
     OBJECT=TEXT,
     ITEM=2,
     JUSTIFY=LEFT,
     STYLE=BOLD,
     WIDTH=1.100,
$
 


You wouldn't have any tips for this, would you?


version 7.6.10 on windows
all available formats
 
Posts: 18 | Registered: September 20, 2010Report This Post
Expert
posted Hide Post
Hi Fran,

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



hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
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.

Thank you! :-)


version 7.6.10 on windows
all available formats
 
Posts: 18 | Registered: September 20, 2010Report 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     [SOLVED] Simple Question: Variable Comparison Problem

Copyright © 1996-2020 Information Builders