BookmarkSubscribeRSS Feed
padmakumariMiriyala
Calcite | Level 5

iam reading excel sheet in sas using libname

   variables names came in f1  f2  f3 .............

my requirment is 1st obs values come in to variable name,

for example ;

i have data like this:

obs      f1  f2   f3  f4

history jan feb  mar  apr

saves   400 300  200 100

expences 500 300 100 700

i want like this:

history jan feb  mar  apr

saves   400 300  200 100

expences 500 300 100 700

help me ,

thanks in advance

3 REPLIES 3
Tom
Super User Tom
Super User

Delete the empty row at the top of the spreadsheet.

art297
Opal | Level 21

If it's an XLS file you can use proc import with the XLS engine. e.g.:

proc import file='c:\temp\filename.xls' out=op dbms=xls replace;

                                               namerow=2;

                                               startrow=3;

                                               getnames=yes;

                                               run;

Karthikeyan
Fluorite | Level 6

Set the GETNAMES option to YES in your libname.

Eg :    libname doctors 'c:\clinicNotes\addresses.xlsx'  GETNAMES=YES ;

Thanks

Karthik

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 514 views
  • 0 likes
  • 4 in conversation