input cus mon$ emi;
1 jan 20
2 jan 10
3 jan 20
1 feb 20
2 feb 20
3 feb 10
1 mar 20
2 mar 20
3 mar 20
i want the no of customers paying the emi same amount in the months jan,feb and mar in this Dataset cusomer 1 is paying the same emi in all the three months like this i want the count of .No of customers paying the same amount in all the three months .
I am having 30,000 obs i sholud find this from that obs
One suggestion is that you appear to be working with "character string" date-related data values (without a year supplied in the input) -- convert these to SAS numeric DATE type variables using the INPUT function in a SAS assignment statement - a DATA step approach likely, possibly assigning the current year using the YEAR( TODAY() ) functions. Then you can use the MONTH() if you need to reference one or more months as a logical group in your IF / THEN variable assignment logic.
The SAS support http://support.sas.com/ website has a wealth of SAS-hosted product documentation and also technical / conference contributed papers on these type of topics - some links pasted below for your reference and use:
since the chain is over only 3 months, it seems OK just to merge the 3 separate months and, if the amounts (emi) are the same, create a counter[pre]data counting( keep= cus emi1 ) ;
merge cus_mon( in=jan rename=( mon= mon1 emi= emi1 ) where=( mon1= 'jan'))
cus_mon( in=feb rename=( mon= mon2 emi= emi2 ) where=( mon2= 'feb'))
cus_mon( in=mar rename=( mon= mon3 emi= emi3 ) where=( mon3= 'mar') )
by cus ;
if jan and feb and mar and
emi1= emi2 and emi2=emi3 then output ;
proc print ;
run ; [/pre]
The count is the number of observations output to table COUNTING.