From: Tom Abernathy on 5 Apr 2010 16:35 On Mar 30, 7:04 am, Patrick <patrick.mat...(a)gmx.ch> wrote: > Hi Chua > > I believe your union statement would need some adjustments for doing > what you want it to do... > > Alternatively you could use a data step like below. Besides of > performance this will also be more convenient to code the more > elements you have (in comparison to a SQL UNION). > > data want(drop=i); > set have; > array date {*} date1-date3; > array code {*} code1-code3; > do i=1 to dim(date); > date=date{i}; > code=code{i}; > output; > end; > run; > > HTH > Patrick Minor corrections. You cannot use the dame name for both the array of the old variables and the new variable you are trying to create. You could change the array names to _DATE and _TIME. Also you might want to drop the original variables.
First
|
Prev
|
Pages: 1 2 Prev: Is there a format to print time values with leading zeros? Next: Location Intelligence demo |