LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (September 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 15 Sep 2003 10:00:35 -0400
Reply-To:     "Elmaache, Hamani" <Hamani.Elmaache@CCRA-ADRC.GC.CA>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Elmaache, Hamani" <Hamani.Elmaache@CCRA-ADRC.GC.CA>
Subject:      What's wrong with this code?
Content-Type: text/plain; charset="iso-8859-1"

Hi there.

I have a data set like these:

year date end

1994 24JAN94 30JAN94 1994 31JAN94 06FEB94 1994 07FEB94 13FEB94 1994 14FEB94 20FEB94 1994 21FEB94 27FEB94 1994 28FEB94 06MAR94 1994 07MAR94 13MAR94 1994 14MAR94 20MAR94 1994 21MAR94 27MAR94 1994 28MAR94 03APR94 1994 04APR94 10APR94 1994 11APR94 17APR94 1994 18APR94 24APR94 1994 25APR94 01MAY94 1994 02MAY94 08MAY94 1994 09MAY94 15MAY94 1995 30JAN95 05FEB95 1995 06FEB95 12FEB95 1995 13FEB95 19FEB95 1995 20FEB95 26FEB95 1995 27FEB95 05MAR95 1995 06MAR95 12MAR95 1995 13MAR95 19MAR95 1995 20MAR95 26MAR95 1995 27MAR95 02APR95 1995 03APR95 09APR95 1995 10APR95 16APR95 1995 17APR95 23APR95 ;

I want to get the first operation per month and year for the variable date and the same thing for the variable end. I wrote the following code, but it doesn't work. No error message in log.

Here my code:

data a; set a ; montstar=month(date); montend=month(end); daystar=day(date); dayend=day(end); run; proc sort data=a out=aa; by year montend montstar;

data aa; set aa; by year montend montstar; firststar=first.montstar ; firstend=first.montend ; laststar=last.montstar ; lastend=last.montend ;

proc sort data=aa ; by year week; run;

can somebady see why? Thanks a lot.


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