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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you have any questions or need access: Contact myibi@ibi.com


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Equality condition failure issue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Equality condition failure issue
 Login/Join
 
Gold member
posted
Hi,
This is my code.
-IF &Tme_Prd_Is EQ 'Later than this Date' THEN TP_DP2;
-TP_DP2
-SET &Tme_Prd_Op = '>' ;
-TYPE ++++++++++++++inside Later than this date++++++++++
-GOTO SNGL_OPT ;

-IF &Tme_Prd_Is EQ 'Before this Date' THEN BEF_DAT;
-BEF_DAT
-SET &Tme_Prd_Op = '<' ;
-GOTO SNGL_OPT ;

-IF &Tme_Prd_Is EQ 'On this Date' OR &Tme_Prd_Is EQ 'Last Business Day' THEN LAS_BUS;
-LAS_BUS
-SET &Tme_Prd_Op = '=' ;
-GOTO SNGL_OPT ;
-SNGL_OPT
"Time Period &Tme_Prd_Op &Tme_Prd_From_Date"
-GOTO TMEPRD_FLT ;
-IF &Tme_Prd_Is EQ 'Specific Quarter' OR &Tme_Prd_Is EQ 'Specific Month' OR &Tme_Prd_Is EQ 'Last Quarter' OR &Tme_Prd_Is EQ 'Last Month' OR &Tme_Prd_Is EQ 'Year to Date' OR &Tme_Prd_Is EQ 'Quarter to Date' OR &Tme_Prd_Is EQ 'Month to Date' THEN OPT_RAN;
-OPT_RAN
"Time Period From &Tme_Prd_From_Date To &Tme_Prd_To_Date"
-GOTO TMEPRD_FLT ;
-IF &Tme_Prd_Is EQ 'Date Range' THEN DAT_RAN ;
-DAT_RAN
"Time Period between &Tme_Prd_From_Date and &Tme_Prd_To_Date"
-GOTO TMEPRD_FLT ;
-TMEPRD_FLT


Let the value of &Tme_Prd_Is be 'Before this Date'

Whenever this value is checked,the first condition is always satisfied.That is wrong.
Can anyone tell me what is the cause for this wrong behavior and suggest me a solution?

Thanks,
Suji.

Webfocus 7.1
Oracle Database.
Windows and Unix platform.


WebFOCUS 7.7.02(Production)
WebFOCUS 7.7.02(Test region)
Oracle backend (10g)and Windows Frontend.
HTML,PDF,EXL2K,FLEX,AHTML
 
Posts: 68 | Registered: June 07, 2007Report This Post
Guru
posted Hide Post
Haven't tested it, but like this:

-IF &Tme_Prd_Is EQ 'Later than this Date' THEN GOTO :TP_DP2 ELSE IF &Tme_Prd_Is EQ 'Before this Date' THEN GOTO :BEF_DAT ELSE IF &Tme_Prd_Is EQ 'On this Date' OR &Tme_Prd_Is EQ 'Last Business Day' THEN GOTO :LAS_BUS;

-:TP_DP2
-SET &Tme_Prd_Op = '>' ;
-TYPE ++++++++++++++inside Later than this date++++++++++
-GOTO :SNGL_OPT ;

-:BEF_DAT
-SET &Tme_Prd_Op = '<' ;
-GOTO :SNGL_OPT ;

-:LAS_BUS
-SET &Tme_Prd_Op = '=' ;
-GOTO :SNGL_OPT ;
-:SNGL_OPT


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 456 | Location: Europe | Registered: February 05, 2007Report This Post
Virtuoso
posted Hide Post
Suji,

You are having problems with your syntax:
For example:
-IF &Tme_Prd_Is EQ 'Later than this Date' THEN TP_DP2;

This should be:
-IF &Tme_Prd_Is EQ 'Later than this Date' THEN GOTO TP_DP2 ELSE GOTO XTP_DP2;


Put XTP_DP2 after the -GOTO SNGL_OPT
Do not put a semi-colon after an unconditional GOTO. WebFocus will ignore this until someone tightens the code...

What I said applies to all your -IF statements.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
This is the culprit in my code.
-SET &Tme_Prd_Op = '<';

Can anyone suggest me how should I display 'Less than(<)' in the report?

Thanks,
Suji.


WebFOCUS 7.7.02(Production)
WebFOCUS 7.7.02(Test region)
Oracle backend (10g)and Windows Frontend.
HTML,PDF,EXL2K,FLEX,AHTML
 
Posts: 68 | Registered: June 07, 2007Report This Post
Virtuoso
posted Hide Post
Suji,
Where do you want to dislpay '<'?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Danny,
I want to display '<' in the report heading.
I used '&|lt;' in my code.It is working fine now.

Thanks ,
Suji.


WebFOCUS 7.7.02(Production)
WebFOCUS 7.7.02(Test region)
Oracle backend (10g)and Windows Frontend.
HTML,PDF,EXL2K,FLEX,AHTML
 
Posts: 68 | Registered: June 07, 2007Report This Post
Virtuoso
posted Hide Post
Suji,
That will work fine in HTML. However if your output is in a different format (pdf, excel), you won't get your '<'.
You can DEFINE a field, say LTN/A1='<'; and in your heading place <LTN . In this way FOCUS won't recognize the '<' as a spot marker.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
I'm guessing that there is nothing keeping it from processing the TP_DP2 code; it's the next instruction. Try a couple more GOTOs to have that block skipped unless the condition is satisfied. Like:

-IF &Tme_Prd_Is EQ 'Later than this Date' THEN TP_DP2;

-GOTO SKIPDP2

-TP_DP2
-SET &Tme_Prd_Op = '>' ;
-TYPE ++++++++++++++inside Later than this date++++++++++
-GOTO SNGL_OPT ;

-SKIPDP2

-IF &Tme_Prd_Is EQ 'Before this Date' THEN BEF_DAT;

-GOTO SKIPBEF

-BEF_DAT
-SET &Tme_Prd_Op = '<' ;
-GOTO SNGL_OPT ;

-SKIPBEF


etc.......


WebFOCUS 7.6
Windows; z/OS; PDS and USS
Output: PDF, HTML, Excel, plus others, depends on the request.
 
Posts: 1 | Registered: November 13, 2007Report This Post
Virtuoso
posted Hide Post
Answer has already been posted by Danny, Frans, RM. For clarification, the thing to understand it that DM is not using case logic - the code under -TP_DP2 is not a "block" or "case". WF simply follows the code line-by-line. So following your logic the first IF is false so it won't THEN. However, since there is no ELSE or alternative path, it moves to the next line and performs what was intended for the THEN anyway. You need an ELSE to skip over that piece or provide an alternative branch.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report 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     Equality condition failure issue

Copyright © 1996-2020 Information Builders