The SAS Output Delivery System and reporting techniques

Invalid Option Name??

Reply
Frequent Contributor
Posts: 123

Invalid Option Name??

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.

Respected Advisor
Posts: 3,768

Re: Invalid Option Name??

This OPTIONS parameter needs to be on the ODS statement.

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

SAS Super FREQ
Posts: 8,646

Re: Invalid Option Name??


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 */

Post a Question
Discussion Stats
  • 2 replies
  • 1572 views
  • 0 likes
  • 3 in conversation