Help using Base SAS procedures

keep & drop

Reply
N/A
Posts: 0

keep & drop

please tell me that there is any difference, when we write keep & drop in option and procidure statement
Trusted Advisor
Posts: 2,115

Re: keep & drop

Posted in reply to deleted_user
Except for their being opposites, there is no functional difference. A decision about which to use is more about programming style than technical substance.
Super Contributor
Super Contributor
Posts: 3,174

Re: keep & drop

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.
N/A
Posts: 0

Re: keep & drop

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
Super Contributor
Super Contributor
Posts: 3,174

Re: keep & drop

Posted in reply to deleted_user
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.
N/A
Posts: 0

Re: keep & drop

hi sbb,
I didn't get your answer.Could you explain it briefly.

Thanks,
regards,

bina
Super Contributor
Super Contributor
Posts: 3,174

Re: keep & drop

Posted in reply to deleted_user
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.
N/A
Posts: 0

Re: keep & drop

Posted in reply to deleted_user
Thanks to all. I got my answer.
Ask a Question
Discussion stats
  • 7 replies
  • 185 views
  • 0 likes
  • 3 in conversation