Skip to content
Advertisement

SAS-Append data to a table and increment a flag on the resultant table

I have two tables on SAS “Table_A” and “Table_A_Archive”, as part my ETL process “Table_A” is created on a daily basis and the data should be archived on “Table_A_Archive”. When the data is archived on “Table_A_Archive” a a flag will be created/updated “DT_FLAG”.

On the first day this is how the table would look like

On Day 2

The new data should be loaded with the DT_FLAG of 1 and old records DT_FLAG should be incremented by 1. Load_Date is the pivotal point. I have written a SAS code but it seems a bit messy, can someone please help me with a SAS Datastep

Advertisement

Answer

I tried solving it by this method.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement