i have a dataset with 25 obs; 10th obs has like
ramu,anji,ramu,azad,ramu like this. i want to know how many
times the word repeats in that obs?
Answer Posted / aarti
Data DS;
INFILE datalines;
input name $;
datalines;
ram
sham
seema
amit
sham
sushil
amit
seema
ravi
run;
proc sql;
create table rep as
select name,count(name) as cnt from ds group by 1;
quit;
proc print data=rep;
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Explain how merging helps to combine data sets.
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 are the data types in sas?
What are the uses of sas?
what does the run statement do? : Sas programming
What is the difference between where and if statement?
how to generate the test data in sas without input data? : Sas-administrator
Explain the main difference between the sas procedures and functions? : Sas-administrator
Mention what is PROC in SAS?
What is the maximum length of the macro variable? : sas-macro
What is the use of stop statement?
Describe the function and untility of the most difficult SAS macro that you have written.
Explain what is SAS informats?
What is the use of the %include statement?
explain the key concept of sas? : Sas-administrator