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 (August 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 9 Aug 2005 13:18:14 -0400
Reply-To:     Eric Yount <eric.yount@RTP.PPDI.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Eric Yount <eric.yount@RTP.PPDI.COM>
Organization: PPD
Subject:      Re: SAS Data Step Qn.
Comments: To: Jeff Morison <jmt_mtf@YAHOO.COM>
In-Reply-To:  <20050809170843.46310.qmail@web54601.mail.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Jeff,

Is this what you're looking for?

data a; informat cdate date7.; input HRN CDATE STAGE start stop; cards; 609 21JUL03 2 307 503 609 07APR04 3 307 503 609 29MAR05 1 307 503 ; run;

data b; set a; do mm = start to stop; output; end; run;

Hope this helps, Eric

Jeff Morison wrote: > Hello All: > > I have the following dataset > > HRN CDATE STAGE start stop > 609 21JUL03 2 307 503 > 609 07APR04 3 307 503 > 609 29MAR05 1 307 503 > > I need to create these additional records and a new > variable MM (year and month) and the STAGE variable > should retain its value for the year and month. > > How do I do this in Data Step. Can anyone help > please?. Thanks a bunch. > > HRN CDATE STAGE start stop mm > 609 21JUL03 2 307 503 307 > 609 21JUL03 2 307 503 308 > 609 21JUL03 2 307 503 309 > 609 21JUL03 2 307 503 310 > 609 21JUL03 2 307 503 311 > 609 21JUL03 2 307 503 312 > 609 07APR04 3 307 503 401 > 609 07APR04 3 307 503 402 > 609 07APR04 3 307 503 403 > 609 07APR04 3 307 503 404 > 609 07APR04 3 307 503 405 > 609 07APR04 3 307 503 406 > 609 07APR04 3 307 503 407 > 609 07APR04 3 307 503 408 > 609 07APR04 3 307 503 409 > 609 07APR04 3 307 503 410 > 609 07APR04 3 307 503 411 > 609 07APR04 3 307 503 412 > 609 29MAR05 1 307 503 501 > 609 29MAR05 3 307 503 502 > 609 29MAR05 3 307 503 503 > > > > > > ____________________________________________________ > Start your day with Yahoo! - make it your home page > http://www.yahoo.com/r/hs >

______________________________________________________________________ This email transmission and any documents, files or previous email messages attached to it may contain information that is confidential or legally privileged. If you are not the intended recipient or a person responsible for delivering this transmission to the intended recipient, you are hereby notified that you must not read this transmission and that any disclosure, copying, printing, distribution or use of this transmission is strictly prohibited. If you have received this transmission in error, please immediately notify the sender by telephone or return email and delete the original transmission and its attachments without reading or saving in any manner.


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