@RandyStan wrote:
When I run the code; I get an error statement on the "DROP" part of the code
Why withhold this information from us in your original post? Anyway, @Tom has explained what the error is.
But rarely do you need to split a data set like this. You could use a BY statement in whatever analyses you are doing, and then the splitting of the data set can be altogether avoided.
Even if you want to do separate analyses when VarA=1 or VarA=2, one data set suffices, and so you may be performing extra unnecessary work, and if this is a large dataset, splitting it like this takes up more storage and more execution time (well, that's also true if it is a small data set, but then you won't really notice the extra execution time). Example:
proc means data=have(where=(vara=1) Drop = VarF Rename = (VarM = VarMA VarN= VarNA));
/* more PROC MEANS statements */
run;
... View more