BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

ODS LISTING CLOSE;

Here is a portion of code used to create an excel file on a website.  I use SAS 9.3 EG.  I cannot figure out why I am getting the error listed in red below

ODS TAGSETs.ExcelXP file="&ReportOut..xls" Path="&OutDir" style = styles.rtf;

/*ODS TAGSETs.ExcelXP file="&ReportOut..xls" Path="&OutDir" style = styles.rtf*/

Title1 "&Investor_Nme for &mm_name1";

options(sheet_interval= 'None'

          sheet_name= 'Rows 1 - 16'

           Orientation= 'landscape'

           Frozen_Headers = '1'

           CENTER_HORIZONTAL = 'yes'

          scale = '80'

           ROW_REPEAT = '1'

           CENTER_HORIZONTAL = 'yes'

          EMBEDDED_TITLES = "No"

           EMBEDDED_FOOTNOTES = "YES"

           GRIDLINES ="YES"

           AutoFit_Height = 'YES')

                                    -

                                    2

  ;

ERROR 2-12: Invalid option name.

2 REPLIES 2
data_null__
Jade | Level 19

This OPTIONS parameter needs to be on the ODS statement.

The way you have it written SAS thinks it is an OPTIONS statement.

Cynthia_sas
SAS Super FREQ


Hi:

  The implication of this (correct) suggestion is that your TITLE statement must be moved, too. You have ended your ODS statement with a semi-colon, then have a TITLE statement and then your sub-option list. However, the TITLE statement needs to be either above or below the ODS statement and the sub-option list belongs on the ODS statement, as shown below. -- the statements are color coded so you can see what goes together and what statement is separate. Note that the first statement starts with the keyword ODS and ends with the single semi-colon after the ending parenthesis for the sub-option list.

 

Cynthia

** note that only 1 semi-colon ends the ODS statement;

ODS TAGSETS.ExcelXP file="&ReportOut..xls" Path="&OutDir" style = styles.rtf

  options(sheet_interval= 'None'

          sheet_name= 'Rows 1 - 16'

          Orientation= 'landscape'

          Frozen_Headers = '1'

          CENTER_HORIZONTAL = 'yes'

          scale = '80'

          ROW_REPEAT = '1'

          CENTER_HORIZONTAL = 'yes'

          EMBEDDED_TITLES = "No"

          EMBEDDED_FOOTNOTES = "YES"

          GRIDLINES ="YES"

          AutoFit_Height = 'YES')  /* beginning ODS Statement*/

   

Title1 "&Investor_Nme for &mm_name1" ;  /* separate TITLE statement */

  

***....your code goes here.....;  /* all your code with step boundaries goes here */

    

ODS TAGSETS.ExcelXP CLOSE;   /* ending ODS Statement */

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 9317 views
  • 0 likes
  • 3 in conversation