Focal Point
[CLOSED] STRIP FUNCTION FOR TX50 FIELD

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

March 06, 2017, 04:39 PM
Geoff Fish
[CLOSED] STRIP FUNCTION FOR TX50 FIELD
I have a challenge I have a field that I need to either remove or translate ' from not sure if its apostrophe or grave but i have never encounterd a field formatted like this before. its a TX50 , I know but that's what the report painter displays.

I started out with strip to no good and also tried CTRAN before I discovered the filed was not in fact an A4000 so any pointers will be appreciated

This message has been edited. Last edited by: FP Mod Chuck,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
March 06, 2017, 04:54 PM
susannah
if its TX50 field, have you tried DEFINE-ing it to an A50 or an A50V and then operating on the /A redefined field?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 06, 2017, 05:09 PM
Waz
Yeah, I don't think any function works on a TX field.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 07, 2017, 08:38 AM
jgelona
Correct me if I am wrong, but TX is just the USAGE format. It says the field is text and display in lines of 50 characters per line. The ACTUAL format is A4000 or maybe even A4000V if it is a field in a relational table. Either way, DEFINE a field as A4000, set it equal to the text field and go from there.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
March 07, 2017, 09:44 AM
dhagen
Try using a native DB function in the DB_EXPR function:

RESULT/A4000V WITH xxx=DB_EXPR(some-expression-here);  



"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
March 07, 2017, 09:58 AM
Geoff Fish
The master file description says the actual is TX and the usage is TX50

quote:
Originally posted by jgelona:
Correct me if I am wrong, but TX is just the USAGE format. It says the field is text and display in lines of 50 characters per line. The ACTUAL format is A4000 or maybe even A4000V if it is a field in a relational table. Either way, DEFINE a field as A4000, set it equal to the text field and go from there.



809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
March 07, 2017, 10:12 AM
Geoff Fish
Tried that also tried SQL pass thru with dbms_lob.substr(adrconf_comment, 3900, 1)
from alumni.adrconf

still characters showing incorrectly

quote:
Originally posted by jgelona:
Correct me if I am wrong, but TX is just the USAGE format. It says the field is text and display in lines of 50 characters per line. The ACTUAL format is A4000 or maybe even A4000V if it is a field in a relational table. Either way, DEFINE a field as A4000, set it equal to the text field and go from there.



809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
March 08, 2017, 11:52 AM
jgelona
Geoff,

Let me be more specific. In our application we have hundreds of not thousands of small to large, freeform text fields. Everything from 50 characters to 4000 characters. I know this works.

In your master you have a field like this:
  FIELD=TXT01 , LOC_TXT, TX50  , TX    ,$


Now add this to the master:
  FIELD=TXT01V, LOC_TXT, A4000 , A4000 ,$


If you want, could add a DEFINE to the master like this:
DEFINE TXT01V/A4000=TXT01;


Now do your function operations on TXT01V.

Either way should work


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
March 27, 2017, 02:37 PM
Geoff Fish
Sorry that is taken so long to test this I am still not able to get this to work. evin with define in the MFD i have not been able to get either strip, strrep or CTRAN to work.

However as HTML the character renders correctly. could I hold this file in some format and then read? I have even tried SQL passthru and wind up with the same characters.

If someone can tell me how to attache an image to this post ill be glad to do that


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
March 27, 2017, 03:19 PM
Francis Mariani
Geoff, dhagen's suggestion should work.

I'm not sure what you're expecting this to do:

dbms_lob.substr(adrconf_comment, 3900, 1) from alumni.adrconf


dhagen's suggestion is to use the relational database native function in a COMPUTE or DEFINE.

For Oracle, it would be:
COMPUTE adrconf_comment_rep/A4000 = REPLACE( adrconf_comment, '`' , '''' );

I'm not sure if COMPUTE adrconf_comment_rep/TX50 would work...


Francis


Give me code, or give me retirement. In FOCUS since 1991

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
March 28, 2017, 01:13 PM
Geoff Fish
thanks Francis I will give that a try


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML