The SAS Output Delivery System and reporting techniques

Export variables in order

Reply
N/A
Posts: 0

Export variables in order

Hi all,

I'm using proc export to get some data into excel. I was wondering if someone knows of a way to export the fields in a specified order.
I'm trying to cut some post sas time.

Thanx
N/A
Posts: 0

Re: Export variables in order

either change your data set to have columns in the order you prefer, or don't use proc export.

(I would recommend the latter)

Instead of proc export use:
ods listing close ;
ods csv file= 'this.csv' ;
proc print data= this_data noobs ;
var required columns in the preferred order ;
run;
ods csv close ;
ods listing ;
OK, it just creates the data in a form (very) ready for excel, but would something else achieve what you really need, as simply ?

Good Luck
Peter
N/A
Posts: 0

Re: Export variables in order

PeterC,

In your response you said:

"either change your data set to have columns in the order you prefer ..."

I had some code a long time ago that would do this but it is now lost. How do you change the data set to have columns in order of my preference? I think the code I had was able to change the position attribute of variables. Searching SAS help hasn't led me to any methods that will do this.

Thanks for any help.
N/A
Posts: 0

Re: Export variables in order

LJ

in another forum this would be more appropriate

or call customer support, or contact them online at
http://support.sas.com/techsup/contact/submit_emits2.html

it should be on a FAQ

"or just use retain"

or better still, please explain why internal order has any relevance to all users of the data table,

but
please do that in another forum

ODS and base SAS Reporting have many ways to help you select the required order. They just have no way of knowing the order you are going to need next. I see only simplicity in the current scheme - when reporting you specify the column order you want. I see only disappointment in preparing "column order", for later, or for someone-else.

In another forum your topic appears frequently.

Here is a link to one I recall :
http://tinyurl.com/f9ku9

PeterC
N/A
Posts: 0

Re: Export variables in order

PeterC,

> in another forum this would be more appropriate

I see that the Integration with MS Office is a more appropriate forum. Thanks.

> or better still, please explain why internal order has any relevance to all users of the data table,

For exactly the same reason given by SAS coder.

Thanks very much for your reply.

LJ
Ask a Question
Discussion stats
  • 4 replies
  • 539 views
  • 0 likes
  • 1 in conversation