SAS dates

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

SAS dates

i have  dataset like this

Webinar  Startdates     date

A          01july2015      07July2015

B          31may2015    07July2015

C1        03july2015     07July2015

C2        30Feb2015     07July2015

C3        01May2015     07July2015

my required dataset is

Webinar Startdates       date               Dates             Number

A          01july2015      07July2015      01july2015       1

                                                        02july2015        2

                                                        03july2015         3

                                                        04july2015         4

                                                        05july2015           5

                                                         06july2015          6

                                                         07July2015         7

B          31may2015    07July2015      31may2015      1

                                                         01july2015       2

                                                         02july2015       3

                                                         03july2015        4

                                                         04july2015        5

                                                         05july2015       6

                                                          06july2015       7

                                                           07July2015     8


C1        03july2015       07July2015       03july2015     1

                                                          04july2015      2

                                                          05july2015       3

                                                          06july2015       4

                                                          07July2015      5

C2          05Jul2015      07July2015

                                                          06july2015     1

                                                          07July2015    2

C3        30May2015     07July2015      30May2015    1

                                                        31may2015    2

                                                         01july2015    3

                                                         02july2015     4

                                                         03july2015     5

                                                         04july2015     6

                                                         05july2015     7

                                                          06july2015     8

                                                           07July2015   9


Help me.Thanks in Advance.


Accepted Solutions
Solution
‎07-15-2015 11:21 AM
Super User
Posts: 11,144

Re: SAS dates

Assuming your start and end dates are SAS date valued variables:

data want;

     set have;

     number=0;

     do dates = Startdates to date;

          number + 1;

          output;

     end;

run;

View solution in original post


All Replies
Super User
Posts: 5,391

Re: SAS dates

Just a do loop with explicit output.

Data never sleeps
Solution
‎07-15-2015 11:21 AM
Super User
Posts: 11,144

Re: SAS dates

Assuming your start and end dates are SAS date valued variables:

data want;

     set have;

     number=0;

     do dates = Startdates to date;

          number + 1;

          output;

     end;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 181 views
  • 0 likes
  • 3 in conversation