Let's Get Social!
Focal Point    Focal Point Forums    WebFOCUS/FOCUS Forum on Focal Point     WebFosuc logic question
 Go New Search Notify Tools Reply
 WebFosuc logic question
Platinum Member
 posted February 20, 2012 02:58 PM
Hello all...I have a logic question...could someone look at this for me...thanks

-*NEW_VALUE/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '04G') AND (FEE_RETL_AM GT 0.0) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '10X') AND (FEE_RETL_AM GT 0.0) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '10Y') AND (FEE_RETL_AM GT 0.0) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '22E') AND (FEE_RETL_AM GT 0.0) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '04I') AND (FEE_RETL_AM LE .1) THEN 0 ELSE FEE_RETL_AM;

NEW_VALUE1/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '04G') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE FEE_RETL_AM;
NEW_VALUE2/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '10X') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE FEE_RETL_AM;
NEW_VALUE3/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '10Y') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE FEE_RETL_AM;
NEW_VALUE4/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '22E') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE FEE_RETL_AM;
NEW_VALUE5/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '04I') AND (FEE_RETL_AM LE .1) THEN 0 ELSE FEE_RETL_AM;

END
TABLE FILE OUTLET
PRINT
OTLT_ACCT_ID
OTLT_MRCH_NM
FEE_CRRN_IN
SORC_FEE_ID
FEE_SQNC_DSCR_TX
FEE_RETL_AM
OTLT_RLTN_MNGR_CD
OTLT_FRST_POST_DT
WHERE SORC_FEE_ID EQ '22G' OR '22H' OR '6AC' OR '242' OR '244' OR '605' OR '606' OR '607' OR '22A' OR '22F' OR '10X' OR '10Y' OR '04G' OR '04I' OR '22E'
-*TLB-IR5456784
WHERE NEW_VALUE1 NE 0
WHERE NEW_VALUE2 NE 0
WHERE NEW_VALUE3 NE 0
WHERE NEW_VALUE4 NE 0
WHERE NEW_VALUE5 NE 0
-*TLB-IR5456784
WHERE FEE_RETL_AM NOT-FROM 0.0 TO 0.01
WHERE (FEE_CRRN_IN EQ 'Y')
WHERE (FEE_TYPE_CD EQ 'F')
WHERE (PLTF_ID EQ 'NO')
WHERE (ALLN_NM EQ 'BAMS')
WHERE OTLT_FRST_POST_DT FROM '&FROMDT' TO '&TODT'
WHERE (OTLT_STTS_CD NE '01' OR '02' OR '03' OR '13');
ON TABLE HOLD AS FNL_TEST3
END
-RUN
-*-EXIT

and this is the spec's:

Sequence Number

Description
Value

04G
VISA MISUSE OF AUTH FEE
.045000

10X
VISA ZERO AMT & AVS FEE
.025000

10Y
VISA ZERO AMT FEE
.025000

22E
DISCOVER DATA USAGE FEE
.018500

If the account is missing the first “0” after the decimal point then it should be listed on the report because it is the incorrect rate – for example, an account that has 04G @ .45000 would be incorrect and should be listed on sheet 3 of the report.

Sequence Number

Description
Value

04I
VISA ZERO FLOOR LIMIT FEE
.100000

For fee code 04I if the account has a rate higher than .1 then it should populate on sheet

Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

 Posts: 133 | Registered: December 29, 2006 IP
Expert
 posted February 20, 2012 03:44 PM Hide Post
So... Fosucing for answers ?

What is the issue ?

Your '04G' amount is 0.045

Your '04I' amount is 0.1

In general the logic looks fine.

Waz...

 Prod: WebFOCUS 7.6.10/8.1.04 Upgrade: WebFOCUS 8.2.06 OS: Linux Outputs: HTML, PDF, Excel, PPT In Focus since 1984 Know The Code

 Posts: 6207 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006 IP
Platinum Member
 posted February 20, 2012 04:17 PM Hide Post
Thanks Waz....

I dont see a problem either...but my team lead said that i missed something ...she said the user was looking for
"The logic user looking is ‘A’ or ‘B’ or ‘C’ "

ans my logic was supporting

"The logic what you are implemented is ‘B’ or ‘C’ and ‘A’. Change the logic is ‘B’ or ‘C’ or ‘A’."

so I asked the Guru's

Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

 Posts: 133 | Registered: December 29, 2006 IP
Expert
 posted February 20, 2012 04:30 PM Hide Post
quote:
WHERE NEW_VALUE1 NE 0
WHERE NEW_VALUE2 NE 0
WHERE NEW_VALUE3 NE 0
WHERE NEW_VALUE4 NE 0
WHERE NEW_VALUE5 NE 0

The only thing that I can see is that you are using multiple WHERe clauses, that effectivly is a logical AND.

Perhaps they want:
```WHERE NEW_VALUE1 NE 0
OR NEW_VALUE2 NE 0
OR NEW_VALUE3 NE 0
OR NEW_VALUE4 NE 0
OR NEW_VALUE5 NE 0```

I think you need more info on what they want and what the program is doing.

I've always found that talking to the users directly helps.

You tend to get the answer quickly.

Waz...

 Prod: WebFOCUS 7.6.10/8.1.04 Upgrade: WebFOCUS 8.2.06 OS: Linux Outputs: HTML, PDF, Excel, PPT In Focus since 1984 Know The Code

 Posts: 6207 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006 IP
Platinum Member
 posted February 21, 2012 09:46 AM Hide Post
thanks was for your help...

How do I turn this into a nested "or" statement..maybe that's the issue

-*NEW_VALUE/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '04G') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '10X') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '10Y') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '22E') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
-* IF (SORC_FEE_ID EQ '04I') AND (FEE_RETL_AM LE .1) THEN 0 ELSE FEE_RETL_AM;

Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

 Posts: 133 | Registered: December 29, 2006 IP
Platinum Member
 posted February 21, 2012 11:21 AM Hide Post
when i run this I should get everything ...including the sorce_fee_id's in the new_value define...because of my where statement...but I'm not getting them..

the goal is really to set new_value to zero when the conditions in the define are not true... I've also tried the commented out define also

-*NEW_VALUE/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '04G') AND (FEE_RETL_AM LT 0.1) OR
-* (SORC_FEE_ID EQ '10X') AND (FEE_RETL_AM LT 0.1) OR
-* (SORC_FEE_ID EQ '10Y') AND (FEE_RETL_AM LT 0.1) OR
-* (SORC_FEE_ID EQ '22E') AND (FEE_RETL_AM LT 0.1) OR
-* (SORC_FEE_ID EQ '04I') AND (FEE_RETL_AM LE .1) THEN 0 ELSE FEE_RETL_AM;

NEW_VALUE/P13.6 MISSING ON = IF (SORC_FEE_ID EQ '04G') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
IF (SORC_FEE_ID EQ '10X') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
IF (SORC_FEE_ID EQ '10Y') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
IF (SORC_FEE_ID EQ '22E') AND (FEE_RETL_AM LT 0.1) THEN 0 ELSE
IF (SORC_FEE_ID EQ '04I') AND (FEE_RETL_AM LE .1) THEN 0 ELSE FEE_RETL_AM;

END
TABLE FILE OUTLET
"Weekly Masterfile Integrity Report"
"From &FROMDT to &TODT"
"Run date: &DATE"
PRINT
OTLT_ACCT_ID AS 'Account Number'
OTLT_MRCH_NM AS 'Account Name'
FEE_CRRN_IN AS 'Status'
SORC_FEE_ID AS 'Sequence Number'
FEE_SQNC_DSCR_TX AS 'Description'
FEE_RETL_AM AS 'Value'
OTLT_RLTN_MNGR_CD AS 'RM CODE'
OTLT_FRST_POST_DT AS 'ACCOUNT KEYED DT'
WHERE SORC_FEE_ID EQ '22G' OR '22H' OR '6AC' OR '242' OR '244' OR '605' OR '606' OR '607' OR '22A' OR '22F' OR '10X' OR '10Y' OR '04G' OR '04I' OR '22E'
-*TLB-IR5456784
-*WHERE NEW_VALUE GT 0
-*WHERE NEW_VALUE NE 0
-*TLB-IR5456784
WHERE (FEE_RETL_AM FROM 0.0 TO 0.01) OR (NEW_VALUE GT 0);
-*WHERE FEE_RETL_AM NOT-FROM 0.0 TO 0.01
WHERE (FEE_CRRN_IN EQ 'Y')
WHERE (FEE_TYPE_CD EQ 'F')
WHERE (PLTF_ID EQ 'NO')
WHERE (ALLN_NM EQ 'BAMS')
WHERE OTLT_FRST_POST_DT FROM '&FROMDT' TO '&TODT'
WHERE (OTLT_STTS_CD NE '01' OR '02' OR '03' OR '13');
ON TABLE PCHOLD FORMAT EXL2K CLOSE
ON TABLE SET STYLE *
UNITS=IN,

Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

 Posts: 133 | Registered: December 29, 2006 IP

Focal Point    Focal Point Forums    WebFOCUS/FOCUS Forum on Focal Point     WebFosuc logic question