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:
I just tested in both 8009 and 8105 and that function isn't available.
WF version 8105 all output
May 10, 2019, 11:20 AM
MartinY
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 ?
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
May 10, 2019, 11:24 AM
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?
WF version 8105 all output
May 10, 2019, 11:46 AM
Doug
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).
May 10, 2019, 12:13 PM
MartinY
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
May 10, 2019, 12:17 PM
Doug
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. "&" ***
May 10, 2019, 02:13 PM
Hallway
quote:
Have you considered CTRAN?
To echo Doug, I was able to use that function on a parameter that is 25,600 in length: