DATA Step, Macro, Functions and more

proc import

Reply
Super Contributor
Posts: 647

proc import

%macro import_top100(dat);
PROC IMPORT OUT= &dat
DATAFILE= "&lkp.\Topprescriber_lkup.xls"
DBMS=EXCEL REPLACE;
SHEET="&dat";
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;

RUN;
%mend;
%import_top100(Physician_lookup);

In the above procedure ,do we have an option to let SAS know from which row it should start reading the data?
Say for instance, the first five rows in the excel gives infomation or some notes, and the actual data starts from sixth row, how do we process it?
Super Contributor
Posts: 259

Re: proc import

It seems that in 9.13 the dbms-type Excel does not support options for defining the first data row. If you know how many rows to read you can use the range options, or switch to dbms=xls and use startrow=.

The online docs contain a full description of all available options for the various dbms-types:
http://support.sas.com/onlinedoc/913/getDoc/en/proc.hlp/a000312413.htm
Ask a Question
Discussion stats
  • 1 reply
  • 112 views
  • 0 likes
  • 2 in conversation