BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MG18
Lapis Lazuli | Level 10

I have been deleting records logically from one dataset , when i checked size of dataset is remains always same after deletion of records also .

 

Query used :- 

 

proc sql;

delete from ADFBASE.advdep_final_sas1;

quit;

 

Result :- 

NOTE: 57589 rows were deleted from ADFBASE.ADVDEP_FINAL_SAS1.

 

But when i checked size of ADFBASE.ADVDEP_FINAL_SAS1 in server , it is still same after deletion of 57589 records.

 

we are using same code for many dataset and it is just deleting data only Logically not physically.

I want to delete the records which are already deleted so that it will free size for that dataset.

 

How to delete records which were already deleted logically ?

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

you need just copy it to itself:

 

data ADFBASE.ADVDEP_FINAL_SAS1;

  set ADFBASE.ADVDEP_FINAL_SAS1;

run;

 

the logical deleted observations will not be copied.

View solution in original post

3 REPLIES 3
Reeza
Super User

Do you want to delete all records or remove the table entirely? 

MG18
Lapis Lazuli | Level 10

I want to remove some records physically  which is already removed from dataset using below query:-

 

proc sql ;

 

delete from advdep_final_sas1;

 

quit;

 

after using above query the size of datset remains same that means it is not deleting records from dataset physically.

 

How to remove records from dataset which was deleted previouslly ? 

Shmuel
Garnet | Level 18

you need just copy it to itself:

 

data ADFBASE.ADVDEP_FINAL_SAS1;

  set ADFBASE.ADVDEP_FINAL_SAS1;

run;

 

the logical deleted observations will not be copied.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 1770 views
  • 0 likes
  • 3 in conversation