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-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1511 views
  • 0 likes
  • 3 in conversation