HPlogo QUERY/V Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 QUERY/V COMMANDS

OUTPUT=

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

Selects the output device for the FORM, HELP, DISPLAY, LIST, REPORT, and VERSION commands.

Syntax

   O[UTPUT]= {TERM

              LP}

For example:

   >OUTPUT=LP



   >O=TERM

Options

TERM

indicates that output is to be displayed on the device specified as $STDLIST. ($STDLIST is normally a terminal in session mode and a line printer in job mode.)

LP

indicates that output is to be sent to the file designated as QSLIST. QSLIST is equated to the MPE device class LP (line printer) unless you use an MPE :FILE command to specify otherwise.

Discussion

The default output device for the commands listed above is $STDLIST unless you use this command to change it. You can also use this command to change the output device back to $STDLIST at any time after setting it to QSLIST.

If you want to change the device associated with QSLIST while operating QUERY in session mode, you can use the BREAK key or terminate QUERY to enter the MPE :FILE command, or you can enter the :FILE command before running QUERY.

If you are operating in job mode, you can place a :FILE command in your job preceding the :RUN QUERY command.

All error messages and QUERY prompts are always sent through the $STDLIST device, regardless of whether OUTPUT=TERM or OUTPUT=LP.

Using the MPE FILE Command

If you want to associate the QSLIST file with a device other than the line printer, you must use the MPE :FILE command and then set OUTPUT=LP. For example:

   :FILE QSLIST;DEV=device type

Device type is a name referring to a class of devices or a specific device. The different device classes and names are set up by the system manager at the time the MPE operating system is configured. You must ask the system manager which name to use for the device you want to associate with QSLIST.

QUERY will not output a record longer than 136 bytes (characters) even though the maximum record length for the device may exceed this limit.

The following :FILE command is used to send the output to a magnetic tape. In this case, TAPE is the name of the class of devices known as magnetic tapes.

   :FILE QSLIST;DEV=TAPE

To send output to a disc file, follow the instructions below.

  • If QSLIST is not a permanent file, you can specify the following file command:

       :FILE QSLIST;DEV=DISC
    

    QUERY will build the new file as an ASCII file with variable length records of 136 bytes. The first byte contains carriage control for the file. If you want to override these defaults you must specify what you want in the file equation. For example, the following will create an ASCII file named QSLIST with carriage control and fixed length records of 80 bytes.

       :FILE QSLIST;DEV=DISC;REC=-80,,F,ASCII;CCTL
    
  • If QSLIST is already a permanent file or you want to send the output to a file with a different name, you can specify the following :FILE command. fname is the name of the file you want to create:

       :FILE QSLIST=fname,NEW;DEV=DISC
    

    If you use the NEW option in a :FILE command and the file already exists, QUERY prints the following message:

       QSLIST ALREADY EXISTS, PURGE OLD FILE?
    

    If you respond with "Y", QUERY overwrites the existing file. If you respond with "N", a file system error message is returned and OUTPUT is reset to TERM.

    If you want QUERY to append to an existing file, you must use the APPEND option, as shown below.

       :FILE QSLIST=fname,OLD;DEV=DISC;ACC=APPEND
    

Refer to the MPE Commands Reference Manual for information on using the FILE command.

Examples

Example 1

In this example, QUERY is running in session mode. QSLIST is equated to a terminal initially. When the output device to QSLIST is changed to LP, the INVENTORY data set is listed on the line printer. When the output device is set to the terminal again, the INVENTORY data set is listed on the terminal.

      >OUTPUT=LP

      >LIST INVENTORY

      >O=TERM

      >LIST INVENTORY





      STOCK#        ONHANDQTY    SUPPLIER         UNIT-COS    LASTSH   BIN



      6650D22S           5306    ACME WIDGET          1427    120385    3

      2457A11C       11001345    ACME WIDGET          5031    120185    1

      3586T14Y            144    CARDINAL MILLS        249    112085    2

Example 2

The next example illustrates the method for sending output to a tape device. In this case, a procedure from the Proc-file is listed first on the terminal and then on a tape. The BREAK key is used to return to MPE. QSLIST is equated to a magnetic tape device. QUERY execution is resumed and the output device is changed to QSLIST. The procedure is written to the QSLIST device and the output device is set to the terminal again.

      >DISPLAY FNAMES



      PROCEDURE: FNAMES



      001   FIND LAST-NAME="" END



      >BREAK

      :FILE QSLIST;DEV=TAPE

      :RESUME

      READ pending

      RETURN

      >OUTPUT=LP

      >DISPLAY FNAMES

      >OUTPUT=TERM

Example 3

In this example, one entry is retrieved with the FIND command, and is displayed with the REPORT ALL command. Next, the BREAK key is used to temporarily return to the operating system. The FILE command redirects QSLIST to a disc file named SAVER which QUERY creates. QUERY execution is resumed. Finally, the OUTPUT=LP and REPORT ALL commands are used to write data to the SAVER file.

      >FIND CUSTOMER.LAST-NAME IS CORCORAN END

      USING SERIAL READ

      1  ENTRIES QUALIFIED

      >REPORT ALL





      ACCOUNT         =54283540

      LAST-NAME       =CORCORAN

      FIRST-NAME      =CLIFFORD

      INITIAL         =C

      STREET-ADDRESS  =6105 VALLEY GREEN DR.

      CITY            =CARMEL

      STATE           =CA

      ZIP             =93921

      CREDIT-RATING   = 7.10000



      >BREAK

      :FILE QSLIST=SAVER,NEW;DEV=DISC

      :RESUME

      READ pending

      RETURN

      >OUTPUT=LP

      >REPORT ALL

      >
Feedback to webmaster