| Publishing Packages |
Syntax |
| CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties,<propValue1, ...propValueN>, queue1<, ...queueN>); |
identifies the package that is to be published.
| Type: | Numeric |
| Direction: | Input |
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 |
receives a return code.
| Type: | Numeric |
| Direction: | Output |
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
| Type: | Character |
| Direction: | 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.
| Type: | Character or Numeric |
| Direction: | Input |
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\queueNameWhen publishing to MQSeries queues, use the following syntax:
MQSERIES://queueManager:queueNameor
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]](../../../../common/61991/HTML/default/images/cautend.gif)
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 |
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);
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);
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);
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.