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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 459 views
  • 0 likes
  • 1 in conversation