Learning SAS? Welcome to the exclusive online community for all SAS learners.

how to import multiple excel sheets at a time using dde

Reply
Contributor
Posts: 40

how to import multiple excel sheets at a time using dde

plz help

   i have excel file .

it contains different sheets like jan, feb, mar and apr .

how to import multiple excel sheets at a time using dde.

plz send me full notes on dde in sas

Frequent Contributor
Posts: 111

Re: how to import multiple excel sheets at a time using dde

i don't DDE know but using libname statement it is possible.

libname abc "E:\sample.xls";

by running this all excel sheets data is copied to abc library. But one drawback is that the if you use this statement

then excel data is copied to abc library. and in excel that data is not available.

and again if you use  libname abc clear; then copied as usual data is copied to excel.

If you SET statement to copied that datasets from another its not possible. then you have to use

data ds;

set abc.'sheet1$'n;

run;

this is the way moving data sets from another library.

Super User
Posts: 17,912

Re: how to import multiple excel sheets at a time using dde

The libname statements open a connection to the Excel file and you can reference the sheets as if they were datasets in a library.

No information is copied anywhere.

You do have to use name literal notation to reference Sheets, but not necessarily ranges.

Occasional Contributor
Posts: 17

Re: how to import multiple excel sheets at a time using dde

Hi tlnarayana26,

instead of DDE you can try following code,

PROC IMPORT

  OUT=LIBNAME.FILE1

  OUT=LIBNAME.FILE2

  OUT=LIBNAME.FILE3

  DATAFILE="LOCALPATH\FILENAME.xls"

  DBMS=EXCEL REPLACE;

  RANGE="SHEETNAME1$";

  RANGE="SHEETNAME2$";

  RANGE="SHEETNAME3$";

RUN;

Regards,

Yogesh

Ask a Question
Discussion stats
  • 3 replies
  • 381 views
  • 0 likes
  • 4 in conversation