Microsoft documents are a security risk and many here will not open them from an unknown source and some are restricted from opening them by organization policy or security software.
Code is best shown by copying from the SAS editor (or other plain text editor NOT word processor as they will insert and modify code sometimes) and paste into a code box here opened using the forum's {I} menu icon.
Microsoft documents are a security risk and many here will not open them from an unknown source and some are restricted from opening them by organization policy or security software.
Code is best shown by copying from the SAS editor (or other plain text editor NOT word processor as they will insert and modify code sometimes) and paste into a code box here opened using the forum's {I} menu icon.
Sorry, the purpose I used attached file is to show the log of SAS. I typed the code below and result was same. Does SAS application on my machine or window environment not support the code?
ods excel file="C:\RA\temp.xlsx" options(
start_at="3,3"
frozen_heads="5"
frozen_rowheaders="3"
autofilter="1-5"
sheet_name="class report"
row_repeat="2"
embedded_titles="yes");
title "Student Report";
proc print data=sashelp.class; run;
ods excel close;
Look at the top of the window: There is an icon that looks like {I}
Click on it.
ods excel file="d:\temp.xlsx" options( start_at="3,3" frozen_headers="5" frozen_rowheaders="3" autofilter="1-5" sheet_name="class report" row_repeat="2" embedded_titles="yes"); title "Student Report"; proc print data=sashelp.class; run; ods excel close;
Paste text, as above.
NO, your code as shown will not run. The option frozen_heads does not exist. Notice I corrected that to frozen_headers.
I corrected my code as you pointed, but the result was same after I ran it
Cynthia, I am learning codes to generate ods excel file. When copied and ran sample code to see how it works, I found the problem and couldn’t figure it out. As you recommended, I add sub-options 1 by 1 and finally nailed down the troublesome option - start_at="3,3". I will check the documentation for ODS EXCEL. Thanks
Hi:
That's odd, START_AT works fine for me. See below:
I guess I would recommend trying EACH option separately. And then try the options in combination with each other. If START_AT isn't working in combination with the others, my guess is that there's something that the combination is making an error combination.
cynthia
...PS: As an additional comment in your sub-option list, you specify autofilter="1-5" but your REPORT has 6 columns because OBS is column 1, name is 2, sex is 3, age is 4, height is 5 and weight is 6. So with your code I would expect to see an autofilter on OBS, which doesn't make sense and NOT a filter on WEIGHT.
ods excel file="&excpath\StartAt.xlsx" options (start_at='3,3'); proc print data=sashelp.class; run; ods excel close;
I simplified code and ran it again. the problem still was there. see attached log. Thank you
ods excel file="C:\RA\temp.xlsx" options( start_at="3,3" frozen_heads="5" frozen_rowheaders="3" autofilter="1-5" sheet_name="class report" row_repeat="2" embedded_titles="yes"); title "Student Report"; proc print data=sashelp.class; run; ods excel close;
Nope, no version of SAS or any other language can run .docx files. Perhaps consider some of the guidance given when posting a question. Put the problem in the post, give some test data in the form of a datastep, show what the output should look, what you have tried etc.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.