DB2 Server for VSE & VM: Database Services Utility


Defining Input and Output Requirements

You must define I/O requirements to the Database Services Utility for the control file, the message file, and any input or output data files.

You define your input and output requirements to the Database Services Utility by using FILEDEF commands. The SQLDBSU EXEC generates standard FILEDEF statements for the control and message files; if you are using an additional file for data input or output, or need parameters not supplied by the SQLDBSU EXEC, you must use a FILEDEF statement to supplement the EXEC. When you specify options other than the SQLDBSU EXEC default options, the EXEC defaults are overridden.

Because you use a data file for input or output with the RELOAD, DATAUNLOAD, UNLOAD and SCHEMA commands, you must write a FILEDEF statement for these commands. The DATALOAD command does not require a FILEDEF statement when the input data is in the command file. For further details about command specific FILEDEF information, see the section about using file definitions for the particular command.

You should use a FILEDEF statement as an addition to the FILEDEF statements issued by the SQLDBSU EXEC, not as a replacement. When you do use customized FILEDEF statements in addition to the SQLDBSU EXEC, the FILEDEFs precede the SQLDBSU EXEC.

Using File Definitions

Use a FILEDEF command to identify a CMS file, a virtual reader file, a virtual printer file, or any sequential tape or DASD file supported by CMS/QSAM. The FILEDEF command assigns a name to the file and specifies the file's device type and file options.

Figure 6 illustrates the syntax of a FILEDEF statement:

Figure 6. FILEDEF Statement Syntax

Format:

>>-FIledef--ddname----+-Terminal--------+----------------------->
                      +-PRinter---------+
                      +-Reader----------+
                      +-DISK--fn_ft_fm--+
                      '-TAPn------------'
 
>-----+--------------------+-----------------------------------><
      '-(--Options--+---+--'
                    '-)-'
 

ddname (data definition name)

Identifies the name of the input or output file that you are defining.

Device type can be one of the following parameters:

Terminal
Your workstation

PRinter
The spooled printer available to you

Reader
The spooled reader available to you

DISK fn ft fm
Virtual direct access storage device (DASD) CMS file

TAPn
Magnetic tape drive, where n can be 1, 2, 3, or 4, representing virtual units 181, 182, 183, and 184, respectively.

Options

To avoid error messages, specify only those options that are valid for a particular device. Table 19 shows valid options for each device type.

The message ARI0868I (in the message file) identifies the file characteristics used by Database Services Utility processing.

The following shows a FILEDEF statement that defines an input data file. In this example, DBSFILE is the name of the input file as it is referred to in your Database Services Utility command.

FILEDEF DBSFILE DISK DBSFILE DATA A (RECFM F LRECL 800

DBSFILE is a file on DASD called DBSFILE DATA A. It has a fixed record length of 800.

For an explanation of FILEDEF parameters and options, see Appendix B, FILEDEF Command Syntax and Notes.

Using the SQLDBSU EXEC

If you have simple, straightforward I/O needs for the control and message files, the SQLDBSU EXEC, without supplementary FILEDEF commands, is probably all you need. You can choose only one of the following input control file options:

You can choose only one of the following output message file options with the SQLDBSU EXEC.

If, for example, your control file is COMMANDS DBSU and you want to have the message file displayed on your terminal, your SQLDBSU EXEC statement is:

SQLDBSU SYSIN (COMMANDS DBSU A) SYSPRINT (T)

Note:When the control file is assigned as TERMINAL, do the following:
  • Use the same character positions and same command syntax as if entering commands or data into a CMS file; end all commands with a semicolon.
  • Use uppercase or lowercase because CMS converts your input to uppercase. If your input entered from the terminal must contain lowercase values, you must issue the following FILEDEF before issuing the SQLDBSU EXEC without the SYSIN parameter specification:
    FILEDEF SYSIN TERMINAL (RECFM F LRECL 80 LOWCASE
    

    If this FILEDEF is issued, all the Database Services Utility command and SQL statement keywords must be entered in uppercase.

  • Do not submit command records with sequence numbers in positions 73-80 when you are using the READ FILE command. (When SYSIN=TERMINAL, positions 73-80 are used for command information.)
Note:With single user mode, the SQLDBSU statement has additional parameters.

For detailed information on the SQLDBSU EXEC and startup of the Database Services Utility, see Chapter 7, Using the Database Services Utility from Application Programs. For usage notes and syntax of the CMS FILEDEF command, see Appendix B, FILEDEF Command Syntax and Notes.

Sample Startup

This procedure uses the control file you created in Using the SQLDBSU EXEC to startup the Database Services Utility with the SQLDBSU EXEC.
Note:Consider using the same file name for both the control and message files to identify the input and output as belonging to the same job. Use different file types for the control and message files to prevent the output data and messages from overwriting the control file contents.

On the CMS command line, type:

SQLDBSU SYSIN (COMMANDS DBSU A) SYSPRINT (COMMANDS RESULT A)

Press ENTER to start the Database Services Utility. The commands in your COMMANDS DBSU A file are now executed. The utility processes the commands and displays the results as shown in Figure 7.

Figure 7. Messages Displayed during Processing

 
ARI0717I Start SQLDBSU EXEC: 07/18/89 16:09:52 EST<----------(1)
ARI0662I EMSG function value reset to: ON.
ARI0659I Line-edit symbols reset:
         LINEND=# LINEDEL=OFF CHARDEL=OFF ESCAPE=OFF TABCHAR=OFF
ARI0655I Input file (SYSIN): COMMANDS DBSU A           <------*
ARI0656I Message file (SYSPRINT): COMMANDS RESULT A           |
ARI0320I The default database name is SQLDBA.                 |
ARI0663I FILEDEFS in effect are:                              *----(2)
ARISQLLD DISK     ARISQLLD LOADLIB  Q1                        |
SYSIN    DISK     COMMANDS DBSU     A1                        |
SYSPRINT DISK     COMMANDS RESULT   A1                 <------*
ARI0809I ...No errors occurred during command processing.<-----------(3)
ARI0808I DBS processing completed: 07/18/89 16:09:55.<----------*
ARI0660I Line-edit symbols restored:                            |
         LINEND=# LINEDEL=OFF CHARDEL=OFF ESCAPE=¢ TABCHAR=ON   |
ARI0657I EMSG function value restored to: TEXT.                 |
ARI0796I End SQLDBSU EXEC: 07/18/89 16:09:56 EST<---------------*----(4)

Notes for Figure 7:

(1)
Informs the user that the Database Services Utility started.

(2)
Shows the input (or control) file name, the message file name, the database being accessed, and the FILEDEFs in effect.

(3)
Identifies any errors that occur when Database Services Utility processes the commands in the control file.

(4)
Indicates that the Database Services Utility is finished processing.

You may receive the following message instead of the message displayed at (3):

ARI0807E ...Error(s) occurred during command processing.

This message indicates that an error occurred when the Database Services Utility was processing the commands in the control file. Error types are listed and discussed in Chapter 9, Error Handling and Debugging.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]