Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- Footnote text alignment in ODS Excel

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-06-2023 12:43 PM
(576 views)

Hi SAS Community,

Pretty simple question here, so I'm hoping the solution is pretty straight forward. I am outputting a table (proc report) to Excel via ODS, and I want to align the footnotes below the table to the left rather than centered. Below is my current code, followed by a screenshot of the current output and then a screenshot of the desired output. The reformatting for the desired output was done in Excel, and the goal is to have it output that way without any manual adjustments within Excel. Note that in the output screenshots, I have hidden the actual rows of the table.

1. Current Code

ods excel file="&output./test.xlsx" options(sheet_interval="none" sheet_name="test" embedded_titles="yes" embedded_footnotes="yes"); ods noproctitle; ods escapechar="~"; title "Title"; footnote1 "Footnote1"; footnote2 "Footnote2" ; footnote3 "Footnote3"; proc report data=data style=journal; column acute_label count percent; define acute_label / "Prior Treatment ATC Group" format=$32.; define count / "Count"; define percent / "Percent" format=8.2; run; ods excel close;

2. Current Output

3. Desired Output

Thanks in advance for any help!

RJ

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

See if using the JUSTIFY option does what you want:

footnote1 justify=left "Footnote text";

@irvinery wrote:

Hi SAS Community,

Pretty simple question here, so I'm hoping the solution is pretty straight forward. I am outputting a table (proc report) to Excel via ODS, and I want to align the footnotes below the table to the left rather than centered. Below is my current code, followed by a screenshot of the current output and then a screenshot of the desired output. The reformatting for the desired output was done in Excel, and the goal is to have it output that way without any manual adjustments within Excel. Note that in the output screenshots, I have hidden the actual rows of the table.

1. Current Code

ods excel file="&output./test.xlsx" options(sheet_interval="none" sheet_name="test" embedded_titles="yes" embedded_footnotes="yes"); ods noproctitle; ods escapechar="~"; title "Title"; footnote1 "Footnote1"; footnote2 "Footnote2" ; footnote3 "Footnote3"; proc report data=data style=journal; column acute_label count percent; define acute_label / "Prior Treatment ATC Group" format=$32.; define count / "Count"; define percent / "Percent" format=8.2; run; ods excel close;2. Current Output

3. Desired Output

Thanks in advance for any help!

RJ

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

See if using the JUSTIFY option does what you want:

footnote1 justify=left "Footnote text";

@irvinery wrote:

Hi SAS Community,

Pretty simple question here, so I'm hoping the solution is pretty straight forward. I am outputting a table (proc report) to Excel via ODS, and I want to align the footnotes below the table to the left rather than centered. Below is my current code, followed by a screenshot of the current output and then a screenshot of the desired output. The reformatting for the desired output was done in Excel, and the goal is to have it output that way without any manual adjustments within Excel. Note that in the output screenshots, I have hidden the actual rows of the table.

1. Current Code

ods excel file="&output./test.xlsx" options(sheet_interval="none" sheet_name="test" embedded_titles="yes" embedded_footnotes="yes"); ods noproctitle; ods escapechar="~"; title "Title"; footnote1 "Footnote1"; footnote2 "Footnote2" ; footnote3 "Footnote3"; proc report data=data style=journal; column acute_label count percent; define acute_label / "Prior Treatment ATC Group" format=$32.; define count / "Count"; define percent / "Percent" format=8.2; run; ods excel close;2. Current Output

3. Desired Output

Thanks in advance for any help!

RJ

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Yes, problem solved! Thanks so much, just as straightforward as I was hoping haha.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

How to Concatenate Values

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.