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 (April 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 21 Apr 2010 09:07:52 -0700
Reply-To:     mlhoward@avalon.net
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mary <mlhoward@AVALON.NET>
Subject:      Re: Filling in Gaps?
Comments: To: Joe Matise <snoopy369@gmail.com>
Content-Type: text/plain; charset="UTF-8"

Joe,

Yes, it is straighforward- just didn't do my example that well. Here it is again-

data test2; infile cards missover; input id day1 day2 day3 day4 day5 day6 day7 day8 day9 day10 day11 day12; cards; 001 1 1 1 1 2 2 . . . . 1 1 002 2 2 2 . 1 . . . . . 1 . ; run;

These are the number of pills someone has on hand each day. What I want is to fill in the gaps with the extra pills on hand, so I want a result like this:

001 1 1 1 1 1 1 1 1 . . 1 1 002 1 1 1 1 1 1 . . . . 1 .

Ideas would be appreciated; I'd like to keep this wide rather than transpose it long if possible.

-Mary

--- snoopy369@gmail.com wrote:

From: Joe Matise <snoopy369@gmail.com> To: mlhoward@avalon.net Cc: SAS-L@listserv.uga.edu Subject: Re: Filling in Gaps? Date: Wed, 21 Apr 2010 11:04:30 -0500

Mary, just so I understand, can you take a quick look at the data you posted? I see twelve days not ten, and I don't understand how you decided to fill in some gaps and not others on ID #2 (it looks like you have at least one extra pill). Is this a straightforward 'fill forward' problem, or is there anything else going on?

Thanks,

Joe

On Wed, Apr 21, 2010 at 11:10 AM, Mary <mlhoward@avalon.net> wrote:

> Hi, > > I've got a data set like this: > > data test2; > infile cards missover; > input id day1 day2 day3 day4 day5 day6 day7 day8 day9 day10; > cards; > 001 1 1 1 1 2 2 . . . . 1 1 > 002 2 2 2 . 1 . . . . . 1 . > ; > run; > > These are the number of pills someone has on hand each day. What I want is > to fill in the gaps with the extra pills on hand, so I want a result like > this: > > 001 1 1 1 1 1 1 1 1 . . 1 1 > 002 1 1 1 1 1 1 . . . . 1 . > > Ideas would be appreciated; I'd like to keep this wide rather than > transpose it long if possible. > > -Mary >


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