Using an Ampersand or a Single Quotation Mark

How to:

In ReportCaster, you can use an ampersand (&) and single quotation mark (') in the following fields:

The technique for using an Ampersand (&) within a Amper Variable value. Place a concatenation sign after the ampersand (&) and before the next character in the string. For example:

-SET &COMPANY='AT&|T';
-TYPE &COMPANY

The technique for using a Single quotation mark (') within a Amper Variable value. When a value contains a single quotation mark ('), 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.


Top of page

x
Syntax: How to Use CTRAN to Translate One Character to Another
CTRAN (inlen, infield, decfrm, decto, output)

where:

inlen

Is the integer that specifies the length in characters of the input string.

infield

Is the alphanumeric input string.

decfrm

Is the decimal value of the character to be translated.

decto

Is the decimal value of the character to be used as a substitute for decfrm.

output

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.



Example: Using CTRAN to Change a Single Quotation Mark to a Double Quotation Mark

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