```Date: Thu, 21 Nov 1996 16:38:20 -0500 Reply-To: Ismail Parsa x6734 Sender: "SAS(r) Discussion" From: Ismail Parsa x6734 Subject: Re: DATES |> |> Hi |> I have a dataset with 4 variables........which I can make numeric or |> character..depending on how easy isto solve theproblem I have... |> |> I have month1 with values a la "mm" and year1 with values |> a la "yy".......simply a variable for month and another one for |> year... |> ie: month1 = 05 and year1 = 89; |> |> I also have 2 other variables month2 and year2 with similar type of |> values... |> |> The user wants me to give him a report of the time elapsed between |> month1 year1 and month2 year2 in MONTHS....... |> |> the application was written sometime ago..and I can modify that.... |> all i have is an ASCII file with those values.... |> |> Can someone give me some idea on how to code the date |> calculation? |> I can make the values numeric or charcters to simplify the |> calcuation. |> |> I will appreciate any assistance with this... |> Paul: I have a little macro that calculates the difference of two dates in months when these two dates are in YYMM format. /* difference of 2 dates that are in the form YYMM */ %macro diffyymm (date1 = , date2 = , diffyymm = ) ; &diffyymm = ( 12 * int(&date1/100) + mod(&date1,100) ) - ( 12 * int(&date2/100) + mod(&date2,100) ) ; %mend diffyymm ; Regards. *-----------------------------* | Ismail Parsa | | Epsilon Data Management | | 50 Cambridge Street | | Burlington MA 01803 USA | | | | E-MAIL: sip@epsilon.com | | V-MAIL: (617) 273-0250*6734 | | FAX: (617) 272-8604 | | | | The Usual Caveat Applies | *-----------------------------* ```

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