Example: tourism industry

SAS® ODS Destination for Microsoft Excel: Use the STYLE ...

1 Paper 3775-2019 SAS ODS Destination for Microsoft excel : Use the STYLE Option to Spruce Up an excel output Workbook William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix Arizona ABSTRACT The SAS environment maintains many different output styles to use to enhance the visual display of your output data. The ODS Destination for excel can take advantage of these styles maintained by SAS to apply formatting and color schemes to your excel output workbooks. I show you how to use the STYLE option in the ODS Destination for excel to enhance your output workbooks. INTRODUCTION This paper is one of a series of short papers each describing one suboption element of the ODS excel Destination . Here I will list the available Actions , Options , and Suboptions and describe one feature of the ODS excel Destination . Unlike the ODS tagset called EXCELXP, the ODS excel Destination cannot be modified by you the SAS user. This paper is being presented as a 10 minute paper and therefore can only cover a small focused topic.

The SAS® environment maintains many different output styles to use to enhance the visual display of your output data. The ODS destination for Excel can take advantage of these styles maintained by SAS to apply formatting and color schemes to your Excel ou tput workbooks.

Tags:

  Excel, Styles, Microsoft, Destinations, Output, Putt, 174 ods destination for microsoft excel, Ou tput

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of SAS® ODS Destination for Microsoft Excel: Use the STYLE ...

1 1 Paper 3775-2019 SAS ODS Destination for Microsoft excel : Use the STYLE Option to Spruce Up an excel output Workbook William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix Arizona ABSTRACT The SAS environment maintains many different output styles to use to enhance the visual display of your output data. The ODS Destination for excel can take advantage of these styles maintained by SAS to apply formatting and color schemes to your excel output workbooks. I show you how to use the STYLE option in the ODS Destination for excel to enhance your output workbooks. INTRODUCTION This paper is one of a series of short papers each describing one suboption element of the ODS excel Destination . Here I will list the available Actions , Options , and Suboptions and describe one feature of the ODS excel Destination . Unlike the ODS tagset called EXCELXP, the ODS excel Destination cannot be modified by you the SAS user. This paper is being presented as a 10 minute paper and therefore can only cover a small focused topic.

2 The ODS excel Destination has over 65 Actions , Options , and Suboptions available. PROBLEM The ability to output SAS data and graphs to Microsoft excel workbooks has long been something that both SAS and excel users have wanted. SAS users want better ways to output more detailed and complex data because their boss wants the data in an excel workbook. excel users want the data in excel because they can easily process What If .. questions. Therefore, both SAS and excel users really want betters ways to produce excel workbooks. ODS excel Destination FEATURE DESCRIPTION ODS excel Destination Actions , Options , and Suboptions work with different parts of the excel Workbook. This paper will describe one Action associated with the ODS excel Destination software called the STYLE option. The length of this paper only allows a short introduction to using the STYLE features of the ODS excel Destination , but if you do not know where to start nothing else can be accomplished.

3 ODS excel Destination ACTIONS , OPTIONS , AND SUBOPTIONS The following tables list the full list of Actions , Options , and Suboption available for the ODS excel Destination as presented in SAS (TS1M3). List of ODS excel Actions Actions Include NONE Sends excel output to the SAS Default output on your version of SAS, the default directory is shown in the bottom left or right side of the display manager window. CLOSE Closes an ODS excel statement with or without an ID= option. 2 EXCLUDE An ODS EXCLUDE statement prevents an ODS object from being output . SELECT An ODS SELECT statement includes an ODS object in the output . SHOW An ODS SHOW statement writes the current selection or exclusion list to the log List of ODS excel Options Optional Arguments ANCHOR= AUTHOR= BOX_SIZING= CATEGORY= COMMENTS= CSSSTYLE= DOM= DPI= FILE= GFOOTNOTE NOGFOOTNOTE GTITLE NOGTITLE IMAGE_DPI= KEYWORDS= ID= OPTIONS SASDATE STATUS= STYLE = TEXT= TITLE= WORK= Suboptions of the OPTIONS option of the ODS excel statement Suboptions of the OPTIONS Argument ABSOLUTE_COLUMN_WIDTH= ABSOLUTE_ROW_HEIGHT= AUTOFILTER= BLACKANDWHITE= BLANK_SHEET= CENTER_HORIZONTAL= CENTER_VERTICAL= COLUMN_REPEAT= CONTENTS= DPI= DRAFTQUALITY= EMBEDDED_FOONOTES= ENBED_FOOTNOTES_ONCE= EMBEDDED_TITLES= EMBED_TITLES_ONCE= FITTOPAGE= FORMULAS= FROZEN_HEADERS= FROZEN_ROWHEADERS= GRIDLINES= HIDDEN_COLUMNS= HIDDEN_ROWS= INDEX= MSG_LEVEL= ORIENTATION= PAGE_ORDER_ACROSS= PAGES_FITHEIGHT= PAGES_FITWIDTH= PRINT_AREA= PRINT_FOOTER= PRINT_FOOTER_MARGIN= PRINT_HEADER= 3 PRINT_HEADER_MARGIN= ROWBREAKS_COUNT= ROWBREAKS_INTERVAL= ROWCOLHEADINGS= ROW_HEIGHTS=

4 ROW_REPEAT= SCALE= SHEET_INTERVAL= SHEET_LABEL= SHEET_NAME= START_AT= SUPPRESS_BYLINES= TAB_COLOR= TITLE_FOOTNOTE_NOBREAK= TITLE_FOOTNOTE_WIDTH= ZOOM= THE ODS excel Destination SYNTAX Simple ODS Syntax for the ODS excel Destination . ODS excel <(<ID=> identifier)> < action> ; ODS excel <(<ID=> identifier)> <option(s)> ; The SAS ODS excel Destination syntax shown above is just the tip of the iceberg. As shown, everything except ODS excel ; is optional. One thing to point out is that there is an Argument called OPTIONS that has many SUB-OPTIONS , they are described in the SAS HELP under the Base SAS (TS1M3) topic ODS excel Statement. In its simplest form the following SAS code will produce an excel workbook. As shown here. ODS excel ; PROC PRINT DATA= ; RUN; ODS excel CLOSE; The SAS output looks like this, note that without a FILE= statement the output excel Workbook goes to the current default directory with the default file name The sheet name is also a default name composed of the procedure name and the SAS Dataset name.

5 4 The excel output workbook looks like the following. On the bottom of the PC SAS display manager window the default output directory name is listed. The actual location on the screen varies depending on the version of SAS that you are using. This form of execution selects the filename at execution time, while the FILE= option enables you to select an output filename. In this example, the name defaults to , but on other operating systems the default name might be different. Depending on the operating system that the SAS code was running on, and the TOOLS> Options> Preferences Results tab selections, the output excel workbook can be forced open using excel . 5 The windows output directory is shown below; the directory was empty before the SAS code was executed. Afterward, the directory shows the output excel workbook. Since the workbook was opened the temporary file generated by excel is also visible. THE STYLE OPTION The STYLE option permits you to change the look of the output sent to excel .

6 Hidden beneath each ODS output we use is a default STYLE . When the ODS excel statement is used to write an excel workbook there is always a STYLE used. The default STYLE is excel . The ODS excel STYLE = option enables you to modify that default. 6 Action Parameter Options Description STYLE STYLE -override(s) Use a predefined STYLE element, a collection of STYLE changes, or a single (or group of) STYLE name-value pair of changes. SAS SUPPORTED STYLE OPTIONS There is a way to determine what styles are available in your current version. The SAS Code below generates a list of the available styles . They are displayed by PROC TEMPLATE. They reside in the item store. The Table of Supported SAS styles below contains the names of the styles supported in SAS version 1M3. The SAS code prints a list and I copied the list into the table shown here. Generate a List of SAS Supported styles ods _all_ close; ods listing; proc template; list styles ; run; quit; Table of Supported SAS styles for SAS version 1M3 List of SAS styles Supported (SAS 1M3)

7 Analysis BarrettsBlue BlockPrint DTree Daisy Default Dove EGDefault excel FancyPrinter Festival FestivalPrinter Gantt GrayscalePrinter HTMLBlue Harvest HighContrast HighContrastLarge Journal Journal1a Journal2 Journal2a Journal3 Journal3a Listing Meadow MeadowPrinter Minimal MonochromePrinter Monospace Moonflower Netdraw NoFontDefault Normal NormalPrinter Ocean Pearl PearlJ Plateau PowerPointDark PowerPointLight Printer Raven Rtf Sapphire SasDocPrinter SasWeb Seaside SeasidePrinter StatDoc Statistical Word vaDark vaHighContrast vaLight The following code writes an excel workbook sheet using the SAS supported STYLE called SEASIDE.

8 I created the sas data set called ASIA_ONLY by using the data set and selecting only the records where REGION= ASIA . This allows my to show the whole worksheet on one small screen shot. 7 Generate an excel Workbook with STYLE =SEASIDE ods excel file = "&path.\ " STYLE =SEASIDE; Proc Print data=Asia_Only; run; ods excel close; The default STYLE is excel which produces light blue Column and Row headers. Each of the styles listed in the Table of Supported SAS styles produces a different layout in the excel workbook. I have not executed code using all of the styles , but I do know that some of the styles only have minor differences from other styles . Figure 6-10 excel Workbook Using the SEASIDE STYLE Notice the yellow Column and Row headers. THE ODS excel STYLE = OVERRIDES There are other ways to Stylize your output within excel worksheets, and some of them even have STYLE = as part of the name. However, styles are applied within the procedures, not the ODS statement.

9 As a result I will list some of the different types of STYLE overrides, but not show detailed examples. I found these examples on page 311 of SAS Institute Inc. 2016. SAS output Delivery System: User s Guide, Fifth Edition. Cary, NC: SAS Institute Inc. There are two methods of providing STYLE overrides. First, as a STYLE element, which is a collection of attributes that affect some output of a SAS program. Second, as a STYLE attribute, which is a name-value pair that describes an output behavior or visual result that you want to apply to output data. A STYLE attribute change is the most specific way to directly change how your data looks. 8 General Syntax of the STYLE Overrides /* These code segments are out of context * The STYLE -override element name syntax: STYLE -element-name | [ STYLE -attribute-name-1= STYLE -attribute- value-1 < STYLE -attribute-name-2= STYLE -attribute-value-2 ..>] * The STYLE -override attribute syntax; STYLE ={tagattr='format:$#,##0_);[Red]\($ #,##0\) formula:RC[-1]-RC[-2]'}; */ These syntax descriptions in SAS Code 6-17 are out of context.

10 These are STYLE overrided but will not execute as coded. In order to get information about the proper way to use these SAS code structures. See SAS Institute Inc. 2016. SAS output Delivery System: Procedures Guide, Third Edition. Cary, NC: SAS Institute Inc. for these and other attribute name-value pairs. CONCLUSION The ODS excel Destination is very flexible and the STYLE option allows you to spruce up your output to the production level at the time the workbook is created. While it may take a little extra time to produce the first fancy workbook, any others will only require minor adjustments and save manual effort to upgrade the outputs. REFERENCES SAS Institute Inc. 2016. SAS output Delivery System: User s Guide, Fifth Edition. Cary, NC: SAS Institute Inc. Benjamin, William E., Jr. 2017. Exchanging Data From SAS to excel : The ODS excel Destination . Cary, NC: SAS Institute Inc. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: William E Benjamin Jr Owl Computer Consultancy, LLC Phone 623-337-0269 Email - SAS and all other SAS Institute Inc.


Related search queries