BookmarkSubscribeRSS Feed
MohammedNaeem
Calcite | Level 5

Dear all,

             I am trying to import excel file using libname statement but in my dataset variable name start from second row, actual data from third row and data in first row is of no use. How can I set getname from 2nd row and getdata from 3rd row like proc import.

 

           I am trying to this done using following code:

 

libname myexcel pcfiles path='\BA1.xlsx'
		 scantime=yes stringdates=no dbmax_text=2000 ;

data dv;
	set myexcel.'DV$'n;
run;

 Not Using proc import because format of data is getting change.

3 REPLIES 3
Patrick
Opal | Level 21

The libname XLSX engine gives you access to a whole Excel Workbook and you can't define special options on a sheet level.

I don't understand why you can't use Proc Import. If the source structure changes then that's impacting both the result Proc Import and the XLSX engine will return.

Ksharp
Super User

Not sure. Try option  DATAROW=3  .

Patrick
Opal | Level 21

@Ksharp wrote:

Not sure. Try option  DATAROW=3  .


@Ksharp 

That works for Proc Import but not for the Libname XLSX engine as documented here

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 874 views
  • 1 like
  • 3 in conversation