Focal Point
testing missing value from left outter join result

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

July 29, 2008, 10:13 AM
Hua
testing missing value from left outter join result
I like to give a default value "BVI001" to my field SETID whenever there is no matching record found in the secondary file of a left outter join. I have trouble with it. Can someone tell me what is wrong with my codes:

SET ALL=PASS
JOIN
LEFT_OUTER HOLD.SEG01.A7KMCD AND HOLD.SEG01.A7KNCD IN HOLD TO IF0800P.IF0800P.IF8ALCD AND IF0800P.IF0800P.IF8AFCD IN IF0800P AS J2
END
DEFINE FILE HOLD
SETID/A10=IF IF8EXCE EQ MISSING THEN 'BVI001' ELSE IF0800P.IF0800P.IF8EXCE;
END
TABLE FILE HOLD
PRINT
'HOLD.SEG01.A7KKCD'
'HOLD.SEG01.MAP'
'HOLD.SEG01.LEVEL1'
'HOLD.SEG01.A7EPNB'
'HOLD.SEG01.A7KMCD'
'HOLD.SEG01.A7KNCD'
'HOLD.SEG01.A7DIVA01'
'IF0800P.IF0800P.IF8EXCE'
'IF0800P.IF0800P.SETID'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
July 29, 2008, 10:31 AM
LEX-IA
quote:
IF IF8EXCE EQ MISSING

The correct syntax is: IF IF8EXCE IS MISSING

Use it with missing on

SETID/A10 MISSING ON = IF IF8EXCE IS MISSING THEN 'BVI001' ELSE IF0800P.IF0800P.IF8EXCE;


Try that

This message has been edited. Last edited by: LEX-IA,


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
July 29, 2008, 10:52 AM
hammo1j
If IF8EXCE is numeric try

SETID/A10=IF IF8EXCE EQ MISSING OR IF8EXCE EQ 0 THEN 'BVI001' ELSE IF0800P.IF0800P.IF8EXCE;

If alpha try

SETID/A10=IF IF8EXCE EQ MISSING OR IF8EXCE EQ ' ' THEN 'BVI001' ELSE IF0800P.IF0800P.IF8EXCE;

See similar posts for explanation.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
July 29, 2008, 12:18 PM
Hua
quote:
Originally posted by hammo1j:
If IF8EXCE is numeric try

SETID/A10=IF IF8EXCE EQ MISSING OR IF8EXCE EQ 0 THEN 'BVI001' ELSE IF0800P.IF0800P.IF8EXCE;

If alpha try

SETID/A10=IF IF8EXCE EQ MISSING OR IF8EXCE EQ ' ' THEN 'BVI001' ELSE IF0800P.IF0800P.IF8EXCE;

See similar posts for explanation.


Thank you both Lex-IA and hammo1j!
I tried both sugguestions, and hammo1j's works in my case. Lex-IA's seemed quite logical.


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
July 30, 2008, 05:23 PM
Darin Lee
We just addressed this same issue in a post a day or two ago. One point that was made (and not to be critical, just to make sure that correct information is posted) - the MISSING ON parameter on the left side of the expression has nothing to do with missing values in fields being evaluated (on the right side). What it does do is it allows the evaluated value of the expression to be missing/null based on the criteria.

For example, say the value of a FLD1 is null. So

DEFFLD/A10 MISSING ON = IF FLD1 EQ MISSING THEN MISSING ELSE 'FLDVALUE01';

would be evaluated to NULL but

DEFFLD/A10 = IF FLD1 EQ MISSING THEN MISSING ELSE 'FLDVALUE01';

would be evaluated to ' ' even though you've specified that the value should be missing.

Hope the explanation is clear enough.


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