BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Malk020
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12
Yes, that's correct.
The datasets in the WORK library are temporary datasets, and the datasets in the other libraries are permanent datasets.

View solution in original post

5 REPLIES 5
japelin
Rhodochrosite | Level 12
Yes, that's correct.
The datasets in the WORK library are temporary datasets, and the datasets in the other libraries are permanent datasets.
ChrisHemedinger
Community Manager

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------
Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
ErikLund_Jensen
Rhodochrosite | Level 12

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
Fluorite | Level 6
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
Tom
Super User Tom
Super User

@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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2568 views
  • 3 likes
  • 5 in conversation