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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 580 views
  • 0 likes
  • 3 in conversation