General form, ALTER
TABLE statement:
ALTER TABLE table-name
<ADD column-definition-1<,
... column-definition-n>>
<DROP column-name-1<,
... column-name-n>>
<MODIFY column-definition-1<,
... column-definition-n>>;
table-name
specifies the name
of the table in which columns will be added, dropped, or modified.
<ADD, DROP, MODIFY>
at least one of the
following clauses must be specified:
ADD
specifies one or more column-definitions
for columns to be added.
DROP
specifies one or more column-names
for columns to be dropped (deleted).
MODIFY
specifies one or more column-definitions
for columns to be modified, where column-definition specifies
a column to be added or modified, and is formatted as follows:
column-name data-type <(column-width)> <column-modifier-1
<...column-modifier-n>> In all three clauses,
multiple column-definitions or column-names must
be separated by commas.
|
proc sql; alter table work.payrollmaster4 add Bonus num format=comma10.2, Level char(3);
proc sql; alter table work.payrollmaster4 drop bonus, level;
alter table work.payrollmaster modify jobcode char(2); select * from payrollmaster;
proc sql; alter table work.payrollmaster4 modify salary format=dollar11.2 label="Salary Amt";
proc sql; alter table work.payrollmaster4 add Age num modify dateofhire date format=mmddyy10. drop dateofbirth, gender;