BookmarkSubscribeRSS Feed
Sasuser52
Fluorite | Level 6

Dear SAS-Community,

 

is there a way to sort a data set and preserve the audit trail?

 

Proc Sort replaces the data set and does not preserve the audit trail.

 

Thank you!

2 REPLIES 2
s_lassen
Meteorite | Level 14

I do not think there is. But you could try putting an index on the table instead, e.g.:

/* This does not work. Audit trail will be dropped:
proc sort data=audited;
  by ID Date;
run;
*/

proc sql;
  create index idx on audited(ID,Date);
quit;

You should then be able to read the data set BY ID DATE. It may run more slowly, but if the table is not too big, that should not be a problem.

 

PS: Not tested, just a suggestion to try.

Sasuser52
Fluorite | Level 6

Thank you for your answer 🍓. Your answer might help somebody, but for me this is not what I am looking for.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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 lock in 2025 pricing—just $495!

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
  • 918 views
  • 0 likes
  • 2 in conversation