Is it possible? Cant seem to get it to work.
@ger15xxhcker wrote:
Yes, you can use the DROP and KEEP options in PROC MEANS in SAS. Here is an example of how you can use them:
proc means data=mydata noprint;
var x y z;
drop xmean ymean zmean;
keep xstd ystd zstd;
run;
These are DROP or KEEP statements, not DROP or KEEP options. You cannot use DROP or KEEP statements in PROC MEANS. If I use:
proc means data=sashelp.class;
var height weight age;
drop age;
keep height;
run;
then the log says you can't use the DROP statements or KEEP statements:
69 proc means data=sashelp.class;
70 var height weight age;
71 drop age;
NOTE: The DROP and KEEP statements are not supported in procedure steps in this release of the SAS System. Therefore, these
statements are ignored.
72 keep height;
NOTE: The DROP and KEEP statements are not supported in procedure steps in this release of the SAS System. Therefore, these
statements are ignored.
73 run;
What you can do is use the DROP or KEEP options.
proc means data=sashelp.class(drop=height);
run;
You can use Drop / Keep Data Set Options all you want in the input / output data set. Hard to tell what is wrong without seeing your code, but I suspect you attempt to use Drop / Keep Statements. Which are not supported.
Yes, you can use the DROP and KEEP options in PROC MEANS in SAS. Here is an example of how you can use them:
proc means data=mydata noprint;
var x y z;
drop xmean ymean zmean;
keep xstd ystd zstd;
run;
@ger15xxhcker wrote:
Yes, you can use the DROP and KEEP options in PROC MEANS in SAS. Here is an example of how you can use them:
proc means data=mydata noprint;
var x y z;
drop xmean ymean zmean;
keep xstd ystd zstd;
run;
These are DROP or KEEP statements, not DROP or KEEP options. You cannot use DROP or KEEP statements in PROC MEANS. If I use:
proc means data=sashelp.class;
var height weight age;
drop age;
keep height;
run;
then the log says you can't use the DROP statements or KEEP statements:
69 proc means data=sashelp.class;
70 var height weight age;
71 drop age;
NOTE: The DROP and KEEP statements are not supported in procedure steps in this release of the SAS System. Therefore, these
statements are ignored.
72 keep height;
NOTE: The DROP and KEEP statements are not supported in procedure steps in this release of the SAS System. Therefore, these
statements are ignored.
73 run;
What you can do is use the DROP or KEEP options.
proc means data=sashelp.class(drop=height);
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.