Help using Base SAS procedures

SAS ARGHH

Reply
N/A
Posts: 0

SAS ARGHH

Hey Guys

Just wondering if anyone can help me with this coding. i have to import a excel file to SAS. ive done that and its gone through but as soon as i put the following coding in SAS :

DATA Houses;
INFILE 'H:\Documents\updateData_Collection_for_Property(1).xls';
/* Using INPUT to tell SAS about all the variables */
INPUT ID $ PR $ AR $ HT $ NOB $;
Label ID='ID NO'
PR='Price'
AR='Area'
HT='House Type'
NOB='Number of Bedrooms';
RUN;

i get the following error messages

21 DATA Houses;
122 INFILE 'H:\Documents\updateData_Collection_for_Property(1).xls';
123 /* Using INPUT to tell SAS about all the variables */
124 INPUT ID $ PR $ AR $ HT $ NOB $;
125 Label ID='ID NO'
126 PR='Price'
127 AR='Area'
128 HT='House Type'
129 NOB='Number of Bedrooms';
130 RUN;

NOTE: The infile 'H:\Documents\updateData_Collection_for_Property(1).xls' is:
Filename=H:\Documents\updateData_Collection_for_Property(1).xls,
RECFM=V,LRECL=256,File Size (bytes)=35840,
Last Modified=22 February 2011 15:30:46 o'cl,
Create Time=22 February 2011 14:40:27 o'cl

NOTE: LOST CARD.
ID=ÐÏࡱ PR= AR= HT= NOB= _ERROR_=1 _N_=1
NOTE: 1 record was read from the infile 'H:\Documents\updateData_Collection_for_Property(1).xls'.
The minimum record length was 6.
The maximum record length was 6.
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.HOUSES has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds


it wont show any data on the table but it just shows the variable names

Thanks

minal
SAS Super FREQ
Posts: 8,868

Re: SAS ARGHH

Posted in reply to deleted_user
Hi:
Generally, you use PROC IMPORT or the Excel LIBNAME engine to import an Excel sheet into a SAS dataset. There have been many previous forum postings on using these methods.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 143 views
  • 0 likes
  • 2 in conversation