proc datasets lib=company; modify orders; rename quantity=Units_Ordered; format costprice_per_unit dollar13.2; label delivery_date='Date of Delivery'; run; modify customers; format customer_birthdate mmddyy10. run; quit;
Multiple DATASETS Procedures
This program invokes
PROC DATASETS three times to modify the descriptor portion of the
data set NewCustomer, two times to modify the descriptor portion of
the data set NewOrders, and once to change the name of the data set
NewItems.
proc datasets lib=company nolist; modify newcustomer; rename Country_ID=Country Name=Customer_Name; quit; proc datasets lib=company nolist; modify newcustomer; format birth_date date9.; quit; proc datasets lib=company nolist; modify newcustomer; label birth_date='Date of Birth'; quit; proc datasets lib=company nolist; modify neworders; rename order=Order_ID employee=Employee_ID customer=Customer_ID; quit; proc datasets lib=company nolist; modify neworders; format order_date date9.; quit; proc datasets lib=company nolist; change newitems=NewOrder_Items; quit; |
Single DATASETS Procedure
This program invokes
PROC DATASETS once to modify the descriptor portion of the data sets
NewCustomer and NewOrders, and to change the name of the data set
NewItems. This technique is more efficient.
proc datasets lib=company nolist;
modify newcustomer;
rename country_ID=Country
name=Customer_Name;
format birth_date date9.;
label birth_date='Date of Birth';
modify neworders;
rename order=Order_ID
employee=Employee_ID
customer=Customer_ID;
format order_date date9.;
change newitems=NewOrder_Items;
quit; |