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.
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--+---+--' '-)-' |
Identifies the name of the input or output file that you are defining.
Device type can be one of the following parameters:
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.
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:
FILEDEF SYSIN DISK file-name file-type file-mode (RECFM FB LRECL 80 BLOCK 800
FILEDEF SYSIN READER (RECFM F LRECL 80
FILEDEF SYSIN TERMINAL (RECFM F LRECL 80
You can choose only one of the following output message file options with the SQLDBSU EXEC.
FILEDEF SYSPRINT DISK file-name file-type file-mode (RECFM FBA LRECL 121 BLOCK 1210
FILEDEF SYSPRINT PRINTER (RECFM FA LRECL 121
FILEDEF SYSPRINT TERMINAL (RECFM F LRECL 120
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:
|
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.
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:
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.