SPDO Procedure

Example 5: Using PROC SPDO to Truncate a Table

Features:

TRUNCATE statement

Details

The following code creates and then truncates a sample table to illustrate use of the TRUNCATE statement.
%let host=kaboom;
%let port=5400;

libname mylib sasspds "path"
host="&host"
serv="&port"
user='anonymous'
ip=YES;

/* create a table */
data mylib.sample_table
do i = 1 to 100;
output;
end;
run;
/* verify the contents of the created table */
proc contents data=mylib.sample_table;
run;

/* truncate the table */
proc spdo lib=mylib
set acluser;
truncate sample_table;
quit;

/* verify that no rows or data remain in */
/* the structure of sample_table */
proc contents data= mylib.sample_table
run;
Last updated: February 3, 2017