LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 20 Apr 2006 16:29:12 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: how to extract SortedBy information without using PROC
              CONTENTS
Comments: To: greenmt@GMAIL.COM
In-Reply-To:  <1145547391.875845.94800@v46g2000cwv.googlegroups.com>
Content-Type: text/plain; format=flowed

Jerry ,

Data A; input var1 var2 var3; datalines; 2 3 4 3 2 1 7 9 8 ; run;

proc sort data=A; by var1 var2; run;

Data B; input var1 var2 var3; datalines; 22 32 44 32 22 12 74 91 87 ; run;

proc sql noprint ; select Name into : SortVars separated by ' ' from dictionary.columns where libname = 'WORK' and memname = 'A' and sortedby > 0 ; quit ;

proc sort data = B ; by &SortVars ; run ;

proc contents data = A ; run ;

proc contents data = B ; run ;

Toby Dunn

From: Jerry <greenmt@GMAIL.COM> Reply-To: Jerry <greenmt@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: how to extract SortedBy information without using PROC CONTENTS Date: Thu, 20 Apr 2006 08:36:31 -0700

Hi,

For a dataset sorted on some variables, I know PROC CONTENTS can be used to find what these SortedBy variables are.

Suppose I have 2 datasets(A and B). I know that 1, A and B contain the same variables, 2, A is sorted while B is not.

Now I want to sort B by the same SortedBy vars used for A, but without checking the output of PROC CONTENTS.

Is this possible? If so, can anyone offer me a clue?

Thanks. Jerry

/*partial code for your convenience*/

Data A; input var1 var2 var3; datalines; 2 3 4 3 2 1 7 9 8 ; run;

proc sort data=A; by var1 var2; run;

Data B; input var1 var2 var3; datalines; 22 32 44 32 22 12 74 91 87 ; run;


Back to: Top of message | Previous page | Main SAS-L page