The STRIP function is similar to the TRIM function. It removes both the leading and trailing spaces from a character string.
The data set above contains 2 columns: VAR1 and VAR2.
Both columns contain character values that have leading and trailing spaces.
text = "@@" || var1 || var2 || "@@";
text = "@@" || strip(var1) || strip(var2) || "@@";
The STRIP function is applied to both the VAR1 and VAR2 variables.
The character values are concatenated with the leading and trailing spaces removed:
Become a Certified SAS Specialist
Get access to two SAS base certification prep courses and 150+ practice exercises