Focal Point
Remove CTRLF char in a string

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

April 11, 2008, 09:37 AM
jan
Remove CTRLF char in a string
I am trying to remove a carriage control carriage in a varchar string that I am retrieving fron a db2 table. I used the bytval function to determine the dec character value '13', and then I tried to replace it using CTRAN with a dec char value of a space which is '32'. I then used the CTRAN function as follows:

LOAN_PROD_DESC_A/A255=
CTRAN(255,LOAN_PROD_A, 13, 32, 'LOAN_PROD_DESC_A);

This seems to work, but when I run the report that outputs in COM format, the record breaks in the middle of a record to a new line.

I also tried the STRREP function, using the characters that display in db2, which is '..', but again the record breaks in the middle.

LOAN_PROD_DESC_A/A255=
STRREP(255,LOAN_PROD_A,2,'..',1,' ',255,LOAN_PROD_DESC_A);
I can not change the output format either case

Varchar field on the table looks like this
N 4 ..Th in hex it looks like this
50 LOAN_PROD_A VARCHAR(255) N 4
X'0D25E388'

I need to get this to work ASAP, any assistance would be great
April 11, 2008, 11:17 AM
smiths
Jan,

I believe that you should also need to CTRAN character 10 to 32 (in addition to character 13). You need to replace the carriage return (13) AND the line feed character (10) with spaces.

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
April 11, 2008, 11:51 AM
mgrackin
I agree with smiths. You need to replace both characters (CR and LF).


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
April 11, 2008, 12:29 PM
Tony A
Jan,

Check out this post

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10