BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wagdy
Obsidian | Level 7

how to change variable name from q1a to q1 without affeting my data

1 ACCEPTED SOLUTION

Accepted Solutions
wagdy
Obsidian | Level 7

many thanks for your help. The problem is solved

View solution in original post

15 REPLIES 15
Astounding
PROC Star

It's easy, but you left out too much information.

 

What is the name of your data set?

 

Should this be a permanent change, or just a temporary change for one DATA or PROC step?

wagdy
Obsidian | Level 7

hi,

I have excel file & would like to make it SAS file.

 

I go to SAS then import the file. it forces me to save it as work file. but I can't open it after.

I am used to xxx.file name. How to do this? thanks in advance   

 

 

Astounding
PROC Star

This has absolutely nothing to do with your original question.

 

Is your first question already answered?

 

You still need to provide details.  How are you trying to import the file?  Is there a log?

wagdy
Obsidian | Level 7

1. re 1st question: sorry. the 1st question has not been answered. you asked me to send more info. & I did via email last night.

 

2. re second question: I highlight the excel file & after saving it as exclpdf. I go to sas & try to import it. the problem is I can not save it as XXX.FILENAME.

 

please excuse my ignorance with SAS I used it while doing my master & PH.D more that 30 years ago. I am trying to help some one else using my data/.  appreciate your help. 

andreas_lds
Jade | Level 19

@wagdy wrote:

how to change variable name from q1a to q1 without affeting my data


Use proc datasets or proc sql with alter table.

wagdy
Obsidian | Level 7
Thanks. What would be the command I use?

PaigeMiller
Diamond | Level 26

@wagdy, please update the title of this thread to something meaningful.

--
Paige Miller
wagdy
Obsidian | Level 7
Thanks. Not sure what you mean
PaigeMiller
Diamond | Level 26

Surely you understand that a title of "Please Help" is not meaningful, that a title that actually describes the problem would be more meaningful. Click on the Gear icon next to your original post, select Edit Message, and then provide a meaningful title that actually (and succinctly) describes the problem.

--
Paige Miller
wagdy
Obsidian | Level 7

thanks for your response.

my question is: how to change variable name from q1a to q1 without affeting my data. regards

PaigeMiller
Diamond | Level 26

You need to change the title on your ORIGINAL post in this thread to something meaningful.

--
Paige Miller
wagdy
Obsidian | Level 7
Thanks. I just did.
PaigeMiller
Diamond | Level 26

@andreas_lds wrote:

@wagdy wrote:

how to change variable name from q1a to q1 without affeting my data


Use proc datasets or proc sql with alter table.


 

proc datasets library=work nolist;
    modify datasetname;
    rename q1a=q1;
run; quit;

If your dataset is in some other library than WORK, then use the library name instead of WORK. Also, you have to use your actual data set name instead of where I used datasetname.

--
Paige Miller
wagdy
Obsidian | Level 7

many thanks for your help. The problem is solved

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 15 replies
  • 3388 views
  • 3 likes
  • 4 in conversation