BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ghildebrand
Calcite | Level 5

I'm using a database where the current tables only hold 6 months of data before moving to an archive table. I'm pulling from a current table, and would like to keep the older data while adding new data.

 

For example, the current table holds data from 9/24/19 to 3/24/20. I'd like to pull all of that today. When I pull the data again on 4/24/20, I'd like to have all the data from 9/24/19 to 4/24/20. What is the best way to keep the old data that I've already pulled, and add the current/new data from the current table?

1 ACCEPTED SOLUTION

Accepted Solutions
DavePrinsloo
Pyrite | Level 9

It would probably  be  best to keep the data in a partitioned form.   I.e . You would have a different  physical table per month.   This allows you to drop the oldest each month without touching the  other 11 months.   Then create new table as an extract of the last month.   Alternatively,  you can keep a copy of the last 6 months of the archive in monthly  parts  and append them to a current extract of the active data.

View solution in original post

2 REPLIES 2
DavePrinsloo
Pyrite | Level 9

It would probably  be  best to keep the data in a partitioned form.   I.e . You would have a different  physical table per month.   This allows you to drop the oldest each month without touching the  other 11 months.   Then create new table as an extract of the last month.   Alternatively,  you can keep a copy of the last 6 months of the archive in monthly  parts  and append them to a current extract of the active data.

ghildebrand
Calcite | Level 5
Thank you!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1019 views
  • 1 like
  • 2 in conversation