Help using Base SAS procedures

Export to excel with two headers

Reply
Contributor
Posts: 25

Export to excel with two headers

I am using proce export to export the SAS data to excel file. but i need to have two headers(top one is lable with spaces). is there any simple solution? my data has preceeesing zero numbers as customer ID.

basically i want to have the same format of dates, numbers, characters and numbers with preceeding zeros. but with extra header.

CUSTOMER NUMBER

CUSTNBR

00001213

00001212

00121544

Thanks,

Alankar

Frequent Contributor
Posts: 88

Re: Export to excel with two headers

Hi Alankar,

Could you please provide some sample of your current data and the expected output data?

regards,

Tushar J.


SAS Super FREQ
Posts: 8,743

Re: Export to excel with two headers

Hi,
Is the above your final report? Just CUSTOMER_NUMBER???? PROC REPORT will do this very easily (give you two headers), but PROC EXPORT will not. Also, there is a possibility that Excel will ignore the SAS formats when it opens your exported workbook. That's because Excel has its own defaults for column formats, widths, etc and PROC EXPORT does not have many ways to influence how Excel opens the file.

On the other hand, if you use ODS, you can influence how Excel treats your data because you can send Microsoft-specific formats to Excel, as described in this paper: http://support.sas.com/resources/papers/proceedings11/266-2011.pdf  (leading zeroes treatment is one of the examples).

cynthia

Contributor
Posts: 25

Re: Export to excel with two headers

Sorry for insufficient explanation.

I need to export 3 sheets, each with 20 variables. I have dates, char variables, numbers and preceding zero variables, like ID and account numbers.

Ask a Question
Discussion stats
  • 3 replies
  • 265 views
  • 0 likes
  • 3 in conversation