BookmarkSubscribeRSS Feed
deleted_user
Not applicable
hey guys

i need some help,,below is my coding of what im trying to run in SAS

/*Create the formats*/
PROC FORMAT;
VALUE AR 1 = 'Newark' 2 = 'Southwell';
VALUE HT 1 = 'Detached' 2 = 'Semi-Detached' 3 = 'Terrace';
RUN;
/*Do not add any dates or number*/
OPTIONS NODATE NONUMBER;

/*The name of the dataset is "Houses"*/
Data Houses;
set houses;
TITLE1 'Data Collection on Houses';
/*The label statement is used to give better names to variables.*/
label ID = 'ID NO'
PR = 'Price'
AR = 'Area'
HT = 'House Type'
NOB = 'Number of Bedrooms';
RUN;

PROC UNIVARIATE DATA = Houses;
Title2 'Histogram statement for house prices';
Histogram NOB;
RUN;

PROC UNIVARIATE DATA = Houses;
QQPLOT PR;
RUN;

when i try to run it i get the following error message....


ERROR: File WORK.HOUSES.DATA does not exist.


this is the

VALUE HT 1 = 'Detached' 2 = 'Semi-Detached' 3 = 'Terrace';
NOTE: Format HT has been output.
5 RUN;

NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.04 seconds
cpu time 0.01 seconds


6 /*Do not add any dates or number*/
7 OPTIONS NODATE NONUMBER;
8
9 /*The name of the dataset is "Houses"*/
10 Data Houses;
11 set houses;

ERROR: File WORK.HOUSES.DATA does not exist.


12 TITLE1 'Data Collection on Houses';
13 /*The label statement is used to give better names to variables.*/
14 label ID = 'ID NO'
15 PR = 'Price'
16 AR = 'Area'
17 HT = 'House Type'
18 NOB = 'Number of Bedrooms';
19 RUN;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.HOUSES may be incomplete. When this step was stopped there were 0
observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds


20
21 PROC UNIVARIATE DATA = Houses;
22 Title2 'Histogram statement for house prices';
23 Histogram NOB;
24 RUN;

NOTE: No observations in data set WORK.HOUSES.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.11 seconds
cpu time 0.09 seconds


25
26 PROC UNIVARIATE DATA = Houses;
27 QQPLOT PR;
28 RUN;

NOTE: No observations in data set WORK.HOUSES.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds


And when i try and open it from the results i get a another error message

DATA SET HAS 0 OBSERVATIONS

what do i need to do to fix this? helpp please someone!

thanks
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
My guess is that the SAS dataset "houses" is in a directory somewhere.

You need to create a LIBNAME to point to that directory, something like
LIBNAME mylib 'C:\';

and then change the SET statement to point to
SET mylib.houses;

so SAS knows where to find the data. You may want to read this book
http://support.sas.com/documentation/cdl/en/basess/58133/PDF/default/basess.pdf

or any of the other Books by Users (Cody's comes to mind) about getting started with SAS programming.
martha_sas
SAS Employee
Unless there is another part of this program you aren't showing us, where work.houses is created, it looks like you're trying to use the houses dataset as input (with the 'set' statement) before it exists. That's not going to work, and the error message is telling you that.
Ksharp
Super User
It seems like that WORK library is not your temporary library.
Or house is in other library.
You can try to use temp.house

Ksharp

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2301 views
  • 0 likes
  • 4 in conversation