SAS Institute. The Power to Know

SAS(R) 9.2 Output Delivery System: User's Guide

Previous Page | Next Page

Dictionary of ODS Language Statements

ODS PACKAGE Statement



The ODS PACKAGE statement opens, adds to, publishes, or closes one SAS Output Delivery System (ODS) package object.
Valid: anywhere
Category: Data Access

Syntax
Arguments
Options
Details

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>;


Arguments

ADD

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.
FILE="file-specification"

specifies the file that you want to add to an ODS package. file-specification is one of the following:

external-file

is the name of an external file to add.

Requirement: You must enclose external-file in quotation marks.
fileref

is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.

Example: Use the following statement to add the Test.Sas file as plain text to the ODS package directory SAS:
ods package add file="test.sas" mimetype="text/plain" path="sas/"; 
Restriction: You can use the FILE= argument only with the ADD argument.
Restriction: You cannot add a file and a data set to an ODS package.
DATA=member-specification

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.
MIMETYPE=''string"

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.
OPEN

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";
PUBLISH

builds the ODS package and sends it to the chosen delivery transport.

CLOSE

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.
transport

specifies the deliver transport to use with the PUBLISH action. transport can be on of the following:

ARCHIVE PROPERTIES(transport-property-1="value-1"... transport-property-n="value-n"")

publishes a package to an archive. For a list of transport properties and their values, see the section on transport properties in SAS Integration Technologies Developer's Guide at http://support.sas.com/rnd/itech/doc9/dev_guide/app/pkgintf/pkg_publ.html.

Example: The following statement publishes an ODS package to the archive Test.spk:
ods package publish archive  properties(archive_path="./" 
     archive_name="test.spk");
EMAIL PROPERTIES(transport-property-1="value-1" . . . transport-property-n="value-n") ADDRESSES("e-mail-address-1" . . . "e-mail-address-n")

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 SAS Integration Technologies Developer's Guide at http://support.sas.com/rnd/itech/doc9/dev_guide/app/pkgintf/pkg_publ.html.

Example: The following statement publishes an ODS package to the email addresses your.email@company.com and your.second.email@company.com:
ods package publish email  addresses("your.email@company.com" 
     "your.second.email@company.com") 
    properties(archive_name="testPackage" archive_path="./"); 
QUEUE PROPERTIES(transport-property-1="value-1" . . . transport-property-n="value-n") QUEUES("queue-1" . . . "queue-n")

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 SAS Integration Technologies Developer's Guide at http://support.sas.com/rnd/itech/doc9/dev_guide/app/pkgintf/pkg_publ.html.

SUBSCRIBERS PROPERTIES(transport-property-1="value-1" . . . transport-property-n="value-n")

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 SAS Integration Technologies Developer's Guide at http://support.sas.com/rnd/itech/doc9/dev_guide/app/pkgintf/pkg_publ.html.

WEBDAV PROPERTIES(transport-property-1="value-1" . . . transport-property-n="value-n")

publishes a package to a WebDAV-compliant server. For a list of transport properties and their values, see the section on transport properties in SAS Integration Technologies Developer's Guide at http://support.sas.com/rnd/itech/doc9/dev_guide/app/pkgintf/pkg_publ.html.


Options

ABSTRACT=string

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.
CLEAR

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.
DESCRIPTION=string

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.
(name)

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.
NAMEVALUE="<name-1="value-1" . . . name-n="value-n">"

specifies a string of name/value pairs for the name/value metadata on the package or file.

Restriction: The NAMEVALUE= option can only be used with the ADD or OPEN arguments.
PATH="path-specification"

places the file or data set at the specified pathname within an ODS package.

Restriction: You can use the PATH= option only with the ADD argument.
Example: Use the following statement to add the Test.Sas file as plain text to the ODS package directory SAS:
ods package add file="test.sas" mimetype="text/plain" path="sas/"; 
TEMPLATE=

specifies the name of a package template to use.

Restriction: You can use the TEMPLATE= option only with the ADD or OPEN arguments.

Details

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.

Previous Page | Next Page | Top of Page