BookmarkSubscribeRSS Feed
praveenkotte
Fluorite | Level 6

 I need to extract this data from excel file. the thing is, in the below variables the date variable consists of both numeric and charater data type. while iam reading into sas ,i am getting only few records.  i should get all records into sas data set.

 

could you please help me ?

the below attchement consists of sample of my data.

 

thanks in advance

DateparticularschequeNO/OrderNo
23/06/06received234554
11/8/2006received798242
12/8/2006received985795
20/08/06received298489
26/08/06received988323
28/08/06received248927
31/08/06received598332
5/9/2006received284729
3/9/2006received287492
15/9/2006received279872
1/9/2006received258202
2/9/2006received928590
1/11/2006received209842
5/12/2006received595972
5/12/2006received902892
20/12/06received298297
   

 

3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
What code have you tried? Easiest way would be to fix the format of the column in Excel to be a type of date and then if the only character value is the column header, PROC IMPORT or the LIBNAME engine should be able to read the date value correctly.

cynthia
praveenkotte
Fluorite | Level 6

i've tried these two codes. but instead of using libname statement, i should pull out the data using proc import or else proc sql.

proc sql;
connect to excel(path="C:\Users\siddiq\Desktop\Book1.xls");
create table tab as
select * from connection to excel
(
select * from [sheet1$]
);
disconnect from excel;
quit;

 

 

 

proc import datafile="C:\Users\siddiq\Desktop\book1.xls"
out=dd
dbms=excel
replace;
run;

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 993 views
  • 0 likes
  • 3 in conversation