This code is written in SAS and uses the SQL...
This code is written in SAS and uses the SQL Procedure (proc sql
) to perform the following actions:
-
Extracts a Substring: The
substr(ar_id,10,12)
function extracts a substring from thear_id
column. It starts at the 10th character in the string and extracts 12 characters. -
Renames the Substring: The resulting substring is given the alias
ar_id
in the output. -
Creates a Macro Variable: The
into :dup_recov_1 separated by ","
clause places the resulting values from theselect
statement into a SAS macro variable nameddup_recov_1
. -
Concatenates Values with a Comma: If there are multiple values resulting from the query, they are concatenated into a single string, separated by commas.
-
Reads Data from a Table: The results are retrieved from the
recov_dup_exp
dataset located in thetemp
library.
Summary:
- The code processes data from the
temp.recov_dup_exp
dataset. - It extracts a 12-character substring starting from the 10th character of the
ar_id
column, concatenates these substrings with commas, and stores the result in the macro variabledup_recov_1
.