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 (January 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 18 Jan 2010 09:46:17 -0500
Reply-To:     saslearn chicago <sasswamy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         saslearn chicago <sasswamy@GMAIL.COM>
Subject:      Fwd: PREPORT - Date / Week
In-Reply-To:  <201001152022.o0FHgMWg001175@malibu.cc.uga.edu>
Content-Type: text/plain; charset=windows-1252

PLEASE Disacard this email , I have found a way for this Report, thx and sorry for the confusion,

- swamy ---------- Forwarded message ---------- From: SAS Swamy <sasswamy@gmail.com> Date: Fri, Jan 15, 2010 at 3:22 PM Subject: PREPORT - Date / Week To: SAS-L@listserv.uga.edu Cc: SAS Swamy <sasswamy@gmail.com>

Hello everyone, I need suggestion in the following report :

Week Rec Cum rec Tot Rec Cum Percent 0 3 3 3 100%

0 3 3 7 43% 1 4 7 7 100%

0 3 3 12 30% 1 4 7 12 60% 2 5 12 12 100%

0 3 3 18 10% 1 4 7 18 20% 2 5 12 18 60% 3 6 18 18 100%

I will be calculating the Week (2nd column), based on 2 date fields for each rows from the Input file , I would apply rule date2 – date1 / 7 to arrive the week nbr, later group by week , So I will be getting one row for one Week number, Let say , we are working on a date 01/01/2005 , week 0 will be 01/01/2005 – 01/07/2005 week 1 will be 01/01/2005 – 01/08/2005

Based on the above report , you eventually will be having only 4 rows after grouping , Week 0 , 1 , 2 ,3

The challenge is to stack with different break up’s 0 , 0 & 1 , 0 & 1 & 2 … etc

What would be the best way for this report , I have not used PROC report yet in SAS ? here is the steps I am working on , ( may be correct , but longer )

I will group the Week 0 to a data set week_0 , then group the week 1 to a data set week_1 , this way I would have week_0 ….week_12 ( or whatever the max week calculated by above formula ) Then combined based on a loop variable for the counter AND data sets name , for the first break up will set week_0 , for the 2nd break up I would set week_0 , week_1 In the 2nd break up , since the week_1 will have the different cumulative record count as of Week_1 , I need to replace with the cumulative record count of week_0 to match both. same way 3rd break up I would take the cumulative count from week_2 and replace for week_0 and week_1 …

Any suggestion , Idea for better logic ,Please Advice

- Swamy


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