Focal Point
Equality condition failure issue

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

November 14, 2007, 01:57 AM
Suji
Equality condition failure issue
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
November 14, 2007, 03:50 AM
Frans
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.
November 14, 2007, 03:50 AM
Danny-SRL
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

November 14, 2007, 06:01 AM
Suji
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
November 14, 2007, 07:34 AM
Danny-SRL
Suji,
Where do you want to dislpay '<'?


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

November 14, 2007, 07:43 AM
Suji
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
November 14, 2007, 07:51 AM
Danny-SRL
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

November 14, 2007, 08:59 AM
RM
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.
November 14, 2007, 11:10 AM
Darin Lee
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