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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.