Hey everyone,
I have questions, please!
Work.new is a temporary data set?
Mylib.new is a permanent data set?
Please I really need to know the answer.
Thank you in advance
The WORK library is a temporary location for SAS data sets. It will be deleted when the SAS session ends.
Another library, like MYLIB, might be a permanent location (but really is anything permanent?), depending on how it was assigned. However, in general we would consider/classify a non-WORK library as "permanent."
Run:
libname _all_ list ;
To see all library definitions in the SAS log. Any that indicate "ACCESS = TEMP" are temporary.
NOTE: Libref= WORK
Scope= IOM ROOT COMP ENV
Engine= V9
Access= TEMP
Physical Name= /sastmp/SAS_work27FA0000505C_miseiddvp1
Filename= /sastmp/SAS_work27FA0000505C_miseiddvp1
Access Permission= rwx------
Hi @Malk020
Technically speaking, work datasets are not temporary, they are just automatically deleted when SAS ends.
When SAS is started, a new directory is created on disk and asssigned with the libref work. SAS automatically deletes the directory and its content upon termination, because the system option WORKTERM is set as default. Because of this default behaviour datasets written to this libref are called temporary, but they are permanent disk files just like datasets written to other libraries.
If the system option NOWORKTERM is set with SAS invocation or during the session, the library is not deleted. This can in some cases be a useful feature to help with debugging. And if SAS for some reason terminates with an error, the library is not deleted either.
In both cases the directory with content will exist until it is removed manually, and it is a good idea to check the SAS Temporary Files directory from time to time and delete old work directories.
@Malk020 wrote:
Hey,
Thank you for your reply, It's convinced me now, so based on it I would say that Work.new is a permanent data set, and the answer in question below is 2, right?
Which data sets are permanent? (You can choose more than one )
1.Temp.new 2.Work.new 3.Mylib.new
Is this from some real quiz/test that someone has given you? Are you allowed to write a response or only mark each of those datasets with a yes/no flag? Did they not provide any context?
The RIGHT answer depends on information you have not provided. Where are the TEMP and MYLIB librefs pointing? Are they pointing to your SAS sessions WORK directory (or some subdirectory you might have created there)? Are they pointing to some other that your system considers temporary and where the files are automatically deleted?
Without more details the BEST answer is to just select the WORK dataset as the one that is "temporary" and the others are "permanent".
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.