Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] foc_none OR foc_null
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] foc_none OR foc_null
 Login/Join
 
Platinum Member
posted
I have this code below some of which I found on Focal Point.

My dilemma now is that it works but sometimes there is no middle name in which case i need to ignore it. I can enter the first letter followed by % and it will work but occasionally although rarely a donor may have no middle name in which case I would like the user to not have to enter anything. I tried setting default to % and to foc_none and neither worked.

suggestions are welcome

 
-SET &LASTNAME = LCWORD(&LASTNAME.LENGTH, &LASTNAME, 'A&LASTNAME.LENGTH');
-SET &FIRSTNAME = LCWORD(&FIRSTNAME.LENGTH, &FIRSTNAME, 'A&FIRSTNAME.LENGTH');
-SET &MIDNAME = LCWORD(&MIDNAME.LENGTH, &MIDNAME, 'A&MIDNAME.LENGTH');
-*-SET &2NAME = UPCASE(&2NAME.LENGTH, &2NAME, 'A&2NAME.LENGTH');
-*-SET &3NAME = LOCASE(&3NAME.LENGTH, &3NAME, 'A&3NAME.LENGTH');
TABLE FILE SPRIDEN
PRINT
     SPRIDEN.SPRIDEN.SPRIDEN_PIDM
     SPRIDEN.SPRIDEN.SPRIDEN_ID
     SPRIDEN.SPRIDEN.SPRIDEN_FIRST_NAME
     SPRIDEN.SPRIDEN.SPRIDEN_LAST_NAME
     SPRIDEN.SPRIDEN.SPRIDEN_MI
WHERE ( SPRIDEN.SPRIDEN.SPRIDEN_CHANGE_IND EQ MISSING );
WHERE ( SPRIDEN.SPRIDEN.SPRIDEN_LAST_NAME LIKE '&LASTNAME' );
WHERE ( SPRIDEN.SPRIDEN.SPRIDEN_FIRST_NAME LIKE '&FIRSTNAME' );
WHERE ( SPRIDEN.SPRIDEN.SPRIDEN_MI LIKE '&MIDNAME' );
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/PRDODSP/_EDAHOME/ETC/endeflt.sty,
$
TYPE=DATA,
     COLUMN=N1,
     TARGET='_self',
     FOCEXEC=/WFC/Repository/University_Advancement/universityad/bio/BioDemoMaster11.fex( \
     PIDM=N1 \
     ),
$
ENDSTYLE
END

 

This message has been edited. Last edited by: FP Moderator,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 167 | Registered: April 28, 2008Reply With QuoteReport This Post
Expert
posted Hide Post
Geoff, in the TABLE FILE section of your code, the value "FOC_NONE" will force a bypass of the code. In the Dialogue Manager it will not: the LCWORD causes the problem - it gets transformed to "Foc_None".

Easy test - run this code:

-* File fmfp_geoff1.fex
-SET &ECHO=ALL;

-DEFAULTH &MIDNAME = 'FOC_NONE';

-SET &MIDNAME = LCWORD(&MIDNAME.LENGTH, &MIDNAME, 'A&MIDNAME.LENGTH');

DEFINE FILE CAR
MIDNAME/A10 = LCWORD(10, COUNTRY, 'A10');
END

TABLE FILE CAR
SUM 
SALES
WEIGHT
HEIGHT
BY MIDNAME

WHERE MIDNAME EQ '&MIDNAME';

ON TABLE HOLD
END
-RUN


Now, correct the -SET:

-* File fmfp_geoff1.fex
-SET &ECHO=ALL;

-DEFAULTH &MIDNAME = 'FOC_NONE';

-SET &MIDNAME = IF &MIDNAME EQ 'FOC_NONE' THEN &MIDNAME ELSE LCWORD(&MIDNAME.LENGTH, &MIDNAME, 'A&MIDNAME.LENGTH');

DEFINE FILE CAR
MIDNAME/A10 = LCWORD(10, COUNTRY, 'A10');
END

TABLE FILE CAR
SUM 
SALES
WEIGHT
HEIGHT
BY MIDNAME

WHERE MIDNAME EQ '&MIDNAME';

ON TABLE HOLD
END
-RUN



Francis


WebFOCUS is my bread and butter. I'd like to help make it taste better.

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: 10393 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
...or turn the function calls in your amper-variable values into strings. Those will be subsituted in your TABLE request and only at the point where FOCUS parses your code will those functions be called - that way, FOC_NONE will work as intended.

-SET &MIDNAME = 'LCWORD('|&MIDNAME.LENGTH|', '|&MIDNAME|', ''A'|&MIDNAME.LENGTH|''')';


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1448 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Frances and Wep thanks for your help


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 167 | Registered: April 28, 2008Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] foc_none OR foc_null

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.