0

I have a SAS dataset, in which I have variables in the following order

Customer_Name
Quantity_Sold
Total_Retail_Price
Product_Name
Supplier

Now, I want to create a new dataset based on this existing dataset but in the new dataset I want variable arrangement in the following order

Customer_Name 
Supplier
Product_Name
Quantity_Sold
Total_Retail_Price

Can anyone help me to solve this problem

Thanks in Advance

Richard
  • 25,390
  • 3
  • 25
  • 38
  • There are other answers depending on why you want to change the column order, especially when you have many rows or columns. Are you doing it for reporting, export, or personal aesthetic ? – Richard Dec 01 '18 at 15:20

1 Answers1

0

You can use retain before SET to create a new data set.

data new;
   retain Customer_ Name Supplier Product_Name Quantity_Sold Total_Retail_Price;
   set have;
   run;
data _null_
  • 8,534
  • 12
  • 14