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

Hello All,

I was trying to create an output for the dataset

ID Date     Plan

1 jan2013   a

1 feb2013   a

1 mar2013   a

1 may2013   b

1 jun2013    b

1 jul2013     a

1 aug2013    a 

 

the output i'm looking to get is  ID    Plan     Date_range

                                              1      a          1-3

                                              2      b          5-6

                                              3       a          7-8

Thanks. Looking forward to some responses.

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

You can format the min and max into date range yourself right?

data date;
   input ID Date:monyy.  Plan :$1.;
  
format date monyy.;
  
cards;
1 jan2013   a
1 feb2013   a
1 mar2013   a
1 may2013   b
1 jun2013   b
1 jul2013   a
1 aug2013   a
;;;;
   run;
proc print;
  
run;
proc summary data=date nway;
  
by id plan notsorted;
  
format date mmyy.;
  
output out=range min(date)=min max(date)=max;
  
run;
proc print;
  
run;

2-19-2015 4-50-14 PM.png

View solution in original post

2 REPLIES 2
data_null__
Jade | Level 19

You can format the min and max into date range yourself right?

data date;
   input ID Date:monyy.  Plan :$1.;
  
format date monyy.;
  
cards;
1 jan2013   a
1 feb2013   a
1 mar2013   a
1 may2013   b
1 jun2013   b
1 jul2013   a
1 aug2013   a
;;;;
   run;
proc print;
  
run;
proc summary data=date nway;
  
by id plan notsorted;
  
format date mmyy.;
  
output out=range min(date)=min max(date)=max;
  
run;
proc print;
  
run;

2-19-2015 4-50-14 PM.png
SASTad
Fluorite | Level 6

Thank you so much for the help.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 815 views
  • 0 likes
  • 2 in conversation