Help using Base SAS procedures

Reading .xls with two headers into SAS !?

Reply
New Contributor
Posts: 3

Reading .xls with two headers into SAS !?

Does anyone knows how to read the .XLS file using proc import method when the excel file has two headers and not one.  If the file contain only one header SAS 9.3 is perfectly able to read it, but unfortunately with two

Headers it fails every time. 

example: This works if the excel sheet has only one header,

%macro inp(dat,dsn);

proc import datafile="/project/myfiles/data/&dat"

  out=&dsn

  dbms=xls replace;

  DATAROW=2;

  getnames=yes;

run;

I tried everything(below) that I knew for two headers file,but SAS 9.3 can not read it.

First failedTrial,

%macro inp(dat,dsn);

proc import datafile="/project/myfiles/data/&dat"

  out=&dsn

  dbms=xls replace;

  DATAROW=3;

  getnames=yes;

run;

Second failed Trial,

%macro inp(dat,dsn);

proc import datafile="/project/myfiles/data/&dat"

  out=&dsn

  dbms=xls replace;

  startrow=2;

  DATAROW=3;

  getnames=yes;

run;

Second failed Trial,

%macro inp(dat,dsn);

proc import datafile="/project/myfiles/data/&dat"

  out=&dsn

  dbms=xls replace;

  startrow=2;

  DATAROW=3;

  getnames=NO;

run;

if Anyone can share their experience with this , if had one, it will be definitely appreciated.

Verleger

Ask a Question
Discussion stats
  • 0 replies
  • 153 views
  • 0 likes
  • 1 in conversation