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

what is the function of catx syntax? : Sas-administrator

0 Answers  


how do you pull data from equifax?tell me the process?

0 Answers   Synchrony Financial,


How do you convert basic cube to transaction cube and transaction cube to basic cube?

0 Answers  


If you have a data set that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variable?

16 Answers  


How to write duplicate records into a separate dataset using sort?

4 Answers   HSBC,






is there any difference between proc summary and proc means?

3 Answers  


There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it?

5 Answers  


Explain substr function?

0 Answers  


How do dates work in SAS data?

0 Answers  


when we are using the PROC TRANSPOSE? OBSERVATIONS are repeated then what will happen and what it will show in log window.

1 Answers  


What is the difference between %local and %global?

1 Answers  


How do you download a flat file from Mainframe to your local PC using SAS?

3 Answers  


Categories