Help using Base SAS procedures

Counting obs (Update)

Reply
Super Contributor
Posts: 279

Counting obs (Update)

My previous post tells me I clearly did not have an accurate picture of my data.  Earlier, I had said I wanted to count the number of ssn in the data.  My objective was to determine the number of absences for each teacher.  My approach was short-sighted.  Consider "Smith."  It appears he was absent 4 days but this is not so.  Smith works at two different schools (Park and West)  so each school reported the absence for Jan 22 and 23.  He was only absent 2 days.  I need the count of each teacher's  ssn BY school.

Obsschoolssnlastdate
1819Fair Elementary1443Jones12SEP2014
7587Blue Elementary7369Brown25NOV2014
8661Park Elementary0976Smith22JAN2015
8662Park Elementary0976Smith23JAN2015
8665West Elementary0976Smith22JAN2015
8666West Elementary0976Smith23JAN2015
Super User
Posts: 19,770

Re: Counting obs (Update)

Proc Freq X 2

proc freq data=have noprint;

table ssn*date/out=temp;

ru;

proc freq data=temp noprint;

table ssn/out=want;

run;

Super Contributor
Posts: 279

Re: Counting obs (Update)

This code gave me the total for school = Park but there's nothing for school= West.

Super User
Posts: 19,770

Re: Counting obs (Update)

proc freq data=have noprint;

table school*ssn/out=want;

ru;

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