Your program can connect either to a specific queue manager or to the default queue manager. In both cases, the queue manager must be local to the task. You can connect to a queue manager in several different ways.
Sample Application 1: If you instantiated AbtMQqm, you can connect to the queue manager as follows:
| result | "Sample App 1: connecting to the queue manager instantiated in step 1 and verifying the connection" (result := aQueueManager connect) isAbtError ifTrue: [Transcript show: 'Error making connection']. "Establish your queue name and the queue manager instance" (aQueue := AbtMQqueue new) name: 'MYUSERID.QUEUE1'; queueManager: aQueueManager.
Sample Application 2: If you used AbtMQSeriesConnectionSpec in step 1, then you'll want to connect to the queue manager as follows:
| result | "Sample App 2: instantiating the connection" anMQConnection := AbtMQConnection new. "Connect to the queue manager established in step 1 and verify the connection" (result := anMQConnection connectUsing: anMQConnectionSpec) isAbtError ifTrue: [Transcript cr; nextPutAll: ('Connect error: ', result codesAsString). ^nil].
Either way of connecting to the queue manager is appropriate. When using AbtMQqm, you supply the queue information in the second step. When using AbtMQSeriesConnectionSpec, you supply the queue information in the first step and then connect using that specification. When you use the connectUsing: method in association with a connection specification, the queue is opened for you automatically.
For OS/400, the queue manager name is converted from ASCII to EBCDIC prior to making the connetion to the queue manager. All other names, such as queue names, must be converted to the CCSID of the job. You can do this using the toJobEncoding: class method in EsStringConverter.