Publish Package Interface |
This CALL routine retrieves descriptive header information for all packages.
CALL RETRIEVE_PACKAGE(pkgListId, retrievalType, retrievalInfo, totalPackages, rc<, properties, propValue1, propValueN>);
MSMQ://queueHostMachineName\queueNameWhen retrieving from MQSeries queues, use the following syntax:
MQSERIES://queueManager:queueNameor
MQSERIES-C://queueManager:queueName
a="http://www.host.com/myNamespace" A="http://www.host.com/myNamespace1" B="http://www.host.com/myNamespace2"
When retrieving FROM_QUEUE, this CALL routine retrieves descriptive header information for all packages that are found on the specified queue. The total number of packages found is returned. The descriptive header information for each package can be obtained by executing the PACKAGE_FIRST and PACKAGE_NEXT CALL routines.
When retrieving from the queue transport, no entries or packages are removed or deleted from the queue. Packages may be removed by calling the PACKAGE_DESTROY CALL routine.
The ARCHIVE_PATH property identifies where the archive is created. When retrieving from an archive, the name of the archive can be specified as a physical path name, an LDAP URL, an FTP URL, or an HTTP URL. The archive entry in LDAP contains attributes that identify the name of the archive to retrieve. Refer to SAS Integration Technologies Administrator for details on the archive LDAP entries.
When retrieving from a WebDAV-compliant server, the name of the archive can be specified as an FTP URL or an HTTP URL.
In the OS/390 operating environment, archives can be retrieved only from UNIX System Services directories.
The following example opens the queue JSMITH and retrieves the descriptive header information for all packages on that queue and the total number of packages on the queue.
plist=0; qname = "MQSERIES://LOCAL:JSMITH"; rc=0; total=0; nameValue=''; CALL RETRIEVE_PACKAGE(plist, "FROM_QUEUE", qname, total, rc);
The following example retrieves the archive named STATUS.
plist=0; archiveName = "/maintenance/status"; rc=0; total=0; CALL RETRIEVE_PACKAGE(plist, "FROM_ARCHIVE", archiveName, total, rc);
The following example retrieves the package from WebDAV using the specified URL.
plist=0; url = "http://AlpineAirways.host.com/~flights"; rc=0; total=0; property='namespaces'; ns="homePage='http://AlpineAirs.com/'"; CALL RETRIEVE_PACKAGE(plist, "FROM_WEBDAV", url, total, rc, property, ns);
The following example applies a queue polling timeout value of 120 seconds. The RETRIEVE routine seeks packages on the queue until at least one package is located or the 120-second timeout expires, whichever occurs first.
plist=0; qname = "MQSERIES://LOCAL:JSMITH"; rc=0; total=0; nameValue=''; prop='queue_timeout'; timeout = 120; CALL RETRIEVE_PACKAGE(plist, "FROM_QUEUE", qname, total, rc, prop, timeout);
The following example uses an LDAP URL to retrieve the archive. The LDAP URL is
the sasArchive
distinguished name.
plist=0; archiveName = "ldap://pcc.host.com:389/sasarchivecn=weekOne,saschannelcn=HR, cn=saschannels,sasComponent=sasPublishSubscribe,cn=SAS, o=Alpine Airways,c=US"; rc=0; total=0; CALL RETRIEVE_PACKAGE(plist, "FROM_ARCHIVE", archiveName, total, rc);
The following example is a SAS program that extracts entries from an archive. The RETRIEVE_PACKAGE routine opens the archive file and retrieves the headers for all package entries. Subsequent RETRIEVE routines are called to retrieve the contents of the entries (in this example, data sets, catalogs, and MDDBs) and to dispose of them appropriately.
data _null_; length description nameValue type userSpec msg $255; length libname $8; length memname $32; call retrieve_package(pid,"FROM_ARCHIVE","AlpineAir",tp,rc); do while (rc = 0); call entry_next(pid,eid,type,userSpec,description,nameValue,rc); if (rc = 0) then select (type); when ("DATASET") call retrieve_dataset(eid,libname,memname,rc); when ("CATALOG") call retrieve_catalog(eid,libname,memname,rc); when ("MDDB") call retrieve_mddb(eid,libname,memname,rc); otherwise; end; end; call package_term(pid,rc); run;
Publish Package Interface |