SELECT_QUEUE Open Data Interface (ODI) Data Source Defintion Routines For RALLY Applications Julianne de Dufour 36 Country Walk Huntington, CT 06484 (203) 925-1361 1. Introduction The SELECT_QUEUE Open Data Interface Data Source Definition is a DSD which has as its record values the names of every defined generic and terminal print queue on the current VMS system. With it, you can create a LOV in your RALLY application which contains a list of these print queues. You can then use this LOV to allow your users to select the destination print queue for the RALLY 'print ...' commands, and for form/reports which are called in PRINT mode, without needing to worry about defining a logical name SYS$PRINT with their choice of print queues. You can also set it up so that users can redirect print output from anywhere within the application -- even while in the middle of a form/report. 2. About the Sources The SELECT_QUEUE ODI is written in FORTRAN. The SELECT_QUEUE suite contains the following files: SELECT_QUEUE_GET_RECORD.FOR - the source for the GET_RECORD ODI routine. SELECT_QUEUE_INITIALIZE.FOR - the source for the INITIALIZE ODI routine. SELECT_QUEUE_TERMINATE.FOR - the source for the TERMINATE ODI routine. SELECT_QUEUE_STRUCTURE.FOR - a FORTRAN text include file containing definitions used in all three routines. SELECT_QUEUE_RECORD.CDO - the CDD/Plus record definition for the ODI's data record. SELECT_QUEUE_VECTORS.MAR - a transfer vector table for the resulting shareable image (required by RALLY). SELECT_QUEUE.OPT - the link options file used to create the shareable image. SELECT_QUEUE_BUILD.COM - a command procedure which you can use to build the image on your system. * You must have FORTRAN, the RALLY Development Option, and CDD/Plus installed to use this procedure. * SELECT_QUEUE.EXE - the shareable image containing the ODI routines, linked under VMS V5.5. COMMERCE.RGA - a V2.3 RALLY application based on the sample application RALLY$COMMERCE, including SELECT_QUEUE_DSD and a form/report which utilizes it. 3. Creating the SELECT_QUEUE Shareable Image The SELECT_QUEUE.EXE shareable image comes with this suite, but in case you want to or need to recreate it, SELECT_QUEUE_BUILD.COM may be used. SELECT_QUEUE_BUILD.COM creates the CDD/Plus record definition SELECT_QUEUE_RECORD in the current default dictionary, compiles and assembles the source code, and links the image. It expects all the source files to be in the same directory, which you may specify by passing a directory specification through p1. If you leave p1 blank, the procedure defaults to the current directory. The procedure builds the shareable image into the current directory by default. You may change this by supplying a directory specification in the p2 parameter. For either parameter, you must include enough punctuation to separate the directory string from a filename. For example, you may use a logical name (such as SOURCE_DIR) which evaluates to a directory, but you must include a colon in the parameter (e.g. "SOURCE_DIR:"), or DCL will not be able to interpret the resulting file specifications correctly. 4. Creating the DSD in Your RALLY Application In order to create the ODI DSD, you must have: the CDD/Plus record SELECT_QUEUE_RECORD defined; the SELECT_QUEUE.EXE shareable image created on the system. (It isn't necessary to make a known-file entry for the shareable image, although you may if you want). In addition to having the shareable image on the system, you must declare a logical name for it, including the directory specification, if it is not in SYS$SHARE. If you leave the directory off, RALLY will look for the image in SYS$SHARE. You supply this logical name when defining the ODI DSD, on the "Create an ODI Data Source Definition" form. Edit the collection of routines, where you supply each routine name used. This ODI uses the Initialize, Get Record, and Terminate routines, the names of which are SELECT_QUEUE_INITIALIZE, SELECT_QUEUE_GET_RECORD, and SELECT_QUEUE_TERMINATE, respectively. Leave the others blank. The CDD/Plus data record is the SELECT_QUEUE_RECORD, which you also supply on the "Create an ODI Data Source Definition" form, along with a dictionary pathname, if necessary. The size of the record ID is 4; there is no support for restrictions or rollbacks; and there is no CDD/Plus parameter record. Once you create the DSD, you may use it just like any other type of DSD, with some restrictions: SELECT_QUEUE does not support queries, since there is no Restrict Stream routine defined. You may get unexpected results if you try to execute the DSD in query mode. SELECT_QUEUE is read only, so you cannot use it in a situation where it might be updated. Expect at least a RALLY error, or at worst a RALLY bug check, if you try. SELECT_QUEUE was designed to be used as a source for a LOV. Keep this in mind when including it in your applications, and you shouldn't have any problems. 5. Some Comments The COMMERCE.RGA application included uses the SELECT_QUEUE DSD in a pop-up form/report which allows the user to select a print queue, then goes off and redefines SYS$PRINT to the selection while still in the application. Two ADL procedures help: GET_DEFAULT_QUEUE_ADL, and SET_SELECTED_QUEUE_ADL. If you have RALLY$EXAMPLES:RALLY$COMMERCE.RDB loaded on your system, you may run the application COMMERCE.RGA. All you need to do is have the shareable image SELECT_QUEUE on your system, the logical name SELECT_QUEUE_SHARE defined to point to the file's location, and the logical name RALLY$COMMERCE pointing to the RALLY$COMMERCE database. Use Application_Command 7 from anywhere to call up the pop-up form/report. There is also a menu item "Print_Queues", which calls the form/report by itself. When defining your own LOV based on the SELECT_QUEUE ODI DSD, it's important to force RALLY to read to the end of the LOV, and to re-read the LOV everytime it is used. This is to keep RALLY from starting in the middle of the list of queues when the LOV is used more than once in the same context. Feel free to contact me if you have any problems. Enjoy!