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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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