How to read multiple excel sheets from a single excel file
at once????
Answers were Sorted based on User's Feedback
Answer / sravan
Using libname statement.
Libname <lib_name> excel 'file_specification';
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / rajesh
First you have to split the excel sheets and write the
program in macros and use the dde triplet.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / paul
we can read by a simple libname access method:
eg:
libname exlbook 'd:\excel file location\file name.xls';
proc copy in=exlbook out=work;
run;
/*here i am coying the entire excel workbook to work library
in sas, so we can get all sheets at a time.
if we use proc import we can import a single sheet at a time
By the above method we can dump all table from a MS-access database or oracle database or any other db.
only we have to change the connection details, i.e.,
excel --> file name with path
access --> db name with path
oracle/any other RDBMS --> user=***, password=****,
path=**** or host=****
another advantage of this method is :
the library will not occupy any memory on hard disc
it only acts as a repository which save memory and
processing time */
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / ashish
%macro pim(sheet);
proc import out= payment
datafile = 'E:SAS DOCprojectCredit Banking.xls'
dbms = Excel;
sheet = "&sheet";
getnames = yes;
run;
%mend piim;
%pim(Customer Acqusition);
%pim(Spend);
%pim(Repayment);
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / lucylu
%macro read_moresheets(ifile, lib);
libname ixls excel &ifile;
proc sql;
select memname into :ds1 - :ds100
from sashelp.vtable
where libname = "IXLS" and index(memname,'$') = 0
;
quit;
%put _user_;
%do i = 1 %to &sqlobs;
data &lib..&&ds&i;
set ixls.&&ds&i;
run;
%end;
%mend;
%read_moresheets("C:\Ongoing\CallActivity.xls", work);
Is This Answer Correct ? | 1 Yes | 3 No |
There is a field containing a date. It needs to be displayed in the format “ddmonyy” if it’s before 1975,”dd mon ccyy” if it’s after 1985, and as ‘disco years’ if its between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT.
How would you create multiple observations from a single observation?
In which format does Date stores in sas..? What is the use of DATE in SAS.?
Explain input and put function?
What is the maximum length of the macro variable?
what is metadata? : Sas-bi
what is intially documentation for a sas programmer?
To what type of programms have you used scratch macros?
what is the use of proc sql?
how can get the first and last observations in a dataset using Proc SQl?
what is validvarname and varnum? why we are using this options; explain with a syntax for this options?
what is SAS/Access and SAS/Connect?what are the uses?