SAS Institute. The Power to Know

SAS(R) 9.2 Publishing Framework: Developer's Guide

Previous Page | Next Page

Publishing Packages

PACKAGE_PUBLISH (Publish Package to Queues)



Publishes a package to one or more message queues
Syntax
Arguments
Details
Examples
Example 1: Using PACKAGE_PUBLISH to Publish to Two Queues with the CORRELATIONID Property
Example 2: Using PACKAGE_PUBLISH to Publish to a Queue
Example 3: Using PACKAGE_PUBLISH to Publish an Archive to a Queue with the ARCHIVE_PATH Property

Syntax

CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties,<propValue1, ...propValueN>, queue1<, ...queueN>);

Arguments

packageID

identifies the package that is to be published.

Type: Numeric
Direction: Input
publishType

indicates how to publish the package. To publish the package by using the queue transport, specify a publishType of TO_QUEUE.

Type: Character
Direction: Input
rc

receives a return code.

Type: Numeric
Direction: Output
properties

identifies a comma-separated list of optional property names. Specify any of the following property names, or specify '' to indicate that no properties are to be applied:

  • ARCHIVE_NAME

  • ARCHIVE_PATH

  • CORRELATIONID

  • FTP_PASSWORD

  • FTP_USER

  • HTTP_PASSWORD

  • HTTP_PROXY_URL

  • HTTP_USER

For more information about these properties, see Transport Properties.
Type: Character
Direction: Input
propValue1, ...propValueN

specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter.

Type: Character or Numeric
Direction: Input
queue1 <, ...queueN>

character string that specifies the queue(s) that will be used to publish the package. When publishing to MSMQ queues, use the following syntax:

MSMQ://queueHostMachineName\queueName
When publishing to MQSeries queues, use the following syntax:
MQSERIES://queueManager:queueName
or
MQSERIES-C://queueManager:queueName
Type: Character
Direction: Input

Details

When publishing to a queue, all entries in the package are published to the queue by default. To override this default, specify the ARCHIVE_PATH property, which indicates that an archive is to be created and only the archive will be published to the queue. The archive will contain all package entries.

If you specify a value for ARCHIVE_PATH, then the archive is stored at the designated location. To create a temporary archive that is deleted after the package is published, specify an ARCHIVE_PATH value of "" or "tempfile".

If you specify ARCHIVE_PATH as an FTP URL or as an HTTP URL, and need details about specifying archive properties, see PACKAGE_PUBLISH (PublishPackage to Archive).

Note:   In the z/OS operating environment, you can publish archives only to UNIX System Services directories.  [cautionend]

Queues that support transactional units of work are recommended. By using these types of queues, the queue transport prevents partial packages from remaining on the queue in cases where errors are encountered during package publishing. For MSMQ, this means that the queue should be transactional. For MQSeries, this means that the queue should support synchronization points.

When you specify the CORRELATIONID property, the package message uses the specified CORRELATIONID value. You can retrieve packages from the queue by correlation ID.


Examples


Example 1: Using PACKAGE_PUBLISH to Publish to Two Queues with the CORRELATIONID Property

The following example publishes a package to two queues. One queue is an MQSeries queue that is named PCONE; the second queue is an MSMQ queue that is specified by the queue manager, who is named JSMITH. A CORRELATIONID of 12345678901234567890 is assigned to the package to be published to both queues.

PubType = "TO_QUEUE";
FirstQ = "MQSERIES://PCONE:LOCAL";
SecondQ = "MSMQ://JSMITH:TRANSQ";
CorrValue = "12345678901234567890";
Call PACKAGE_PUBLISH(packageId, pubType, rc,
   "CORRELATIONID", CorrValue, firstQ, secondQ);


Example 2: Using PACKAGE_PUBLISH to Publish to a Queue

The following example publishes the package to one queue and does not apply any additional queue properties:

pubType = "TO_QUEUE";
firstQ = "MQSERIES://PCONE:MYQ";
Call PACKAGE_PUBLISH(packageId,
   pubType, rc, '', firstQ);


Example 3: Using PACKAGE_PUBLISH to Publish an Archive to a Queue with the ARCHIVE_PATH Property

The following example creates an archive and publishes it to a queue. The ARCHIVE_PATH property is specified as "tempfile". After the archive is published to the queue, the temporary, local copy is deleted automatically. The archive contains all entries that are inserted into the package.

pubType = "TO_QUEUE";
firstQ = "MQSERIES://PCONE:MYQ";
prop = "ARCHIVE_PATH";
archivePath = "tempfile";
Call PACKAGE_PUBLISH(packageId, pubType,
   rc, prop, archivePath, firstQ);

Previous Page | Next Page | Top of Page