SAS 9.1.3 Integration Technologies » Developer's Guide


Publish Package Interface
Publish/Retrieve Encoding Behavior
Publishing Packages
INSERT_CATALOG
INSERT_DATASET
INSERT_FDB
INSERT_FILE
INSERT_HTML
INSERT_MDDB
INSERT_PACKAGE
INSERT_REF
INSERT_SQLVIEW
INSERT_VIEWER
PACKAGE_BEGIN
PACKAGE_END
PACKAGE_PUBLISH
LDAP Channel Store Syntax
SAS Metadata Repository Channel Store Syntax
Retrieving Packages
COMPANION_NEXT
ENTRY_FIRST
ENTRY_NEXT
PACKAGE_DESTROY
PACKAGE_FIRST
PACKAGE_NEXT
PACKAGE_TERM
RETRIEVE_CATALOG
RETRIEVE_DATASET
RETRIEVE_FDB
RETRIEVE_FILE
RETRIEVE_HTML
RETRIEVE_MDDB
RETRIEVE_NESTED
RETRIEVE_PACKAGE
RETRIEVE_REF
RETRIEVE_SQLVIEW
RETRIEVE_VIEWER
Filtering Packages
Publishing Examples
Publishing in the Data Step
Publishing in a Macro
Publishing with FTP
Publishing Framework

Publish to Queues

Publishes a package to one or more message queues.

Syntax

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

packageID
Numeric, input.
Identifies the package that is to be published.

publishType
Character, input.
Indicates how to publish the package. To publish the package using the queue transport, specify a publishType of TO_QUEUE.

rc
Numeric, output.
Receives a return code.

properties
Character, input.
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:

propValue1, ...propValueN
Character/numeric, input.
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.

queue1 <, ...queueN>
Character string that specifies the queue(s) that will be used to publish the package. Specify the queue name using the following syntax:

When publising 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

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, 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 LDAP URL, an FTP URL, or an HTTP URL, see How to Specify ARCHIVE_PATH for details about specifying archive properties.

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

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

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

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

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