Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     (Solved) - limitations of STRREP

Read-Only Read-Only Topic
Go
Search
Notify
Tools
(Solved) - limitations of STRREP
 Login/Join
 
Member
posted
I am using dialogue manager to replace a "^" character with a "&" character, but the variable that is being used is over 5000 characters in length and it's failing:

-SET &parm_list = STRREP(&REPORTPARAMETERS.LENGTH,&REPORTPARAMETERS,1,'&',1,'^',&REPORTPARAMETERS.LENGTH,'A&REPORTPARAMETERS.LENGTH');

This will work up to 4000 characters, but fails if the &REPORTPARAMETERS value is any longer.

We are using both WF version 8005 and 8105, but it seems to fail on either version.

any ideas?

This message has been edited. Last edited by: Troy_proffitt,


WF version 8105
all output
 
Posts: 28 | Registered: February 17, 2010Report This Post
Virtuoso
posted Hide Post
Would REPLACE work in this case?

https://webfocusinfocenter.inf...r/source/replace.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
I just tested in both 8009 and 8105 and that function isn't available.


WF version 8105
all output
 
Posts: 28 | Registered: February 17, 2010Report This Post
Virtuoso
posted Hide Post
May be a pain, but what if you split your variable into two (or more) of 4000 char (or less) each, then perform the STRREP to each and merge them back into one var ?
-SET &MAXLEN  = 25;
-SET &POS2    = &MAXLEN + 1;
-SET &LONGSTR = 'ABCDEFG^HIJKLMN^OPQRSTU^VWXYZ12^3456789^0';

-SET &LEN_STR = &LONGSTR.LENGTH;
-IF &LEN_STR GT &MAXLEN THEN GOTO SPLITSTR;

-SET &TSTR    = TRIMV('T', &LONGSTR, &LONGSTR.LENGTH, ' ', 1, 'A&LONGSTR.LENGTH');
-SET &LONGSTR = STRREP(&TSTR.LENGTH, &TSTR, 1, '^', 1, '&', &TSTR.LENGTH, 'A&TSTR.LENGTH');
-GOTO ENDREPLSTR

-SPLITSTR
-SET &SPLIT1  = SUBSTR(&LONGSTR.LENGTH, &LONGSTR,  1, &MAXLEN, &MAXLEN, 'A&MAXLEN.EVAL');
-TYPE SPLIT1: &SPLIT1<--
-SET &NSPLIT1 = STRREP(&SPLIT1.LENGTH, &SPLIT1, 1, '^', 1, '&', &SPLIT1.LENGTH, 'A&MAXLEN.EVAL');
-TYPE NSPLIT1: &NSPLIT1<--

-SET &SPLIT2  = SUBSTR(&LONGSTR.LENGTH, &LONGSTR, &POS2, &LONGSTR.LENGTH, &MAXLEN, 'A&MAXLEN.EVAL');
-TYPE SPLIT2: &SPLIT2<--
-SET &TSPLIT2 = TRIMV('T', &SPLIT2, &SPLIT2.LENGTH, ' ', 1, 'A&SPLIT2.LENGTH');
-SET &NSPLIT2 = STRREP(&TSPLIT2.LENGTH, &TSPLIT2, 1, '^', 1, '&', &TSPLIT2.LENGTH, 'A&TSPLIT2.LENGTH');
-TYPE NSPLIT2: &NSPLIT2<--

-SET &LONGSTR = &NSPLIT1 || &NSPLIT2;

-ENDREPLSTR
-TYPE NEW LONGSTR: &LONGSTR<--


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
I assume, you'd have to change :
-SET &SPLIT1 = SUBSTR(&LONGSTR.LENGTH, &LONGSTR, 1, 4000, 4000, 'A4000');
-SET &SPLIT2 = SUBSTR(&LONGSTR.LENGTH, &LONGSTR, 4001, &LONGSTR.LENGTH, 4000, 'A4000');

correct?


WF version 8105
all output
 
Posts: 28 | Registered: February 17, 2010Report This Post
Expert
posted Hide Post
Have you considered CTRAN?
The CTRAN function translates a character within a character string to another character based on its decimal value. This function is especially 
useful for changing replacement characters to unavailable characters, or to characters that are difficult to input or unavailable on your keyboard. It can also be used for inputting 
characters that are difficult to enter when responding to a Dialogue Manager -PROMPT command, such as a comma or apostrophe. It eliminates the need to enclose entries in single 
quotation marks (').

To use CTRAN, you must know the decimal equivalent of the characters in internal machine representation. Note that the coding chart for conversion is platform dependent, hence your 
platform and configuration option determines whether ASCII, EBCDIC, or Unicode coding is used. Printable EBCDIC or ASCII characters and their decimal equivalents are listed in 
Character Chart for ASCII and EBCDIC.

In Unicode configurations, this function uses values in the range:

 ♦ 0 to 255 for 1-byte characters.
 ♦ 256 to 65535 for 2-byte characters.
 ♦ 65,536 to 16,777,215 for 3-byte characters.
 ♦ 16,777,216 to 4,294,967,295 for 4-byte characters (primarily for EBCDIC).
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Troy_proffitt:
I assume, you'd have to change :
-SET &SPLIT1 = SUBSTR(&LONGSTR.LENGTH, &LONGSTR, 1, 4000, 4000, 'A4000');
-SET &SPLIT2 = SUBSTR(&LONGSTR.LENGTH, &LONGSTR, 4001, &LONGSTR.LENGTH, 4000, 'A4000');

correct?

Yes, but the way I wrote the code I made it more flexible using parameters &MAXLEN, &POS2.
So, you don't need to change numbers at several places
I also insure that the string have no spaces at the end. What you are doing when you are keeping all the variables with a fix length of 4000


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Here's the result from using CTRAN:
*** parm_list In : I need to replace all "^" character with a "&" character, in a 5000+ character variable. "^" ***
*** parm_list Out: I need to replace all "&" character with a "&" character, in a 5000+ character variable. "&" ***
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Master
posted Hide Post
quote:
Have you considered CTRAN?


To echo Doug, I was able to use that function on a parameter that is 25,600 in length:
  
-SET &PARAMETER = 'Lorem^ipsum^dolor^sit^ut^amet^consectetur^adipiscing^elit^sed^do^eiusmod^tempor^incididunt^ut^labore';

-REPEAT LABEL 8 TIMES
-SET &PARAMETER = '&PARAMETER.EVAL&PARAMETER.EVAL';
-LABEL 

-TYPE ***BEFORE***
-TYPE PARAMETER: &PARAMETER;
-TYPE LENGTH: &PARAMETER.LENGTH;

-SET &LEN = &PARAMETER.LENGTH;
-SET &PARAMETER = CTRAN(&LEN, &PARAMETER.QUOTEDSTRING, 94, 38, 'A&LEN.EVAL');

-TYPE ***AFTER***
-TYPE PARAMETER: &PARAMETER;
-TYPE LENGTH: &PARAMETER.LENGTH;


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Master
posted Hide Post
I found this site to get the ASCII decimal numbers from: https://ascii.cl/


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Master
posted Hide Post
If this has corrected the issue that you were facing, please change the post title to include [Solved].


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Member
posted Hide Post
I tried out the CTRAN code and it works perfectly! Thanks for the help.


WF version 8105
all output
 
Posts: 28 | Registered: February 17, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     (Solved) - limitations of STRREP

Copyright © 1996-2020 Information Builders