How to: |
INITCAP capitalizes the first letter of each word in an input string and makes all other letters lowercase. A word starts at the beginning of the string, after a blank space, or after a special character.
INITCAP(input_string)
where:
Alphanumeric
Is the string to capitalize.
The following request changes the last names in the EMPLOYEE data source to initial caps and capitalizes the first letter after each blank or special character in the NewName field.
TABLE FILE EMPLOYEE PRINT LAST_NAME AND COMPUTE Caps1/A30 = INITCAP(LAST_NAME); NewName/A30 = 'abc,def!ghi'jKL MNO'; Caps2/A30 = INITCAP(NewName); ON TABLE SET PAGE NOLEAD ON TABLE SET STYLE * GRID=OFF,$ ENDSTYLE END
The output is shown in the following image.