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?

Answers were Sorted based on User's Feedback



i have a dataset with 25 obs; 10th obs has like ramu,anji,ramu,azad,ramu like this. i want to know..

Answer / alok karan

data repeat;
x="ramu anji ramu azad ramu";
y=count(x,"ramu");
run;
proc print data=repeat;
run;

Is This Answer Correct ?    2 Yes 1 No

i have a dataset with 25 obs; 10th obs has like ramu,anji,ramu,azad,ramu like this. i want to know..

Answer / 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

i have a dataset with 25 obs; 10th obs has like ramu,anji,ramu,azad,ramu like this. i want to know..

Answer / vivek

Data DS;
INFILE datalines;
input name $;
datalines;
ram
sham
seema
amit
sham
sushil
amit
seema
ravi
run;

proc freq data = ds;
table name;
output out =dsfrq;
run;

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More SAS Interview Questions

How would you create multiple observations from a single observation?

1 Answers   Quintiles,


How would you include common or reuse to be processed along with your statements?

0 Answers  


i have a null dataset with 10 variables; i want to print only name of the varibales in log window and also output window.how can we do this one?

6 Answers   GSK,


create macros---you have 365 number of data and you need to merge it throw the macros,,,,,, data file1; input a @@; cards; 1 2 3 4 ; run; data file2; input a @@; cards; 5 6 7 8 ; run; data file3; input a @@; cards; 9 10 11 12 ; run;data file4; input a @@; cards; 13 14 15 16 ; run;

6 Answers   WNS,


what versions of sas have you used (on which platforms)? : Sas programming

0 Answers  






Difference b/n proc means and proc summary procedures?

3 Answers   Accenture,


How to create list output for cross-tabulations in proc freq?

0 Answers  


What is instream data in SAS?

1 Answers  


explain what is factor analysis? : Sas-administrator

0 Answers  


What would be the value of month at the end of data step execution and how many observations would be there?

0 Answers  


Explain input and put function?

0 Answers  


what do the sas log messages "numeric values have been converted to character" mean? What are the implications? : Sas programming

0 Answers  


Categories