Hi,
I am getting error while running the below code in log file.
Unrecognized option: ROTATE_HEADERS
Unrecognized option: HEIGHT
I want to change the column header from horizontal to vertical format. Also all the columns should contain constant height of 10 and width of 7.
Can you please help
data test; input pid age gender race event2 $; label pid = 'Patient ID' age = 'Patient age' gender='Sex' race = 'Race' event2='Event 2' ; cards; 101 21 1 1 fever 102 21 2 1 fever 103 31 1 1 fever 104 43 2 1 fever ; ods tagsets.excelxp file='D:/outputs/test.xls' style=normal options( rotate_headers="45" height="60"); proc print data=test ; run; ods tagsets.excelxp close;
me
data test;
input pid age gender race event2 $;
label
pid = 'Patient ID'
age = 'Patient age'
gender='Sex'
race = 'Race'
event2='Event 2'
;
cards;
101 21 1 1 fever
102 21 2 1 fever
103 31 1 1 fever
104 43 2 1 fever
;
ods tagsets.excelxp file='c:\temp\test.xls' style=normal
options( Row_Heights='200,20,20,20,20,20,20' Default_Column_Width='10')
;
proc report data=test nowd style(header)={tagattr='rotate:90 ' };
run;
ods tagsets.excelxp close;
@abraham1 wrote:
Hi,
I am getting error while running the below code in log file.
Unrecognized option: ROTATE_HEADERS
Unrecognized option: HEIGHTI want to change the column header from horizontal to vertical format. Also all the columns should contain constant height of 10 and width of 7.
Height of 10 what units? MM, CM, Feet, furlongs?
Your requirement may have issues with the amount of text you attempt to place in a given height/width combination.
You may want define more of what you expect for "vertical format" headers.
You might not be aware of the Proc Print option Heading= that has one form of vertical headings.
As an example run (regardless of destination)
proc print data=test heading=vertical ; run;
Why would you want to use EXCELXP tagset instead of using the more recent EXCEL ods destination?
And if you are going to use that method why are you naming the file with .xls extension instead of .xml? It is going to be an XML file.
I suspect you want to add a style to the VAR statement of your PROC PRINT to tell EXCEL to rotate the headers.
Here is a line from an old report of mine from years ago when EXCELXP was actually kind of current technology.
var &vlist
/style={tagattr="format:###,###,###"}
style(header)={tagattr='rotate:90 format:text'}
;
data test;
input pid age gender race event2 $;
label
pid = 'Patient ID'
age = 'Patient age'
gender='Sex'
race = 'Race'
event2='Event 2'
;
cards;
101 21 1 1 fever
102 21 2 1 fever
103 31 1 1 fever
104 43 2 1 fever
;
ods tagsets.excelxp file='c:\temp\test.xls' style=normal
options( Row_Heights='200,20,20,20,20,20,20' Default_Column_Width='10')
;
proc report data=test nowd style(header)={tagattr='rotate:90 ' };
run;
ods tagsets.excelxp close;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.