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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1055 views
  • 0 likes
  • 2 in conversation