Dictionary of ODS Language Statements |
Syntax |
ODS MARKUP <(<ID=>identifier)> <action>; |
ODS MARKUP <(<ID=>identifier)> <option(s)><TAGSET=tagset-name> <action>; |
An action is one of the following:
closes the destination and any files that are associated with it.
Tip: | When an ODS destination is closed, ODS does not send output to that destination. Closing an unneeded destination conserves system resources. |
Feature in: | All examples |
excludes one or more output objects from the destination.
Default: | NONE |
Restriction: | A destination must be open for this action to take effect. |
Main discussion: | ODS EXCLUDE Statement |
selects output objects for the specified destination.
Default: | ALL |
Restriction: | A destination must be open for this action to take effect. |
Main discussion: | ODS SELECT Statement |
writes the current selection or exclusion list for the destination to the SAS log.
Restriction: | A destination must be open for this action to take effect. |
See also: | ODS SHOW Statement |
Tip: | If the selection or exclusion list is the default list (SELECT ALL), then SHOW also writes the entire selection or exclusion list. For information about selection and exclusion lists, see Selection and Exclusion Lists. |
Task | Option | |
---|---|---|
Specify a unique base name for the anchor tag that identifies each output object in the current body file |
ANCHOR= |
|
Specify which applet to use to view ODS HTML output |
ARCHIVE= |
|
Specify attributes to write between the tags that generate dynamic graphics output |
ATTRIBUTES= |
|
Specify text to use as the first part of all links and references that ODS creates in output files |
BASE= |
|
Open a markup family destination and specify the file that contains the primary output that is created by the ODS statement |
BODY= |
|
Specify the character set to be generated in the META declaration for the HTML output |
CHARSET= |
|
Open the HTML destination and specify that the file that contains relevant style information |
CODE= |
|
Create a file path that can be used by the GOPTIONS devices |
CODEBASE= |
|
Open the HTML destination and specify the file that contains a table of contents for the output |
CONTENTS= |
|
Specify a device for the output destination |
DEVICE= |
|
Override the encoding for input or output processing (transcodes) of external files |
ENCODING= |
|
Specify an event and the value for event variables that is associated with the event |
EVENT= |
|
Specify the file that integrates the table of contents, the page contents, and the body file |
FRAME= |
|
Control the location where footnotes are printed in the graphics output |
GFOOTNOTE
| NOGFOOTNOTE |
|
Specify the location for all graphics output that is generated while the destination is open |
GPATH= |
|
Control the location where titles are printed in the graphics output |
GTITLE
| NOGTITLE |
|
Specify HTML tags to place between the <HEAD> and </HEAD> tags in all the files that the destination writes to |
HEADTEXT= |
|
Open multiple instances of the same destination at the same time |
ID= |
|
Specify the image resolution for graphical output |
IMAGE_DPI
= |
|
Specify HTML code to use as the <META> tag between the <HEAD> and </HEAD> tags in all the HTML files that the destination writes to |
METATEXT= |
|
Create a new body file at the specified starting point |
NEWFILE= |
|
Specify tagset-specific suboptions and a named value |
OPTIONS |
|
Specify that the output from the destination be added to an ODS package |
PACKAGE |
|
Open the HTML destination and specify the file that contains a description of each page of the body file, and contains links to the body file |
PAGE= |
|
Write the specified parameters between the tags that generate dynamic graphics output |
PARAMETERS= |
|
Specify the location of an aggregate storage location or a SAS catalog for all markup files |
PATH= |
|
Specify an alternative character or string to separate lines in the output files |
RECORD_SEPARATOR= |
|
Specify a style definition to use in writing output files |
STYLE= |
|
Open the HTML destination and place style information for output into an external file, or read style sheet information from an existing file |
STYLESHEET= |
|
Specify a keyword value for a tagset. A tagset is a template that defines how to create a markup language output type from a SAS format. |
TAGSET= |
|
Insert text into your document |
TEXT= |
|
Insert into the metadata of a file, a text string that you want to specify as the text to appear in the browser window title bar |
TITLE= |
|
Specify a translation table to use when transcoding a file for output |
TRANTAB= |
specifies a unique base name for the anchor tag that identifies each output object in the current body file.
Each output object has an anchor tag for the contents, page, and frame files to reference. The links and references, which are automatically created by ODS, point to the name of an anchor. Therefore, each anchor name in a file must be unique.
is the base name for the anchor tag that identifies each output object in the current body file.
ODS creates unique anchor names by incrementing the name that you specify. For example, if you specify ANCHOR= 'tabulate', then ODS names the first anchor tabulate. The second anchor is named tabulate1; the third is named tabulate2, and so on.
The ARCHIVE= option is valid only for the GOPTIONS java device. The ARCHIVE= option enables you to specify which applet to use in order to view the ODS HTML output.
The string must be one that the browser can interpret. For example, if the archive file is local to the computer that you are running SAS on, you can use the FILE protocol to identify the file. If you want to point to an archive file that is on a web server, use the HTTP protocol.
writes the specified attributes between the tags that generate dynamic graphics output.
specifies the name and value of each attribute. attribute-pair has the following form:
'attribute-name'= 'attribute-value' |
Requirement: | You must enclose attribute-name and attribute-value in quotation marks. |
Specifies the text to use as the first part of all links and references that ODS creates in the output files.
is the text that ODS uses as the first part of all links and references that ODS creates in the file.
BASE= 'http://www.your-company.com/local-url/'In this case, ODS creates links that begin with the string http://www.your-company.com/local-url/. The appropriate anchor-name completes the link.
Requirement: | You must enclose base-text in quotation marks. |
opens a markup family destination and specifies the file that contains the primary output that is created by the ODS statement. These files remain open until you do one of the following:
close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
open the same destination with a second markup family statement. This closes the first file and opens the second file.
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
is the name of an external file to write to.
Requirement: | You must enclose external-file in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
Restriction: | The BODY=fileref option cannot be used in conjunction with the NEWFILE= option. |
See: | For information about the FILENAME statement, see SAS Language Reference: Dictionary. |
specifies an entry in a SAS catalog to write to.
Interaction: | If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option. |
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. For a list of suboptions, see Suboptions.
Note: For some values of TAGSET=, this output will be an HTML file, for other TAGSET= values, the output will be an XML file, and so on.
Alias: | FILE= |
Interaction: | If you use the BODY= option in an ODS markup family statement that refers to an open ODS markup destination, the option will force ODS to close the destination and all files associated with it, and then to open a new instance of the destination. For more information see Opening and Closing the MARKUP Destination. |
Featured in: | All examples |
specifies the character set to be generated in the META declaration for the HTML output.
See: | For information about the CHARSET option, see SAS National Language Support (NLS): Reference Guide. |
opens a markup family destination and specifies the file that contains relevant style information, such as XSL (Extensible Stylesheet Language). These files remain open until you do one of the following:
close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
open the same destination with a second markup family statement. This closes the first file and opens the second file.
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
is the name of an external file to write to.
Requirement: | You must enclose external-file in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See: | For information about the FILENAME statement, see SAS Language Reference: Dictionary. |
specifies an entry in a SAS catalog to write to.
Interaction: | If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option. |
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. For a list of suboptions, see Suboptions.
specifies the location of the executable Java applet or the ActiveX control file. string is specified as a pathname or as a URL. The CODEBASE file path option has two definitions, depending on the GOPTIONS device used.
When you generate Web presentations with the JAVA and ActiveX device drivers, SAS generates HTML pages that automatically look for the JAVA archive files or the ActiveX control file in the default installation location.
If you use the ActiveX device driver with ODS to generate output containing an ActiveX control, then specify the CODEBASE= option in the ODS statement. The value of the CODEBASE= option should include the location and the version of the EXE file.
Tip: | You do not need to specify the CODEBASE= option with the DEVICE=ACTIVEX option unless the users that view your output do not have the ActiveX control installed on their machine. When users that do not have the control installed view your output, they are prompted to download the control. |
See also: | SAS/GRAPH: Reference for information on specifying the location of control and applet files using the CODEBASE= and ARCHIVE= options. |
If you use the Java device driver with ODS to generate output containing a SAS/GRAPH applet, specify the path to the JAR file with the CODEBASE= option in the ODS statement.
When you specify DEVICE=JAVA, the users that view your output must have access to the appropriate Java applet. By default, SAS sets the value of CODEBASE= to refer to the executable file for the applet that is automatically installed with SAS. The default location of the SAS Java archive files is specified by the APPLETLOC= system option. If the default location is accessible by users who will be viewing your Web presentation, and the SAS Java archive is installed at that location, then you do not need to specify the CODEBASE= option.
Tip: | Specify only the directory of the JAR file. The CODEBASE= location can be specified as a pathname or as a URL |
See also: | SAS/GRAPH: Reference for information on specifying the location of control and applet files using the CODEBASE= and ARCHIVE= options. |
opens a markup family destination and specifies the file that contains a table of contents for the output. These files remain open until you do one of the following:
close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
open the same destination with a second markup family statement. This closes the first file and opens the second file.
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
is the name of an external file to write to.
Requirement: | You must enclose external-file in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See: | For information about the FILENAME statement, see SAS Language Reference: Dictionary. |
specifies an entry in a SAS catalog to write to.
Interaction: | If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option. |
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. For a list of suboptions, see Suboptions.
specifies a cascading style sheet to apply to your output.
specifies a file, fileref, or URL that contains CSS code..
file-specification is one of the following:
is the name of the external file.
Requirement: | You must enclose external-file in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See: | For information about the FILENAME statement, see SAS Language Reference: Dictionary. |
is a URL to an external file.
Requirement: | You must enclose external-file in quotation marks. |
specifies one or more media blocks that corresponds to the type of media that your output will be rendered on. CSS uses media type blocks to specify how a document is to be presented on different media: on the screen, on paper, with a speech synthesizer, with a braille device, and so on.
The media block is added to your output in addition to the CSS code that is not contained in any media blocks. By using the media-type suboption, in addition to the general CSS code, you can import the section of a CSS file intended only for a specific media type.
Default: | If no media-type is specified in your ODS statement, but you do have media types specified in your CSS file, then ODS uses the Screen media type. |
Range: | You can specify up to ten different media types. |
Requirement: | You must enclose media-type in parentheses. |
Requirement: | You must specify media-type next to the file-specification specified by the CSSSTYLE= option. |
Tip: | If you specify multiple media types, all of the style information in all of the media types is applied to your output. However, if there is duplicate style information in different media blocks, then the styles from the last media block are used. |
Interaction: | If both the STYLE= option and the CSSSTYLE= option are specified on an ODS statement, the option specified last it the option that is used. |
Requirement: | CSS files must be written in the same type of CSS produced by the ODS HTML statement. Only class names are supported, with no IDs and no context based selectors. To view the CSS code that ODS creates, you can specify the STYLESHEET= option, or you can view the source of an HTML file and look at the code between the <STYLE> </STYLE> tags at the top of the file. For an example of a valid for ODS CSS file, see Applying a CSS File to ODS Output. |
Featured in: | Applying a CSS File to ODS Output |
specifies the name of a device driver. ODS automatically selects an optimal default device for each open output destination.
The following table lists default devices for the most common ODS output destinations.
Tip: | Specifying a device on the ODS DEVICE= option takes precedence over the SAS global option and the graphics option. |
See: | DEVICE= System Option in SAS Language Reference: Dictionary. See Device Drivers in SAS/GRAPH: Reference for information on selecting device drivers. |
overrides the encoding for input or output processing (transcodes) of external files.
See: | For information about the ENCODING= option, see SAS National Language Support (NLS): Reference Guide. |
specifies an event and the value for event variables that are associated with the event.
triggers one of the known types of output files that correspond to the BODY=, CODE=, CONTENTS=, FRAME=, PAGES=, and STYLESHEET= options.
triggers the finish section of an event.
See: | For information about events, see Understanding Events. |
specifies the value for the LABEL event variable.
Requirement: | variable-value must be enclosed in quotation marks. |
See: | For information about the LABEL event variable, see Event Variables. |
specifies the value for the NAME event variable.
Requirement: | variable-value must be enclosed in quotation marks. |
See: | For information about the NAME event variable, see Event Variables. |
triggers the start section of an event.
See: | For information about events, see Understanding Events. |
specifies a style element.
See: | For information about style elements, see Style Attributes and Their Values. |
specifies the value for the TARGET event variable.
Requirement: | variable-value must be enclosed in quotation marks. |
See: | For information about the TARGET event variable, see Event Variables. |
specifies the value for the TEXT event variable.
Requirement: | variable-value must be enclosed in quotation marks. |
See: | For information about the TEXT event variable, see Event Variables. |
specifies the value for the URL event variable.
Requirement: | variable-value must be enclosed in quotation marks. |
See: | For information about the URL event variable, see Event Variables. |
Default: | (FILE='BODY') |
Requirement: | The EVENT= option's suboptions must be enclosed in parenthesis. |
opens a markup family destination and, for HTML output, specifies the file that integrates the table of contents, the page contents, and the body file. If you open the frame file, then you see a table of contents, a table of pages, or both, as well as the body file. For XLM output, FRAME= specifies the file that contains the DTD. These files remain open until you do one of the following:
close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
open the same destination with a second markup family statement. This closes the first file and opens the second file.
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
is the name of an external file to write to.
Requirement: | You must enclose external-file in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See: | For information about the FILENAME statement, see SAS Language Reference: Dictionary. |
specifies an entry in a SAS catalog to write to.
Interaction: | If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option. |
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. For a list of suboptions, see Suboptions.
Restriction: | If you specify the FRAME= option, then you must also specify the CONTENTS= option, the PAGE= option, or both. |
Featured in: | Creating an XML File and a DTD |
controls the location where footnotes are printed in the graphics output.
prints footnotes that are created by SAS/GRAPH, the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure. The footnotes appear inside the graph borders.
prints footnotes that are created by ODS, which appears outside the graph borders.
specifies the location for all graphics output that is generated while the destination is open. Use this option when you want to write graphics output files to a location different that specified by the PATH= option for markup files. If you specify an invalid filename, the ActiveX and Java devices send output to the default filename. Other devices create the file as a directory and write output to that directory using the default filename. For more information about how ODS names catalog entries and external files, see SAS/GRAPH: Reference.
specifies an aggregate storage location such as directory, folder, or partitioned data set.
Requirement: | You must enclose aggregate-file-storage-location in quotation marks. |
is a file reference that has been assigned to an aggregate storage location. Use the FILENAME statement to assign a fileref. For information about the FILENAME statement, see SAS Language Reference: Dictionary.
Interaction: | If you specify a fileref in the GPATH= option, then ODS does not use information from the GPATH= option when it constructs links. |
specifies a URL for file-specification.
is the URL you specify. ODS uses this URL instead of the filename in all the links and references that it creates to the file.
Requirement: | You must enclose Uniform-Resource-Locator in quotation marks. |
specifies that no information from the GPATH= option appears in the links or references.
Default: | If you omit the GPATH= option, then ODS stores graphics in the location that is specified by the PATH= option. If you do not specify the PATH= option, then ODS stores the graphics in the current directory. For more information, see the PATH= option. |
controls the location where titles are printed in the graphics output.
prints the title that is created by SAS/GRAPH, the SGPLOT procedure, the SGPANEL procedure, or the SGSCATTER procedure. The title appears inside the graph borders
prints the title that is created by ODS, which appears outside of the graph borders.
specifies markup tags to place between the <HEAD> and </HEAD> tags in all the files that the destination writes to.
specifies the markup tags to place between the <HEAD> and </HEAD> tags.
Requirement: | You must enclose markup-document-head in quotation marks. |
enables you to run multiple instances of the same destination at the same time. Each instance can have different options.
specifies another instance of the destination that is already open. identifier is numeric or a series of characters that begin with a letter or an underscore. Subsequent characters can include letters, underscores, and numeric characters.
Restriction: | If identifier is numeric, it must be a positive integer. |
Requirement: | The ID= option must be specified immediately after the ODS MARKUP/TAGSET statement keywords. |
Tip: | You can omit the ID= option, and instead use a name or a number to identify the instance. |
Featured in: | Opening Multiple Instances of the Same Destination at the Same Time |
specifies the image resolution for graphical output.
Restriction: | The IMAGE_DPI= option affects template-based graphics only. |
specifies HTML code to use as the <META> tag between the <HEAD> and </HEAD> tags of all the HTML files that the destination writes to.
specifies the HTML code that provides the browser with information about the document that it is loading. For example, this attribute could specify the content type and the character set to use.
Requirement: | You must enclose metatext-for-document-head in quotation marks. |
creates a new body file at the specified starting-point.
is the location in the output where you want to create a new body file.
ODS automatically names new files by incrementing the name of the body file. In the following example, ODS names the first body file REPORT.XML. Additional body files are named REPORT1.XML, REPORT2.XML, and so on.
BODY= 'REPORT.XML'
starting-point is one of the following:
starts a new body file for each output object. For SAS/GRAPH this means that ODS creates a new file for each SAS/GRAPH output file that the program generates.
Alias: | TABLE |
starts a new body file for each page of output. A page break occurs when a procedure explicitly starts a new page (not because the page size was exceeded) or when you start a new procedure.
starts a new body file each time that you start a new procedure.
See: | GFOOTNOTE | NOGFOOTNOTE options |
See: | GTITLE | NOGTITLE options |
specifies tagset-specific suboptions and a named value.
provides information about the specified tagset.
describes the options available for this tagset.
provides generic help and information with a quick reference.
provides the current option settings.
Requirement: | All values must be enclosed in quotation marks. |
specifies one or more suboptions that are valid for the specified tagset. Supoptions have the following format:
keyword='value' |
Requirement: | The OPTION suboption's must be enclosed in parentheses. |
Featured in: | Using the DOC Suboption to Get ODS TAGSETS.HTMLPANEL Information |
specifies that the output from the destination be added to a package.
specifies the name of a package that was created with the ODS PACKAGE statement. If no name is specified, then the output is added to the unnamed package that was opened last.
See also: | ODS PACKAGE Statement |
Featured in: | Creating an ODS Package |
opens a markup family destination and specifies the file that contains a description of each page of the body file, and contains links to the body file. ODS produces a new page of output whenever a procedure requests a new page. These files remain open until you do one of the following:
close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
open the same destination with a second markup family statement. This closes the first file and opens the second file.
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
is the name of an external file to write to.
Requirement: | You must enclose external-file in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See: | For information about the FILENAME statement, see SAS Language Reference: Dictionary. |
specifies an entry in a SAS catalog to write to.
Interaction: | If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option. |
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. For a list of suboptions, see Suboptions.
writes the specified parameters between the tags that generate dynamic graphics output.
specifies the name and value of each parameter. parameter-pair has the following form:
'parameter-name'= 'parameter-value' |
Requirement: | You must enclose parameter-name and parameter-value in quotation marks. |
specifies the location of an aggregate storage location or a SAS catalog for all markup files. If the GPATH= option is not specified, all graphics output files are written to the "aggregate-file-storage-specification" or libref.
specifies an aggregate storage location such as directory, folder, or partitioned data set.
Requirement: | You must enclose aggregate-file-storage-location in quotation marks. |
is a file reference that has been assigned to an aggregate storage location. Use the FILENAME statement to assign a fileref.
specifies a SAS catalog to write to.
See: | For information about the LIBNAME statement, see SAS Language Reference: Dictionary. |
specifies a URL for the file-specification.
is the URL you specify. ODS uses this URL instead of the filename in all the links and references that it creates to the file.
specifies that no information from the PATH= option appears in the links or references.
Interaction: | If you use the BODY= or FILE= external file option in conjunction with the PATH= option, the external file specification should not include path information. |
specifies an alternative character or string that separates lines in the output files.
Different operating environments use different separator characters. If you do not specify a record separator, then the files are formatted for the environment where you run the SAS job. However, if you are generating files for viewing in a different operating environment that uses a different separator character, then you can specify a record separator that is appropriate for the target environment.
represents one or more characters in hexadecimal or ASCII format. For example, the following option specifies a record separator for a carriage return character and a linefeed character for use with an ASCII file system:
RECORD_SEPARATOR= '0D0A'x
Operating Environment Information: In a mainframe environment, the option that specifies a record separator for a carriage return character and a linefeed character for use with an ASCII file system is:
RECORD_SEPARATOR= '0D25'x
Requirement: | You must enclose alternative-separator in quotation marks. |
produces the markup language that is appropriate for the environment where you run the SAS job.
Operating Environment Information: In a mainframe environment, by default, ODS produces a binary file that contains embedded record separator characters. This binary file is not restricted by the line-length restrictions on ASCII files. However, if you view the binary files in a text editor, then the lines run together.
If you want to format the files so that you can read them with a text editor, then use RECORD_SEPARATOR= NONE. In this case, ODS writes one line of markup language at a time to the file. When you use a value of NONE, the logical record length of the file that you are writing to must be at least as long as the longest line that ODS produces. If the logical record length of the file is not long enough, then the markup language might wrap to another line at an inappropriate place.
Alias: |
|
specifies the style definition to use in writing the output files.
describes how to display the presentation aspects (color, font face, font size, and so on) of your SAS output. A style definition determines the overall appearance of the documents that use it. Each style definition consists of style elements.
Main discussion: | For a complete discussion of style definitions, see TEMPLATE Procedure: Creating a Style Template (Definition). |
Interaction: | The STYLE= option is not valid when you are creating XML output. |
opens a markup family destination and places the style information for markup output into an external file, or reads style sheet information from an existing file. These files remain open until you do one of the following:
close the destination with either an ODS markup-family-destination CLOSE statement or ODS _ALL_ CLOSE statement.
open the same destination with a second markup family statement. This closes the first file and opens the second file.
specifies the file, fileref, or SAS catalog to write to.
file-specification is one of the following:
is the name of an external file to write to.
Requirement: | You must enclose external-file in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
See: | For information about the FILENAME statement, see SAS Language Reference: Dictionary. |
specifies an entry in a SAS catalog to write to.
Interaction: | If you specify an entry name, you must also specify a library and catalog. See the discussion of the PATH= option. |
specifies one or more suboptions in parentheses. Suboptions are instructions for writing the output files. For a list of suboptions, see Suboptions.
Note: By default, if you do not specifically send the information to a separate file, then the style sheet information is included in the specified HTML file.
Featured in: | Including Multiple Cascading Style Sheets in One HTML Document |
specifies a keyword value for a tagset. A tagset is a template that defines how to create a markup language output type from a SAS format. Tagsets produce markup output such as Hypertext Markup Language (HTML), Extensible Markup Language (XML), and LaTeX.
An alternate form for specifying a tagset is as follows:
|
Alias: | TYPE= |
Default: | If you do not specify a TAGSET= value, then the ODS MARKUP statement defaults to XML output. |
Interaction: | If you use the TAGSET= option in an ODS markup family statement that refers to an open ODS markup destination, then the option will force ODS to close the destination and all files associated with it, and then to open a new instance of the destination. For more information, see Opening and Closing the MARKUP Destination. |
Tip: |
SAS provides a set of tagset
definitions. To get a list of the tagset names that SAS supplies, plus any
tagsets that you created and stored in the SASUSER.TMPLMST template store,
submit the following SAS statements:
proc template; list tagsets; run; |
See: | For a list of valid tagsets and their descriptions, see ODS Tagset Statement. |
See also: | For additional information about specifying tagsets, see TEMPLATE Procedure: Creating Markup Language Tagsets. |
Featured in: | Creating an XML File and a DTD, Creating Multiple Markup Output, Specifying Tagset Names As ODS Destinations |
inserts text into your document by triggering the paragraph event and specifying a text string to be assigned to the VALUE event variable.
Default: | By default the TEXT= option is used in a paragraph event. | |
Tip: |
You can specify a text-string for a specific event by using the TEXT= option with the EVENT=
option by using the following syntax:
|
|
Featured in: | Conditionally Excluding Output Objects and Sending Them to Different Output Destinations | |
See also: | For information about events and event variables, see TEMPLATE Procedure: Creating Markup Language Tagsets. |
specifies the translation table to use when transcoding a file for output.
See: | For information about the TRANTAB= option, see SAS National Language Support (NLS): Reference Guide. |
The following suboptions can be used with the BODY=, CODE=, CONTENTS=, FRAME=, PAGE=, and STYLESHEET= options:
specifies that no ending markup language source code be added to the output file or.
Alias: | NOBOT |
Requirement: | You must enclose NO_BOTTOM_MATTER in parentheses. |
Requirement: | You must specify NO_BOTTOM_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option. |
Requirement: | If you append text to an external file you must use a FILENAME statement with the appropriate option for the operating environment. |
Interaction: | The NO_BOTTOM_MATTER suboption, in conjunction with the NO_TOP_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file. |
Interaction: | When you are opening a file that ODS has previously written to, you must use the ANCHOR= option to specify a new base name for the anchors in order to avoid duplicate anchors. |
Tip: | If you want to leave a body file in a state that you can append to with ODS, then use NO_BOTTOM_MATTER with the file-specification in the BODY= option in any markup language statement. |
See also: | NO_TOP_MATTER |
specifies that no beginning markup language source code be added to the top of the output file. For HTML 4.0, the NO_TOP_MATTER option removes the style sheet.
Alias: | NOTOP |
Requirement: | You must enclose NO_TOP_MATTER in parentheses. |
Requirement: | You must specify NO_TOP_MATTER next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option. |
Requirement: | If you append text to an external file you must use a FILENAME statement with the appropriate option for the operating environment. |
Interaction: | The NO_TOP_MATTER suboption, in conjunction with the NO_BOTTOM_MATTER suboption, makes it possible for you to add output to an existing file and then to put your own markup language between output objects in the file. |
Interaction: | When you are opening a file that ODS has previously written to, you must use the ANCHOR= option to specify a new base name for the anchors in order to avoid duplicate anchors. |
See also: | NO_BOTTOM_MATTER and ANCHOR= |
inserts into the metadata of a file, the text string that you specify as the text to appear in the browser window title bar.
is the text in the metadata of a file that indicates the title.
Requirement: | You must enclose TITLE= in parentheses. |
Requirement: | You must enclose title-text in quotation marks. |
Tip: | If you are creating a web page that uses frames, then it is the TITLE= specification for the frame file that appears in the browser window title bar. |
Featured in: | Creating Multiple Markup Output |
specifies a URL for the file-specification. ODS uses this URL (instead of the filename) in all the links and references that it creates and that point to the file.
Requirement: | You must enclose URL= 'Uniform-Resource-Locator' in parentheses. |
Requirement: | You must enclose Uniform-Resource-Locator in quotation marks. |
Requirement: | You must specify URL= 'Uniform-Resource-Locator' next to the file-specification specified by the BODY=, CONTENTS=, PAGE=, FRAME=, or STYLESHEET= option, or next to the tagset-name specified by the TAGSET= option. |
Tip: | This option is useful for building HTML files that can be moved from one location to another. The links from the contents and page files must be constructed with a single name URL, and the contents, page, and body files must all be in the same location. |
Tip: | You never need to specify this suboption with the FRAME= option because ODS files do not reference the frame file. |
Featured in: | Including Multiple Cascading Style Sheets in One HTML Document |
enables you to send output directly to a web server instead of writing it to a file. This option sets the value of the CONTENTTYPE= style attribute. For more information see the CONTENTTYPE= style attribute in PROC TEMPLATE.
Details |
You can modify an open MARKUP destination with many ODS MARKUP options. However, the BODY= and TAGSET= options will automatically close the open destination that is referred to in the ODS MARKUP statement, and will also close any files associated with it, and then will open a new instance of the destination. If you use one of these options, it is best if you explicitly close the destination yourself.
The ODS MARKUP statement opens or closes one destination. Like all single output destinations, you can have only one markup destination open at one time, unless you use the ID= option.
However, you can specify multiple simultaneous ODS destinations to produce multiple markup output by doing both of the following:
specifying some of the TAGSET= value keywords as a destination
specifying any two-level tagset name, such as TAGSETS.PYX, TAGSETS.STYLE_DISPLAY, or one of your own tagset names.
You can specify some tagset keywords as ODS destinations. The tagset determines the type of markup that you will have in your output file. For example, either of the following sets of statements are acceptable:
ods markup body='class.html' tagset=phtml; ...more SAS statements... ods markup close;
| |
ods phtml body='class.html'; ...more SAS statements... ods phtml close; |
The ODS statement that you use to close a destination must be in the same form as the ODS statement that you used to open the destination. Therefore, the following is not acceptable, because SAS considers MARKUP and PHTML as separate destinations.
ods markup body='class.html' tagset=phtml; ...more SAS statements... ods phtml close;
The tagsets that you can specify as both a TAGSET= value for ODS MARKUP or as a separate ODS destination are as follows:
You can open a destination by specifying the markup that you want to produce by naming its two-level tagset name. You can specify all tagsets in this manner. For example, the following ODS statements open the SASIOXML and MYTAGSET destinations. The ODS _ALL_ CLOSE statement closes the SASIOXML and MYTAGSET destinations as well as all other open destinations.
ods tagsets.sasioxml body='test1.xml'; ods tagsets.mytagset body='test2.xml'; ...more SAS statements... ods _all_ close;
You can also specify tagset names as follows, using the TYPE= option with a two-level tagset name:
ods markup type=tagsets.sasioxml body='test.xml';
Examples |
The following ODS MARKUP example creates XML markup from PRINT procedure output. The TAGSET= option for the ODS MARKUP statement is not specified, which defaults to XML output.
ods listing close; |
ods markup body='population.xml'; |
proc print data=statepop; run; |
ods markup close; |
The following partial output is tagged with XML (Extensible Markup Language) tags.
XML Markup from PRINT Procedure Output
<?xml version="1.0" encoding="windows-1252"?> <odsxml> <head> <meta operator="user"/> </head> <body> <proc name="Univariate"> <label name="IDX"/> <title class="SystemTitle" toc-level="1">US Census of Population and Housing</title> <proc-title class="ProcTitle" toc-level="1">The UNIVARIATE Procedure</proc-title> <proc-title class="ProcTitle" toc-level="1">Variable: CityPop_90 (1990 metropolitan pop in millions)</proc-title> <branch name="Univariate" label="The Univariate Procedure" class="ContentProcName" toc-level="1"> <branch name="CityPop_90" label="CityPop_90" class="ContentFolder" toc-level="2"> <leaf name="Moments" label="Moments" class="ContentItem" toc-level="3"> <output name="Moments" label="Moments" clabel="Moments"> <output-object type="table" class="Table"> <style> <border spacing="1" padding="7" rules="groups" frame="box"/> </style> <colspecs columns="4"> <colgroup> <colspec name="1" width="15" type="string"/> <colspec name="2" width="10" align="right" type="string"/> <colspec name="3" width="16" type="string"/> <colspec name="4" width="10" align="right" type="string"/> </colgroup> </colspecs> <output-head> <row> <header type="string" class="Header" row="1" column="1" column-end="4"> <style> <span columns="4"/> </style> <value>Moments</value> </header> </row> </output-head> <output-body> ... more tagged output ... <data raw-value="P8jU/fO2RaI=" name="Low" type="double" class="Data" row="8" column="1"> <value>0.194</value> </data> <data raw-value="QEIAAAAAAAA=" name="LowObs" type="double" class="Data" row="8" column="2"> <value>36</value> </data> <data raw-value="QDboMSbpeNU=" name="High" type="double" class="Data" row="8" column="3"> <value>22.907</value> </data> <data raw-value="QEiAAAAAAAA=" name="HighObs" type="double" class="Data" row="8" column="4"> <value>49</value> </data> </row> </output-body> </output-object> </output> </leaf> </branch> </branch> <footnote class="SystemFooter" toc-level="1">^{super *}This is a ^S={foreground=black}footnote.</footnote> </proc> </body> </odsxml>
The following ODS MARKUP example creates an XML file and its Document Type Definition (DTD) related information document from PROC UNIVARIATE output.
ods listing close; |
ods markup body='statepop.xml' frame='statepop.dtd' tagset=default; |
proc univariate data=statepop; var citypop_90 citypop_80; title 'US Census of Population and Housing'; run; |
ods markup close; |
This DTD specifies how the markup tags in a group of SGML or XML documents should be interpreted by an application that displays, prints, or otherwise processes the documents.
DTD Created by the ODS MARKUP Statement
<!ELEMENT odsxml (head?,body)> <!ELEMENT head (meta|css)*> <!ELEMENT body ((label|page)*|proc)+> <!ELEMENT meta EMPTY> <!ATTLIST meta operator CDATA #IMPLIED author CDATA #IMPLIED> <!ELEMENT css EMPTY> <!ATTLIST css file CDATA #IMPLIED> <!ELEMENT label EMPTY> <!ATTLIST label name ID #IMPLIED> <!ELEMENT proc (title|proc-title|note|page|label|style|branch|output)*> <!ATTLIST proc class CDATA #IMPLIED> ... more tagged output ... <!ELEMENT br EMPTY> <!ELEMENT page EMPTY> <!ELEMENT b (#PCDATA|it|b|ul)*> <!ELEMENT ul (#PCDATA|it|b|ul)*> <!ELEMENT it (#PCDATA|it|b|ul)*> <!ELEMENT style (span|align|border)*> <!ELEMENT span EMPTY> <!ATTLIST span columns CDATA #IMPLIED rows CDATA #IMPLIED> <!ELEMENT align EMPTY> <!ATTLIST align horiz (left|center|right|justify) "left"> <!ELEMENT border EMPTY> <!ATTLIST border rules (none|groups|rows|cols|all) #IMPLIED frame (void|above|below|hsides|lhs|rhs|vsides|box|border) #IMPLIED padding CDATA #IMPLIED spacing CDATA #IMPLIED>
The following ODS example creates two different types of markup output from the same procedure output. To create two markup outputs requires two ODS destinations. Because ODS MARKUP is considered one destination, you cannot specify two tagsets without the use of the ID= option. However, you can specify one output using ODS MARKUP. You can then specify the other output using ODS syntax in which the tagset is the destination.
ods listing close; options obs=15; |
ods csvall body='procprintcsvall.csv'; |
ods markup tagset=chtml body='procprintchtml.html'
(title= 'This Text Identifies Your Content.'); |
title 'Leading Grain-Producing Countries'; proc print data=grain_production; run; |
ods csvall close; ods markup tagset=chtml close; |
CHTML Output
CSVALL Output Viewed in Microsoft Excel
When you specify tagsets and two-level tagset names as destinations, you can open and close multiple destinations, producing multiple markup output. For example:
ods htmlcss body='test1.html'; ods phtml body='test2.html'; ods chtml body='test3.html'; ods markup body='test1.xml'; ods tagsets.event_map body='test2.xml'; ...more SAS statements... ods htmlcss close; ...more SAS statements... ods chtml close; ...more SAS statements... ods _all_ close;
ODS LISTING statement:
| |||||||||||||
ODS HTML statement:
|
OPTIONS statement | |
PROC PRINT | |
TITLE statement |
The following example creates one HTML document and two style sheets which are included in the HTML document. The URLs are created in the order specified by the URL= suboption.
ods listing close; options obs=15; |
ods html body='StylesheetExample.html' stylesheet=(url='/css/file1.css /css/file2.css'); |
proc print data=grain_production; title 'Leading Grain-Producing Countries'; run; |
ods html close; |
HTML Code
ODS HTML statement:
| |||||||||||
ODS PDF statement:
| |||||||||||
ODS RTF statement:
|
PROC CONTENTS |
The following program applies a style sheet created in a CSS file to HTML, PDF, and RTF output. Because the CSS file has media blocks with additional information for screen and print media types, you can specify that each output destination use the additional style information for a specific media type.
proc contents data=sashelp.class; run; |
ods _all_ close; |
HTML Output Using Both a Style Sheet with Screen Media Type
RTF Output Using a Style Sheet with Print Media Type
PDF Output Using Both a Style Sheet with both Print and Screen Media Types
ODS TAGSETS.HTMLPANEL statement:
|
PROC PRINT |
The following example prints to the SAS log the OPTIONS suboptions and a description of each available suboption.
ods tagsets.panel file='Help.html' options (doc="help"); |
proc print data=Sashelp.Class; run; |
ods _all_ close; |
Specify the "DOC='help' suboption to print all of the OPTIONS suboptions and information about each of the suboptions to the SAS log.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.