BookmarkSubscribeRSS Feed
Sasuser52
Fluorite | Level 6

Dear SAS-Community,

 

is there a way to rearrange the variables in a data set and preserve the audit trail?

 

data test;

    retain var1 var2;

    set test;

run;

==> audit trail is lost

 

data test;

    retain var1 var2;

    modify test;

run;

==> audit trail is preserved, but variables are not rearranged

 

Thank you!

2 REPLIES 2
Quentin
Super User

Hmm, interesting question.  I wouldn't think so, since changing variable order requires re-writing the dataset (i.e. re-creating it).  And I think when you create a dataset, it gets a fresh audit trail.  Don't know if there is any way to copy an audit trail and somehow apply it to a different dataset.

 

For just re-ordering, you might be better off just creating a view that people could use, with desired variable order.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
Sasuser52
Fluorite | Level 6

Thank you for your answer 🙂 . I know that the problem can be solved to some extent by using a view (sorry that I did not mention them). But, I hope there is a way to rearrange variables in the data set without losing the audit trail. It would be ok, to temporarily suspend the audit trail for the rearrangement.

 

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