WebFOCUS Online Help > ReportCaster Development and Administration > Tips and Techniques for Coding a ReportCaster Report > Using an Ampersand or a Single Quotation Mark
How to: |
In ReportCaster, the following fields allow the use of an ampersand (&) and a single quotation mark ('):
The technique for using an Ampersand (&). Place a concatenation sign after the & and before the next character in the string. For example:
-SET &COMPANY='AT&|T'; -TYPE &COMPANY
The technique for using a Single quotation mark ('). When a value contains a ', use two single quotation marks (for example, O"Brien). Within a quoted string, two single quotation marks (") are interpreted as one single quotation mark.
Note: Although Information Builders recommends using this technique, you can also use the CTRAN subroutine to change one character to another.
CTRAN (inlen, infield, decfrm, decto, output)
where:
Is the integer that specifies the length in characters of the input string.
Is the alphanumeric input string.
Is the decimal value of the character to be translated.
Is the decimal value of the character to be used as a substitute for decfrm.
Is the resulting alphanumeric output string.
To use this subroutine, you must know the decimal value of the characters in internal machine representation. Printable EBCDIC or ASCII characters and their decimal values are listed in character charts.
You can use the following code to change a single quotation mark to a double quotation mark:
TABLE FILE TRAIN PRINT TRAIN AND COMPUTE ALT_MOD/A20 = CTRAN(20, MODEL, 39, 34, ALT_MOD); BY COUNTRY END
WebFOCUS |