Dictionary of ODS Language Statements |
Valid: | anywhere |
Category: | Data Access |
Requirement: | The destination must specify the PACKAGE option to connect with the package. |
See also: | ODS packages are used primarily with the Publishing Framework. For complete information on the Publishing Framework feature of SAS Integration Technologies, see SAS Publishing Framework: Developer's Guide. |
Syntax | |
Required Arguments | |
Options | |
Details | |
Examples | |
Example 1: Creating an ODS Package | |
Example 2: Listing Package Contents with the ODS DOCUMENT Statement | |
See Also |
Syntax |
ODS PACKAGE (<name>) OPEN <options>; |
ODS PACKAGE (<name>) ADD FILE="file-specification" | DATA=member-specification MIMETYPE=''string" <PATH="path-specification"><options>; |
ODS PACKAGE (<name>) PUBLISH transport PROPERTIES(transport-property-1="value-1" ... transport-property-n="value-n"); |
ODS PACKAGE (<name>) CLOSE <CLEAR>; |
adds a file or data set to an ODS package using the specified Multipurpose Internet Mail Extensions (MIME) type.
Requirement: | When using the ADD argument, you must also use the MIMETYPE=, FILE=, or DATA= arguments to specify a file or data set and a MIME type. |
specifies the file that you want to add to an ODS package.
specifies one of the following:
external-file |
is the name of an external file to add.
| ||
fileref |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref. |
specifies that the file is a text file.
specifies that the file is a binary file.
specifies the data set that you want to add to an ODS package. member-specification can be in the form libname.membername or membername.
Restriction: | You can use the DATA= argument only with the ADD argument. |
Restriction: | You cannot add a file and a data set to an ODS package. |
specifies the Multipurpose Internet Mail Extensions (MIME) type for the file or data set that you are adding to an ODS package.
Restriction: | You can use the MIMETYPE= argument only with the ADD argument. |
creates the ODS package object to which the ODS destinations can connect. The ODS package object holds the package metadata and tracks the locations of any files that are added to the package metadata.
Example: |
The following ODS PACKAGE statement
opens an unnamed package with an abstract and a description.
ods package open abstract="this is my abstract" description="this is description"; |
builds the ODS package and sends it to the chosen delivery transport.
specifies an expiration date for the package. The date must be a SAS date value.
Requirement: | expiration-date must be enclosed in quotation marks. |
deletes the package object. As long as you have not closed a package, you can publish it as many ways and times as you want.
Tip: | Use the CLEAR option to remove files that have been added to the package. |
specifies the deliver transport to use with the PUBLISH action. transport can be one of the following:
publishes a package to an archive. For a list of transport properties and their values, see the section on transport properties in the SAS Publishing Framework: Developer's Guide.
Example: |
The following statement publishes an
ODS package to the archive Test.spk:
ods package publish archive properties(archive_path="./" archive_name="test.spk"); |
publishes a package to one or more e-mail addresses. For a list of transport properties and their values, see the section on transport properties in the SAS Publishing Framework: Developer's Guide.
publishes a package to one or more message queues. For a list of transport properties and their values, see the section on transport properties in the SAS Publishing Framework: Developer's Guide.
publishes a package to subscribers who are associated with the specified channel. For a list of transport properties and their values, see the section on transport properties in the SAS Publishing Framework: Developer's Guide.
publishes a package to a WebDAV-compliant server. For a list of transport properties and their values, see the section on transport properties in the SAS Publishing Framework: Developer's Guide.
specifies a string for the abstract metadata of the package or file.
Restriction: | You can use the ABSTRACT= option only with the ADD or OPEN arguments. |
specifies that all files that were automatically added to the package will be removed from the location to which ODS wrote them.
Restriction: | You can use the CLEAR option only with the CLOSE argument. |
specifies a string for the description metadata for the package or file.
Restriction: | You can use the DESCRIPTION= option only with the ADD or OPEN arguments. |
specifies the name of a package. Naming a package enables you to open more than one package at a time. Each destination can connect with any package by specifying the package name in the same way.
Requirement: | You must place name directly after the PACKAGE keyword in the ODS PACKAGE statement. |
Requirement: | name must be enclosed in parenthesis. |
specifies a string of name/value pairs for the name/value metadata on the package or file.
Restriction: | The NAMEVALUE= option can be used only with the ADD or OPEN arguments. |
places the file or data set at the specified pathname within an ODS package.
specifies the name of a package template to use.
Restriction: | You can use the TEMPLATE= option only with the ADD or OPEN arguments. |
Details |
A package is a container for digital content that is generated or collected for delivery to a consumer. ODS packages allow ODS destinations to use the SAS Publishing Framework. An ODS package is an object that contains output files and data sets that are associated with any open ODS destinations. ODS packages hold the package metadata and track the output from any active destinations that connect to it. After the destinations are closed, the package can be published to any of the publish destinations. You can continue to use the package, or you can close it. A package remains active until explicitly closed.
Examples |
The following example creates a simple ODS package. The package is created in your default directory, if you do not specify a different directory.
ods listing close; goptions dev=gif xpixels=480 ypixels=320; |
ods package open; ods html package; |
proc gplot data=sashelp.class; plot height*weight; by name; run; quit; ods html close; |
ods package publish archive properties(archive_name="SimpleExample.zip" archive_path="./"); ods package close; |
Simple ODS Package
In the following program, PROC DOCUMENT imports the archive SimpleExample.zip into a PROC DOCUMENT package named myPackage.You can then use PROC DOCUMENT to list the contents and details of the package.
ods listing; |
proc document name=archive; import archive="SimpleExample.zip" to myPackage; list/levels=all; run; |
dir myPackage; list 'sashtml.htm'n/details; run; quit; |
Listing of Work.Archive and Details of HTM File
The SAS System Listing of: \Work.Archive\ Order by: Insertion Number of levels: All Obs Path Type ---------------------------------------------------------------- 1 \myPackage#1 Dir 2 \myPackage#1\'sashtml.htm'n#1 File 3 \myPackage#1\'gplot.gif'n#1 File 4 \myPackage#1\'gplot1.gif'n#1 File 5 \myPackage#1\'gplot2.gif'n#1 File 6 \myPackage#1\'gplot3.gif'n#1 File 7 \myPackage#1\'gplot4.gif'n#1 File 8 \myPackage#1\'gplot5.gif'n#1 File 9 \myPackage#1\'gplot6.gif'n#1 File 10 \myPackage#1\'gplot7.gif'n#1 File 11 \myPackage#1\'gplot8.gif'n#1 File 12 \myPackage#1\'gplot9.gif'n#1 File 13 \myPackage#1\'gplot10.gif'n#1 File 14 \myPackage#1\'gplot11.gif'n#1 File 15 \myPackage#1\'gplot12.gif'n#1 File 16 \myPackage#1\'gplot13.gif'n#1 File 17 \myPackage#1\'gplot14.gif'n#1 File 18 \myPackage#1\'gplot15.gif'n#1 File 19 \myPackage#1\'gplot16.gif'n#1 File 20 \myPackage#1\'gplot17.gif'n#1 File 21 \myPackage#1\'gplot18.gif'n#1 File The SAS System Listing of: \Work.Archive\myPackage#1\'sashtml.htm'n#1 Order by: Insertion Number of levels: 1 Size Type in Bytes Created Modified Symbolic Link Template ---------------------------------------------------------------- File 4762 17OCT2008:14:32:52 17OCT2008:14:32:52 Label ---------------------------------------------------------------- MARKUP, Proc, Gplot, GPLOT, Plot of Height by Weight, GPLOT1, Plot of Height by Weight, GPLOT2, Plot of Height by Weight, GPLOT3, Plot of Height by Weight, GPLOT4, Plot of Height by Weight, GPLOT5, Plot of Height by Weight, GPLOT6, Plot of Height by Weigh
See Also |
SAS Publishing Framework: Developer's Guide
Transport properties in the SAS Publishing Framework: Developer's Guide
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.