How to write duplicate records into a separate dataset using
sort?
Answers were Sorted based on User's Feedback
Answer / vimal
PROC SORT DATA=data_a DUPOUT=dup_data
NODUPKEY
OUT=nodup_data;
BY x;
RUN;
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / yam
First sort the data set by the key variable and then
data dup;
set indata1;
if not(first.keyvar) then output dup;
run;
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / charan araveti
if u dont want to use DUPOUT,hear is some code:
data dup(drpo temp_id);
set ds1;
retain temp_id;
if temp_id ne id then
output;
temp_id=id;
Is This Answer Correct ? | 1 Yes | 3 No |
What is the difference between proportion and average?
What do you code to create a macro? : sas-macro
What is SAS informats?
What is your favorite all time computer book? Why?
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
what is fact table and factless table?
What is the difference between Regression and Logistic Regression? Can u explain the Assumptions/Conditions?
What are the statements that are executed only?
Differences between where and if statement?
How would you code a merge that will keep only the observations that have matches from both sets?
What are the uses of sas?
How would you remove a format that has been permanently associated with a variable? ________________