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 (July 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 1 Jul 2009 11:49:17 -0700
Reply-To:     "Schwarz, Barry A" <>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Schwarz, Barry A" <>
Subject:      Re: expanding a range into values with a flag
In-Reply-To:  <>
Content-Type: text/plain; charset="us-ascii"

In a data step read an observation loop from f2 to f3 output id, loop value, f4, f5, and f6 end loop

-----Original Message----- From: chumba Sent: Wednesday, July 01, 2009 2:18 AM To: SAS-L@LISTSERV.UGA.EDU Subject: expanding a range into values with a flag

Hi All,

Here is my problem,

I have got an excel file with data like following,

id F2 F3 F4 F5 F6 aaa 1 200 2530 timbuktu A aaa 201 400 2500 jhumri taliya F aaa 401 600 2110 mount abu C aaa 1000 1999 1010 majnu ka tila X aaa 3000 3999 1200 haldwani F aaa 4000 4999 1310 capo W aaa 9000 9999 7700 teemu G aaa 10000 10250 2530 haifa A aaa 10251 10500 2500 chores T

Now, F2 and F3 are low and high limits of a range, ie. for range 1- 200, F4, F5 and F6 have certain values, in this case '2530', 'timbuktu' and 'A'.

I need to expand the range 1 - 200 into vertical values 1,2,3,4,5,6,.....200 and have '2530', 'timbuktu' and 'A' values for F4,F5 & F6 for all values 1 to 200.

I need to have the same kind of thing for the rest of the ranges like 401-600, etc.

Now I know I would need some kind of looping for this, but my main glitch for this is that the rnage differences are not uniform.

Can anyone please take out the time for this ridiculous problem, hahahaha

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