Hi there,
I have a dataset with 1 line per ID with one relevant date per ID.
I have transformed the dates into numeric format using 'date_as_num = putn(date,'yymmddn8.');'.
The date range is 1 January 2018 (i.e. 20180101) to 31 December 2020 (20201231).
I now need to convert these dates into consecutive numbers starting at 1 with 1 January 2018 being 1, 2 January being 2 and so forth.
I'm using SAS version 9.4.
I don't know how to do this. Can anyone help?
Thank you very much!
Julia
Thank you so much, this worked well.
I totally agree, that understanding dates in SAS is worthwhile. I
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.