BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

2 REPLIES 2
LinusH
Tourmaline | Level 20

Just a do loop with explicit output.

Data never sleeps
ballardw
Super User

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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