Focal Point
[CLOSED] Dealing with special characters in data fields

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

March 03, 2014, 01:24 PM
lenny
[CLOSED] Dealing with special characters in data fields
I am trying to do the following:

  
TABLE FILE TBL1
PRINT
  CUSTNAME
WHERE CUSTNO EQ &CNO
ON TABLE HOLD AS CNAME FORMAT ALPHA
END
-RUN
-READ CNAME &CUST_NAME.A30.
-RUN


It works wonderfully until I run into a name with special characters such as 'N&R CONCRETE'.

How does one work around this?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8202M
Client: Windows Server 2012R2/Tomcat 8.0/IIS
Server: IBM i v7r2m0
MS-SQL
March 03, 2014, 03:12 PM
MattC
Use a quoted string.

quote:
'&CNO.EVAL'


We ran into this a few years back, but we did some data scrubbing.


WebFOCUS 8.1.05
March 03, 2014, 03:14 PM
lenny
It's not the &CNO that's causing the issue, it's reading the CUSTNAME.


WebFOCUS 8202M
Client: Windows Server 2012R2/Tomcat 8.0/IIS
Server: IBM i v7r2m0
MS-SQL
March 03, 2014, 03:21 PM
j.gross
Is there an error message? I would expect the -READ to work without a hitch.

-- But if you have a line further down with
&CUST_NAME.EVAL

that could cause a problem ("&R is undefined")
March 03, 2014, 03:58 PM
lenny
I actually use the field as an input to an HTML page so it tries displaying in a text field !IBI.AMP.CUST_NAME; The HTML page just spins and doesn't load .... every.

I've done some more tracing and it does look like all the dialogue manager code is executing just fine, it's when it hits that HTML page.


WebFOCUS 8202M
Client: Windows Server 2012R2/Tomcat 8.0/IIS
Server: IBM i v7r2m0
MS-SQL
March 05, 2014, 07:46 AM
Ian Dalton
You could replace any customer names that have a & symbol to &| so 'N&R CONCRETE' becomes 'N&|R CONCRETE' and then it will not error because it can't resolve &R.
Ian


_______________________
*** WebFOCUS 8.1.05M ***
March 05, 2014, 10:00 PM
susannah
lenny, once you have read the custname into the variable &CUSTNAME, then whenever you reference that variable later, be SURE to use
&CUST_NAME.QUOTEDSTRING
and that should avoid the & problem.
eg:
DEFINE FILE CAR
somename/A30 WITH CAR = &CUST_NAME.QUOTEDSTRING ;
...
or
IF SOMEFIELD EQ &CUST_NAME.QUOTEDSTRING

If you're having issues still, with your html page, then do it the hard way and sledge hammer some quotes around it
-SET &CUST_NAME='''| &CUST_NAME || ''';
(you may have to tinker with that, i can't log on to test it right now)




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 06, 2014, 02:33 AM
Avinash
Hi,
try with this..
May be it will help....
==========================
TABLE FILE TBL1
PRINT
CUSTNAME
WHERE CUSTNO EQ &CNO
ON TABLE HOLD AS CNAME FORMAT ALPHA
END
-RUN
-READ CNAME &DUMMY.A6. &CUST_NAME.A30.
-RUN


Thanks!
@vi

WebFOCUS 8105, Dev Studio 8105, Windows 7, ALL Outputs