BookmarkSubscribeRSS Feed
Ken_oy
Fluorite | Level 6
I try to use button file->import data to import data from a XLS file.

But the problem is, variable names are in the first two rows. Is there any option I can choose the first tow rows as variable names?

for example:

For example:
Variable A Variable B
v1 v2 v3 v4 v5 v6 v7 v8

I try to import all these data as:
VAv1 VAv2 VAv3 VAv4....




Thanks!!
2 REPLIES 2
deleted_user
Not applicable
I think you are going to have to change the variable names in Excel before importing them to SAS. You can do it very easily using the formulas of Excel. Use the formula below in cell A1 to create a new variables name:

="VA" & [Sheet1!]A2

This will create a new variable name in the cell A1 with the name: Vav1

To make it even easier, replace all "Variable A" with "VA" and Variable B" with VB" before using the above the formula. The use the below solution in cell A1:

= [Sheet1!]A1 & [Sheet1!]A2

Copy and paste this formula across the row, and there you go, you have your new variable names... Then copy you entire data to this new sheet. Import this new sheet...

Hope this helps...
Ken_oy
Fluorite | Level 6
owo!! Great!!

That is what I need! Thanks!!!

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 653 views
  • 0 likes
  • 2 in conversation