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

What in this code indicates that a table will be made? Is there a code directory that I can use as a guide as I become more familiar with the SAS language?

 

libname out "s:/workshop/output";

 

data class_copy1 out.class_copy2;

set sashelp.class;

run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14
Hi @AJS1,
Great!
Could you please mark the topic as answered to make it available to the community?

View solution in original post

3 REPLIES 3
ed_sas_member
Meteorite | Level 14

Hi @AJS1 

 

 

libname out "s:/workshop/output";

In this statement, you create a SAS library called 'OUT' which refers to the physical path "s:/workshop/output'.

 

By default, SAS stores your datasets in a library called 'WORK', but these datasets are available only during the SAS session.

If you want to store a dataset permanently, you need to create permanent libraries (like in your example). This a kind of 'nickname' assigned to a physical folder.

-> s:/workshop/output/class_copy2.sas7bdat will be called out.class_copy2

 

 

data class_copy1 out.class_copy2;
set sashelp.class;
run;

In this data step (which begins with DATA and finishes with RUN;), you specify in the first statement the name of the dataset to be created: in your example, you create class_copy1 which is to be stored in the WORK library (you can omit to mention work as it is the default library -> so work.class_copy1 is equal to class_copy1). You create also class_copy2, which is to be stored permanently in the OUT library -> so you will be able to see it in the 's:/workshop/output' folder.

 

 

These two datasets are created from the input dataset CLASS, which is stored in the library SASHELP.

This action is done through the SET statement.

 

SAS provides a lot of materials (books, etc.) to get more familiar with SAS and deeply understand how it works.

You can for example take the free e-learning course SAS Programming 1 available here -> https://support.sas.com/edu/schedules.html?crs=PROG1&ctry=us

The following book is also a great resource: https://www.sas.com/store/books/categories/certification-guide/sas-certified-specialist-prep-guide-b...

 

And also the SAS community Smiley Happy

ed_sas_member
Meteorite | Level 14
Hi @AJS1,
Great!
Could you please mark the topic as answered to make it available to the community?

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 507 views
  • 0 likes
  • 2 in conversation