Blanks, either system-generated or as part of the source data, can cause problems when retained in a string. The following functions help deal with them.
Dealing with blanks
Compress, Strip, and Trim
The compress, strip, and trim functions help us deal with blanks in strings. Based on the following example, try and figure out the differences in the Compress, Strip, and Trim functions:
Data Compare;
Length String $20.;
Format String $20.;
String = " 3 fn comparison ";
Compress="#"||Compress(String)||"#";
Trim="#"||Trim(String)||"#";
Strip="#"||Strip(String)||"#";
Run;
This will result in the following output:
We have used the concatenation (||) parameters to highlight...