BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
1 REPLY 1
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 653 views
  • 0 likes
  • 2 in conversation