Help using Base SAS procedures

REg:COunt

Reply
Regular Contributor
Posts: 229

REg:COunt

HI

I AM HAVING DATASET BY NAME INTIAL IT IS HAVING 10 OBS AND IT WAS SPLITTED IN TO TWO

DATASETS S1,S2 WITH 5 OBS EACH AND AFTER THAT I HAVE MADE SOME AGGREATIONS AND CREATED T1

AND T2 DATASET HAVING 5 OBS EACH NOW I WNAT THE COUNT OF EACH DATASETS AND COUNT OF S1 AND

S2 IN TO ONE VARIABLE AND EACH DATASET COUNT OF OBSE IN TO ANOTHER VARIABLE AND TARGET

VARIABLES COUNT AND INDIVIDUAL COUNT IN TO ANOTHER VARIABLE .IF I AM NOT CLEAR I HAVE GIVEN

THE EXAMPLE BELOW ,PLEASE HELP ME OUT.


OUTPUT:

INI_DSETNAME INTIAL_COUNT_OBS S_DS_NAME S1&S2COUNT S1&S2SUM T_DSNAME T1&T2COUNT T1&T2SUM
FINAL 10 S1 5 10 T1 5 10
FINAL 10 S2 5 10 T2 5 10
Super Contributor
Super Contributor
Posts: 3,174

Re: REg:COunt

Though your input data is not revealed, look at using PROC SUMMARY and then use PROC TRANSPOSE.

Scott Barry
SBBWorks, Inc.
Super User
Posts: 9,676

Re: REg:COunt

I think sql dictionary table ( dictionary.tables ) will help you;
proc sql;
select memname,nobs
from dictionary.tables
where libname='WORK';
quit;


Ksharp
Ask a Question
Discussion stats
  • 2 replies
  • 148 views
  • 0 likes
  • 3 in conversation