Hi,
I have a set of code. After I run it, I get one result. Which is the correct result. I come back the next day, I run the code, I didn't get anything and I have to use the break command to stop the program. It give me a message saying procedure in progress. So I restarted the computer and I...
I have to write it using SQL to get the result I wanted.
proc sql;
create table no_duplicates as
select count(*) as total, Letter
from mydata
group by Letter
having total < 2;
I guess I was looking for a function that can do this. The SAS nodup in proc sort doesn't do it. It works almost like...
Wow! I can't believe how hard this is with SAS. How do you remove all duplicated rows?
For example, if I have the following data set:
OBS Letter
1 A
2 A
3 A
4 B
5 C
6 D
I want a data set that removes all the As. Like the following:
OBS Letter
1...
hm...I can hardly understand your code kdt82. I need to read more SAS books. I wish I can be 1/2 as good as you guys in SAS.
Thanks for the solution smalek. Now I got a better idea in using retain statement.
Can you please let me know the solution using a retain statement or a more efficient way of doing this? Because the way I did it only works but in a very inefficient way. If you need the result, the code I put above, you only need 9 lines of it. If you have the raw data available, all you need...
Hi, this is my first post in answering a question. My solution works but it is not every efficient. I tried to find materials on retain but I didn't find anything good on it. I think juanvg is right, retain should work better. There should be a more efficient way of making this work. If you got...
Wow! Thanks for taking the time guys! I really appreciate the inputs. But you guys can ignore this thread now. I don't think the objective is possible to do. It didn't make sense logically. Instead of using a merge, the solution was to use a set statement instead. Thanks again for the time and help!
Yeah. I just got an email. I think I am suppose to do a set not a merge. The instructions weren't clear. But the question still exists. Is it possible to merge 4 different data sets into 1 master data set without replacing any values if the variables are the same? It is not possible right?
Data...
Sorry guys. I should had made things clear. I am not suppose to rename variables. Actually, I am required to change all the different variables in different data sets into one common variable. If hours is called HR in data set A, and HRs in data set B, Hour in C, and Hours in ABC, and for the...
dblan:
There are about 20 variables total. 8 out of the 20 variables are common variables, like age, hours, etc. I am not suppose to change variable names. My objective is to create a master file that combine all 4 data sets into a master data set. But with merge, new values will overwrite old...
Ok, let me explain again to see if I have this right. Data set A, B, and C are data from 2001, 2002, and 2003 respectively. Data set D is all background information data. I guess I should use set instead of merge on data set A, B, and C first right? And then merge them with D?
Data ABC;
set A...
Hi,
I have a task that requires me to merge 4 different data sets. Names of the data sets are A, B, C and D. They all have a common variable ID, age, hours, lname, fname. They each got their own unique variables such as uniqueA, uniqueB, etc. The objective of the task is to merge all 4 data...
Problem solved!
I used the trim() function before I concatanated the 2 variables. That take cares of the space problem.
Now my problem is how do I remove a thread that I posted myself?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.