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!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 2 replies
  • 767 views
  • 1 like
  • 2 in conversation