The SAS Output Delivery System and reporting techniques

import excel with three worksheets using proc import

Reply
Contributor
Posts: 32

import excel with three worksheets using proc import

Hi,

I have a excel sheet with four worksheets.

How can i achieve importing this using proc import

I tried giving as

'sheet $'n

but i did not work

and also i need to make one cell in the imported excel sheet as dynamic,so that when i run the macro the value needs to get updated

Help me in this..

Regular Contributor
Posts: 233

import excel with three worksheets using proc import

PROC IMPORT OUT= TEST
            DATAFILE= "C:\Documents and Settings\Test.xls"
            DBMS=excel REPLACE;
   SHEET="Sheet1";
RUN;

PROC IMPORT OUT= TEST1
            DATAFILE= "C:\Documents and Settings\Test.xls"
            DBMS=excel REPLACE;
   SHEET="Sheet2";
RUN;

Log:

32 PROC IMPORT OUT= TEST

33 DATAFILE= "C:\Documents and Settings\nbk8gia\My Documents\My SAS

33 ! Files\Test.xls"

34 DBMS=excel REPLACE;

35 SHEET="Sheet1";

36 RUN;

NOTE: WORK.TEST data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

real time 3.06 seconds

cpu time 0.79 seconds

37

38 PROC IMPORT OUT= TEST1

39 DATAFILE= "C:\Documents and Settings\nbk8gia\My Documents\My SAS

39 ! Files\Test.xls"

40 DBMS=excel REPLACE;

41 SHEET="Sheet2";

42 RUN;

NOTE: WORK.TEST1 data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

real time 3.18 seconds

cpu time 0.84 seconds

SAS Super FREQ
Posts: 8,743

import excel with three worksheets using proc import

Hi:

  It seems unlikely that this is an ODS question. PROC IMPORT is NOT one of the SAS Reporting procedures and, in addition, PROC IMPORT does NOT use ODS at all in the import process.

  Your best bet for help would be to post your question to either the SAS PROCEDURES forum (http://communities.sas.com/community/sas_procedures) or the SAS Macro forum (since you mentioned making something dynamic) -- (http://communities.sas.com/community/sas_macro_facility_data_step_and_sas_language_elements) since it is generally a macro program that makes programs more dynamic.

  It would also be useful if you posted your PROC IMPORT code and described where or how you need to have the program create variables dynamically.

cynthia

Ask a Question
Discussion stats
  • 2 replies
  • 349 views
  • 0 likes
  • 3 in conversation