BookmarkSubscribeRSS Feed
deleted_user
Not applicable
please tell me that there is any difference, when we write keep & drop in option and procidure statement
7 REPLIES 7
Doc_Duke
Rhodochrosite | Level 12
Except for their being opposites, there is no functional difference. A decision about which to use is more about programming style than technical substance.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
A consideration is that the DROP= is honored over the KEEP= when both parameters are coded for a specified SAS variable.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
keep and drop options are specified in the datastep or proc , the difference is when we write options in datastep it will be permanent to the dataset but where as in proc , it will not be permanent and stays affect fot that particular session only. Message was edited by: reena
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Of course, this presumes the PROC and whether or not there is a permanent output file generated, not just a file going to the WORK or SASUSER allocation.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
hi sbb,
I didn't get your answer.Could you explain it briefly.

Thanks,
regards,

bina
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
It is very much possible to affect a SAS permanent library when using the DROP= and/or KEEP= parameter, if you have WRITE authority to your SAS permanent database. This capability will be dependent on the user's session and their authority permissions. For example, consider this code:

PROC SORT DATA=PERMIN.MASTER OUT=PERMOUT.MASTER (DROP=X Y Z);
BY ....;
RUN;

If the OUT= (here PERMOUT) is a permanent library, not just for your session, the result is not going to be just for your session.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Thanks to all. I got my answer.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1553 views
  • 0 likes
  • 3 in conversation