SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nietzsche
Lapis Lazuli | Level 10

Hello, I am doing the programming 1 tutorial as shown below

 

Ben_in_Canberra_0-1665875685821.png

so ran the code as instructed

libname out "/home/u62043935/EPG1V2/output";

data storm_cat5;
	set pg1.storm_summary;
	where maxwindmph >= 156 and startdate >="01jan2000"d;
	keep season basin name type maxwindmph;
run;

From my understanding of the instruction, the storm_cat file should be inside the /home/u62043935/EPG1V2/output

However, it is in the WORK library, which is not permanent. And a library called "OUT" was created but is empty.

So my question is why isn't my output file in the expected place, or even in the OUT library but in the WORK library?

 

Ben_in_Canberra_1-1665875988322.png

there is the log.

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 libname out "/home/u62043935/EPG1V2/output";
NOTE: Libref OUT was successfully assigned as follows:
Engine: V9
Physical Name: /home/u62043935/EPG1V2/output
72
73 data storm_cat5;
74 set pg1.storm_summary;
75 where maxwindmph >= 156 and startdate >="01jan2000"d;
76 keep season basin name type maxwindmph;
77 run;
 
NOTE: There were 18 observations read from the data set PG1.STORM_SUMMARY.
WHERE (maxwindmph>=156) and (startdate>='01JAN2000'D);
NOTE: The data set WORK.STORM_CAT5 has 18 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1242.21k
OS Memory 29484.00k
Timestamp 15/10/2022 11:17:12 PM
Step Count 76 Switch Count 2
Page Faults 0
Page Reclaims 226
Page Swaps 0
Voluntary Context Switches 16
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
78
79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
90
 
User: u62043935
Messages: 9
 
 
 
 

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

Your issue in in line 73

 

You have the statement

data storm_cat5;

which is equivalent to

data work.storm_cat5;

Remember, a dataset specification in a data statement can have one component (just the dataset name) or two components (the desired library and the dataset name).  That is the attribute that you have to utilize in your code.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

View solution in original post

3 REPLIES 3
mkeintz
PROC Star

Your issue in in line 73

 

You have the statement

data storm_cat5;

which is equivalent to

data work.storm_cat5;

Remember, a dataset specification in a data statement can have one component (just the dataset name) or two components (the desired library and the dataset name).  That is the attribute that you have to utilize in your code.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Tom
Super User Tom
Super User

You already posted the answer to your question. 

Read the answer you posted starting the bold face NOTE.

Nietzsche
Lapis Lazuli | Level 10
sorry I missed that
SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 843 views
  • 0 likes
  • 3 in conversation