Help using Base SAS procedures

0 OBSERVATIONS

Reply
N/A
Posts: 0

0 OBSERVATIONS

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
Trusted Advisor
Posts: 2,116

Re: 0 OBSERVATIONS

Posted in reply to deleted_user
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.
SAS Employee
Posts: 19

Re: 0 OBSERVATIONS

Posted in reply to deleted_user
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.
Super User
Posts: 10,047

Re: 0 OBSERVATIONS

Posted in reply to martha_sas
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
Ask a Question
Discussion stats
  • 3 replies
  • 221 views
  • 0 likes
  • 4 in conversation