Help using Base SAS procedures

Can we use if class in proc sort? if yes, please explain how?

Reply
Occasional Contributor
Posts: 8

Can we use if class in proc sort? if yes, please explain how?

Can we use if class in proc sort? if yes, please explain how?

Super Contributor
Posts: 334

Re: Can we use if class in proc sort? if yes, please explain how?

What are you trying to achieve?  Proc sort just sort the data by the by groups listed. Class statements are usually on the stat procedures for reporting purposes.

So the short answer is no. But I imagine that doesnt solve your real question.

REFERENCE SAS DOCUMENTATION

Base SAS(R) 9.2 Procedures Guide

EJ

Super User
Posts: 11,343

Re: Can we use if class in proc sort? if yes, please explain how?

If you mean to sort the data an have a subset of the data as a result use the where clause on the data:

proc sort data= mydataset(where=(ThisVariable in (value1, value2, value3)) out=SortedSubset; by variable1 variable2;run;

Ask a Question
Discussion stats
  • 2 replies
  • 238 views
  • 1 like
  • 3 in conversation