PS12 Reordering Variables in a SASŪ Data Set     Contributed

Imelda C. Go, Ph.D.
Lexington School District One
Abstract: A programmer may have a number of reasons to want to reorder variables in a data set. One reason is to take advantage of PROC PRINT output that prints variables according to their order on the data set when the VAR statement is not used. Another reason is to logically order the variables prior to exporting the data into a spreadsheet. This would eliminate the need to reorder the columns in the spreadsheet since reordering is done prior to exporting. Whatever the reasons are, there are a number of ways to re order the variables in a data set. The DATA step may be used to reorder the variables by using one of the ATTRIB, ARRAY, FORMAT, INFORMAT, LENGTH, or RETAIN statements. PROC SQL can also be used to reorder the variables.

Biography:
Imelda C. Go, Ph.D., has been using SAS since 1989. Working in different computing environments that were not always equal in computing power and resources led to an interest in efficiency.