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     STRREP / CTRAN not behaving....
Go
New
Search
Notify
Tools
Reply
  
STRREP / CTRAN not behaving....
 Login/Join
 
Gold member
posted
Hi,

I am trying to replace all commas with a comma and carriage return/line feed in a long string but results are inconsistent.

DEFINE FILE TEMPFILE
CRLF/A2 = HEXBYT(13,'A1') | HEXBYT(10,'A1');
XLROLE/A1116 = STRREP(1116, BASEFIELD, 1, ',' , 3, ','|CRLF, 1116, 'A1116');
END

What's happening is unpredictable. Sometimes the comma is being replaced by a comma|line feed as expected. Sometimes the comma doesn't get replaced but a line feed occurs after the next blank character after the comma. There is no 'space' after or before all the commas in the base field (BASEFIELD). Is there confusion due to replacing the comma with another comma (and line feed)? I also tried CTRAN with the same results. Output is to EXL2K. SQUEEZE is ON.

Thanks, if you can help!


WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
 
Posts: 84 | Registered: December 13, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
If you have a string in BASEFIELD that is 1116 characters long and contains one comma for example, then your replacement string would have 1118 characters, which is longer than XLROLE is declared.

So it might have something to do with the size of your target field not being allocated large enough.

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks for your help. My code worked when executing via the servlet but not when in Command Console.


WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
 
Posts: 84 | Registered: December 13, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     STRREP / CTRAN not behaving....

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