When a view is no longer needed, it’s nice to know there is a way to remove it. Without this ability, program maintenance activities would be made more difficult. To remove an unwanted view, specify the DROP VIEW statement and the name of the view. In the next example, the INVENTORY_VIEW view is deleted from the WORK library.
SQL Code
PROC SQL; DROP VIEW INVENTORY_VIEW; QUIT;
SAS Log
PROC SQL; DROP VIEW INVENTORY_VIEW; NOTE: View WORK.INVENTORY_VIEW has been dropped. QUIT; NOTE: PROCEDURE SQL used: real time 0.10 seconds |
When more than a single view needs to be deleted, the DROP VIEW statement works equally as well. Specify a comma between each view name when deleting two or more views.
SQL Code
PROC SQL; DROP VIEW INVENTORY_VIEW, LAPTOP_PRODUCTS_VIEW; QUIT;
SAS Log
PROC SQL; DROP VIEW INVENTORY_VIEW, LAPTOP_PRODUCTS_VIEW; NOTE: View WORK.INVENTORY_VIEW has been dropped. NOTE: View WORK.LAPTOP_PRODUCTS_VIEW has been dropped. QUIT; NOTE: PROCEDURE SQL used: real time 0.00 seconds |