BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10

how to get deleted information which observation is deleted and which variable  is  deleted in a library 

 

proc sql;
delete from work.sashelp.class
where name='Alfred'
;
quit;

8 REPLIES 8
andreas_lds
Jade | Level 19

By selecting the obs with a separate select-statement before the delete-statement.

sbxkoenk
SAS Super FREQ

Ah OK, @Kurt_Bremser ,

I thought the questioner was after finding out how many and which observations were logically deleted (and NOT physically deleted).

But I guess you're program is offering what (s)he is looking for.

Cheers,

Koen

Kurt_Bremser
Super User

Since (s)he provided garbage as example (untested code that can never run), and not a "have" vs. "want" dataset, it's hard to get what the question is about.

BrahmanandaRao
Lapis Lazuli | Level 10
I want deleted information in a library
Which obs and which var deleted for each dataset
Kurt_Bremser
Super User

The deleted observations in a dataset can be found in DICTIONARY.TABLES.

To find out if a variable is not present in a dataset, you have to compare it with another dataset. The data for both can be found in DICTIONARY.COLUMNS.

ballardw
Super User

@Kurt_Bremser wrote:

The deleted number of observations in a dataset can be found in DICTIONARY.TABLES.

To find out if a variable is not present in a dataset, you have to compare it with another dataset. The data for both can be found in DICTIONARY.COLUMNS.


I believe my correction above is what was intended.

ballardw
Super User

@BrahmanandaRao wrote:
I want deleted information in a library
Which obs and which var deleted for each dataset

Will only be possible if you have a "before" and "after" data set or if using data set generations(essentially a before and after for the same named data set)

 

Proc Compare might be the tool but you will have to tell the procedure which data sets to compare. The data sets should be in the same sort order as well.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 8 replies
  • 1599 views
  • 0 likes
  • 5 in conversation