Arange column (varialble)

Reply
Contributor
Posts: 64

Arange column (varialble)

Is it a way to arange the column (variable) of the dataset by drag and drop from 'viewtable' window?

thanks

Super User
Posts: 10,538

Re: Arange column (varialble)

I find it a tad awkward and it isn't consistent but within viewtable you can click on the column heading once the left click and hold to drag the column. However this doesn't, at least in my install of SAS 9.2.3 and Windows 7, allow dragging a column past the current displayed boundaries of the window (i.e. can't keep going left or right). Also the order is ONLY for the current view. It does not actually change the order of the columns in the dataset. When you close the view and reopen the previous column you have to got through the process again if you want to look at columns.

Contributor
Posts: 64

Re: Arange column (varialble)

thanks, yes, I have noticed it too. it will not stay even I have click the save botton.

I just exported it to excel and rearrange the column and then imported back to the sas datasets.

Hope in the future we are able to do it directly from viewtable window.

Super User
Posts: 17,912

Re: Arange column (varialble)

Typically if I need to arrange columns, I'll recreate the dataset (assuming its not too large) using proc sql and then arrange the variables the order I want them.

proc sql feedback;

select * from want;

quit;

Check the log after running that and it will include all your variables and then you can order them a little bit more easily (IMO).

Contributor
Posts: 64

Re: Arange column (varialble)

yes, this is an alternative way to do. The problem  is, I have so many variables in my dataset.

btw, thank for the response.

Frequent Contributor
Frequent Contributor
Posts: 94

Re: Arange column (varialble)

You could also use proc contents or proc sql to get the variable names:

proc contents data=have out=want ; run;

OR

proc sql; describe table have; quit; Check the log for the variable names.

Ask a Question
Discussion stats
  • 5 replies
  • 242 views
  • 0 likes
  • 4 in conversation