STRING_HEAD macro
The STRING_HEAD macro is available only in IBM® Campaign.
Syntax
STRING_HEAD(num_chars, data)
Parameters
num_chars
The number of characters to returns from the beginning of each string in data. This must be a positive integer greater than zero.
data
ASCII text string values. This can be ASCII text in quotes, a column of text, a cell range containing text, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your IBM® product.
Description
STRING_HEAD returns the first num_chars characters from each string value in the specified data range. If num_chars is greater than the number of characters in a text string, the remaining characters are padded with the null character " \0 ".
Examples
Creates a new column named TEMP, which contains the ASCII text string " JAN ".
Creates a new column named TEMP, which contains the ASCII text string " Pressure ".
Creates a new column named TEMP containing the first five characters of each string in column V1.
Creates three new columns named TEMP, VX, and VY. The values in the TEMP column are the first characters of the strings in the corresponding rows of column V1, the values of the VX column are the first characters of strings in corresponding rows of column V2, and the values of the VY column are the first characters of the strings in corresponding rows of column V3.
Creates three new columns named TEMP, VX, and VY. The values in the TEMP column are the first 12 characters of the strings in rows 1-50 of column V1, the values of the VX column are the first 12 characters of strings in rows 1-50 of column V2, and the values of the VY column are the first 12 characters of the strings in rows 1-50 of column V3.
Related functions