September 2019
Beginner to intermediate
346 pages
7h 35m
English
We explored COALESCE and related functions to help us choose from multiple values. However, there are other instances when we want to join observations together. Earlier, the concatenation operator (||) was mentioned when we showcased the difference between the Compress, Strip, and Trim functions. The CAT function is a built-in function in SAS to help join observations. Let's compare it with the use of the concatenation operator in the following code block:
73 Data _Null_; 74 A = "This "; 75 B = " is"; 76 C = " a test "; 77 D = " of CAT function"; 78 Out_Symbol = A||B||C||D; 79 Out_CAT = CAT (A, B, C, D); 80 Put Out_Symbol; 81 Put Out_CAT; 82 Run;
This will result in the following message in LOG:
This is a test ...Read now
Unlock full access