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 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
=========================================================================
Date:         Fri, 19 Jul 2002 10:26:19 -0400
Reply-To:     Charles Patridge <Charles_S_Patridge@PRODIGY.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Charles Patridge <Charles_S_Patridge@PRODIGY.NET>
Subject:      Re: combine two variables
Comments: To: sewalem@CDN.CA

Dear Asheber,

Try this tested code (using SAS v6.12 on OpenVMS):

data test; infile cards missover; input id var1 var2 var3 ; cards; 168 19911003 31121991 . 168 19930428 30061993 . 168 19940620 . 30061994 168 19950520 30061995 . 168 19971128 31121997 30061998 168 19981001 31121998 30061999 ;;;; run;

data newfile (keep=id var1 newvar); set test; array myvars var2-var3; do i = 1 to dim(myvars); if myvars(i) ne . then do; newvar = myvars(i); output newfile; end; end; run;

HTH, Charles Patridge Email: Charles_S_Patridge@prodigy.net

PS, I am sure there will be a few other ways and suggestions from other SAS-


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