Date: Thu, 11 Sep 2003 08:50:58 -0700
Reply-To: James Green <jamesgreen55@YAHOO.CA>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: James Green <jamesgreen55@YAHOO.CA>
Organization: http://groups.google.com/
Subject: Help with Exclude Weekend dates
Content-Type: text/plain; charset=ISO-8859-1
Hi; TIA;
I need to count an on-time delivery for each purchase order we
process. The calculation is simply the Number of Deliveries which
arrived On-time / the total number of deliveries. (On time= 3 Days
Early is okay but greater than 3 days early is not, late of course is
not okay).
I have recently been asked to exclude weekends. Though they are okay
with Holidays etc.. any ideas on how to tweak the code below so that
weekends are not included in the AGE calculation?
data TEST;
input PO $1-4 QTY_RECEIVED $6-7 DATE_D $9-16 DATE_R $18-25;
cards;
A111 50 09/05/03 09/06/03
A222 30 09/12/03 09/12/03
A333 25 09/12/03 09/10/03
A444 42 09/22/03 09/25/03
A555 64 09/18/03 09/10/03
A666 29 09/15/03 09/14/03
A777 18 09/13/03 09/10/03
A888 44 09/29/03 09/30/03
A999 78 09/22/03 09/20/03
;
run;
DATA PROCESS/*(drop=DATE_D DATE_R)*/; set test;
DUE_DATE=input(DATE_D, mmddyy8.);
RECEIVED_DATE=input(DATE_R, mmddyy8.);
AGE=RECEIVED_DATE-DUE_DATE;
if AGE <=0 and AGE >=-3 then ONTIME=1;
else ONTIME=0;
format DUE_DATE date9.;
format RECEIVED_DATE date9.;
run;