BookmarkSubscribeRSS Feed
nisha_a
Calcite | Level 5
I have records as follows:

Subject startdt. enddt dur
01 01jan2019 01jan2019 1
01 02jan2019 02jan2019 1
01 03jan2019 03jan2019 1
01 05jan2019 05jan2019 1

I want the records with consecutive dates, that is from 1jan to 3jan be collapsed as 1 record and the dur value should be 3. Also the 5jan record should be left as is Because the date is not a consecutive date.
1 REPLY 1
PaigeMiller
Diamond | Level 26

A couple of questions:

 

  • does subject play any role in the calculations or analysis? If so, how?
  • can start date and end date be different?

If you answer YES to any of these, can you provide a more realistic example of the data?


Also: 
when you say "Because the date is not a consecutive date" what date are you referring to, start date or enddate? 

 

Also: can you please provide working SAS code to read in your example data into a SAS data set?

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 507 views
  • 0 likes
  • 2 in conversation