BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ccaudillo100
Obsidian | Level 7

Hello, I am trying to take a table from looking like this 

Name  Year
Christina 2011
Christina 2012
Christina 2013
Christina 2015
Christina 2020
Chris 2015
Chris 2016
Luna 2001
Luna 2023
Luna 2021
Luna 2013
Luna 2010

 

to this 

Name  Year Start Year Last Year
Christina 2011 2011 2020
Christina 2012 2011 2020
Christina 2013 2011 2020
Christina 2015 2011 2020
Christina 2020 2011 2020
Chris 2015 2015 2016
Chris 2016 2015 2016
Luna 2001 2001 2023
Luna 2023 2001 2023
Luna 2021 2001 2023
Luna 2013 2001 2023
Luna 2010 2001 2023

using SAS. Any code advice is appreciated.

 

 

Any provided methods will be used on 60K+ lines of data. Not posting that information here for privacy Reasons.

 

Names are in Character Format and Years are in Numeric Format

1 ACCEPTED SOLUTION

Accepted Solutions
ccaudillo100
Obsidian | Level 7

proc summary data=Have nway ;
class Name;
var Year;
output out=Want min(Year)=Start Year max(Year)=LastYear;
run;

View solution in original post

1 REPLY 1
ccaudillo100
Obsidian | Level 7

proc summary data=Have nway ;
class Name;
var Year;
output out=Want min(Year)=Start Year max(Year)=LastYear;
run;

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
  • 204 views
  • 0 likes
  • 1 in conversation