Using the Publish Package Interface

The Publish Package Interface consists of SAS CALL routines that enable you to write SAS programs, including stored processes, that create, populate, publish, and retrieve collections of information known as packages.
The process of publishing a package follows:
  1. A package is created by using the PACKAGE_BEGIN CALL routine. For example,
    CALL PACKAGE_BEGIN(packageId, desc, nameValue, rc);
    This CALL routine assigns a name to the package and any optional name/value pairs that are associated with it. Name/value pairs are used to assign metadata to a package or individual package entries. This metadata enables you to create filters that aid in information retrieval. The filters can be used both by subscribers to channels and by programs that search the package archive.
  2. A package is populated by adding package entries by using the INSERT_* CALL routines. An entry can be a SAS file (for example, data set, catalog, or SAS MDDB), or almost any other type of file, including HTML and images. CALL routines fall into two categories of item types: For example,
    CALL INSERT_DATASET(packageId, libname, memname, description, NameValue, rc);
    You can also nest packages by including a package as an entry in another package. Entries are referenced in the order in which they were added to the package.
    Note: If inserting HTML file entries, see Publish and Retrieve Encoding Behavior.
  3. A package is published to a delivery transport by using the PACKAGE_PUBLISH CALL routine. Supported transports are archives, e-mail addresses, message queues, SharePoint, subscribers to a pre-defined channel, and WebDAV-Compliant servers. CALL routines for supported transports are as follows:
    For example,
    publishType = "TO_ARCHIVE" 
    CALL PACKAGE_PUBLISH (packageId, publishType, rc, properties, archivePath, 
  4. The end of the published package is defined by using the PACKAGE_END CALL routine. For example,
    CALL PACKAGE_END(packageId, rc);