Hi all SAS Users,
This morning, I read a set of code as below, I do not understand the underlying reason of the code
proc sort data=my.keepvar_1999_2000 (keep=LOC)
out= want NODUPKEY;
by LOC;
run;
I do not know why they keep LOC while they sort by LOC in this case (LOC is a character variable denoted the country) . Could you please explain it to me?
Warm regards.
The main purpose of selecting specific variables from the source data would be to reduce the size the output data set to what the coder only needs to use later.
A secondary reason could be to reduce the size of the temporary data set(s) that Proc Sort generates while executing.
If you only need one variable but the data set has 100 more variables then disk space and memory is needed in execution for stuff that you don't want. So the code would run faster using less resources.
The main purpose of selecting specific variables from the source data would be to reduce the size the output data set to what the coder only needs to use later.
A secondary reason could be to reduce the size of the temporary data set(s) that Proc Sort generates while executing.
If you only need one variable but the data set has 100 more variables then disk space and memory is needed in execution for stuff that you don't want. So the code would run faster using less resources.
The obvious purpose to me is to create an ascending order list of the unique values in variable LOC.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.