proc sql;
create table a
as
select
Deptno,
STATUS,
Count(AGMTNO)
from Emp_aug13_Data
group by
Deptno ,
STATUS;
quit;
Can you help me how can achive this in data step
regards,
venky
Is it necessary to use a datastep? Of course it can be done, but you could also use PROC FREQ:
PROC FREQ DATA=EMP_AUG13_DATA NOPRINT;
TABLES DEPTNO * STATUS / OUT=WANT(DROP=PERCENT) ;
RUN;
Is this an exercise? Or why else would you want to do this?
First sort your data by deptno and status, then in a data step use by group processing.
...
by deptno status;
count+1;
if last.status then
do;
output;
count=0;
end;
...
Yes I'm an sql programmer and I was moved to sas recently. The task given by team is that. I could do things and get results in sql But they are rejecting and asking me to us in data step. I'm unable to figure out the thing how to do in sas
. So I thought this is way I can learn and implement when it comes next time.
Regards,
venky.
Is it necessary to use a datastep? Of course it can be done, but you could also use PROC FREQ:
PROC FREQ DATA=EMP_AUG13_DATA NOPRINT;
TABLES DEPTNO * STATUS / OUT=WANT(DROP=PERCENT) ;
RUN;
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to explore data assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.