03-20-2013 05:16 PM
Hi guys i am using sas eg 5.1 and i have one dataset name "data1" (50 obs), in "data1" have one variable name "empname" and all values for "empname" are in lower case. I want to change both variable name "empname" and all values in upcase. how can i do that?
03-21-2013 09:13 AM
Hi Linlin, i got one issue in my dataset. your code works perfect but i have more than one empname value in dataset. what i need to change for that?
03-21-2013 03:23 PM
Mention what 50 times? ABC or the upcase function?
Note LinLin's code thoroughly. She first imports the data AS IS. A second datastep converts the empname to upcase, and a second dataset is created.
03-21-2013 04:44 PM
It's time for a break. You've been working too hard.
If you wanted to assign X=1, you would just add the statement:
You wouldn't have to add it 50 times, just because you have 50 observations in your data set. Similarly, you could code:
empname = upcase(empname);
It changes EMPNAME for every observation in your data set. You don't need to know how many observations you have, or what the values of EMPNAME are. The statement just executes for every observation.
Need further help from the community? Please ask a new question.