02-15-2013 02:19 PM
I am an new SAS user so I'm still learning basics. I have a Dataset that contains a ton of info on Customer Claims on coils. Each coil has a product type. There are hundreds of coils and 7 product types. I need my output sorted by product type. The 7 product types need to be in a specific order. Where this would be a simple click and drag in Excel, I have no idea how to do it in SAS. Any suggestions would be greatly appreciated!!
02-15-2013 04:00 PM
Have you already read your data into a SAS data set? That would be a necessary first step.
Once your data is in a SAS data set, this step would sort it:
proc sort data=coil_data;
The resulting order would be alphabetical, according to the value of product_type. If you wanted some other order, you would have to add a new variable to your data before sorting:
if product_type='A' then sorted_order=5;
else if product_type='B' then sorted_order=2;
else if product_type='G' then sorted_order=3;
Then you could sort the data by this new variable.
Those are the concepts to master ... good luck.