LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 27 Oct 2008 07:22:08 -0500
Reply-To:     "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Subject:      Re: Numbering missing visits
Comments: To: franz_cl2003@yahoo.fr
In-Reply-To:  <695167.82144.qm@web25606.mail.ukl.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1

data visit; input pt:$1 visdat:date. visitid :$1.; format visdat date.; cards; 1 12JAN2008 1 . 1 20JAN2008 2 . 1 03FEB2008 M 1 1 15FEB2008 M 2 2 03JAN2008 1 . 2 27JAN2008 M 1 2 12FEB2008 2 . 2 25FEB2008 3 . 2 12MAR2008 M 1 2 28MAR2008 M 2 2 19APR2008 M 3 ;;;; run; proc sort data=visit; by pt visdat; run; data visit; call missing(count); do until(last.visitID); set work.visit; by pt visitID notsorted; if visitID eq 'M' then count + 1; output; end; run; proc print; run; On 10/27/08, Franz <franz_cl2003@yahoo.fr> wrote: > Dear all, > > How do I count the consecutive missing visitid (M) per PT and get the expected counts below? > > pt visdat visitid count (expected) > 1 12JAN2008 1 . > 1 20JAN2008 2 . > 1 03FEB2008 M 1 > 1 15FEB2008 M 2 > 2 03JAN2008 1 . > 2 27JAN2008 M 1 > 2 12FEB2008 2 . > 2 25FEB2008 3 . > 2 12MAR2008 M 1 > 2 28MAR2008 M 2 > 2 19APR2008 M 3 > > Many thanks & Kind regards, > Franz >


Back to: Top of message | Previous page | Main SAS-L page