DBP (Print) batch command
Purpose
To print the contents of a Db2® object in a variety of formats.
Usage
The FM/Db2 Print utility function can:
- Print data in table or single formats, in either character or HEX.
- Select the rows and columns to be printed.
- Limit the number of rows to be printed.
- FORMAT
- The formatting mode for the printed data:
- TABLE
- In table mode each row of the table occupies a single line, and columns appear left to right across the page.
- SINGLE
- In single mode each row of the table occupies multiple print lines. The first column of the object is printed on the first, and possibly more lines, followed by the second column and so on.
- OBJIN=location.owner.name
- The optional name of the Db2® remote
server (location) where the object is located;
the optional name of the owner of the object (owner)
and the object name (name) to be printed.
When location is not specified the current (local) Db2® server is used. When the owner is not specified the object name is qualified using the current SQLID. When FM/Db2 generates the utility control statements, the owner value is non-blank.
OBJIN should be used when the fully qualified name fits on a single line in the JCL deck. The last usable column is column 71. When the fully qualified name does not fit on a single line in the JCL deck, use one or more of the OBJILOCN, OBJIOWNR, OBJINAME keywords to specify the object.
- OBJILOCN=location
- The optional name of the Db2® remote server (location) where the object to be printed is located. See Specifying a Db2 object name.
- OBJIOWNR=owner
- The optional name of the owner of the object (owner) to be printed. See Specifying a Db2 object name.
- OBJINAME=name
- The object name (name) for the object to be printed. See Specifying a Db2 object name.
- TINPUT=ddname
- Defines a reference to a DD statement for the data sets which contain the Db2® template that describes the source Db2® object to be printed. If you specify a concatenated DD, then you must provide the member name, member, via the TINMEM keyword. See Specifying the template for a Db2 object.
- TINMEM=member
- The name of the template member in the dataset(s) identified by the TINPUT parameter, if it has not been specified on the DD statement. This parameter must not be specified if the TMIN parameter is specified. See Specifying the template for a Db2 object.
- TMIN=template_data_set_name(member)
- The PDS (template_data_set_name) and member name (member) of the File Manager template that describes the source Db2® object to be copied. See Specifying the template for a Db2 object.
- UCREAD
- Specifies whether FM/Db2 should use uncommitted read, when accessing
the source object:
- YES
- Uncommitted read is used. In this case, Db2® takes no locks when accessing the data in the source table, and it is possible that the data for a row changes after being read by FM/Db2, resulting in data inconsistencies.
- NO
- Uncommitted read is not used. This is the default.
- HEX=YES
- Specifies that FM/Db2 should print the data in hexadecimal format. Omit this option if normal printing is required.
- NULLIND=character
- Defines the character used to indicate that the value for a column is the Db2® null value, in the printed data. The default is the underscore character. The value for this character is set using the editor Null Column Indicators: Display option. When specified in the File Manager utility control statements, the character must be a printable character other than a comma. The value cannot be enclosed in quotation marks.
- ROWS
- The maximum number of rows to be printed:
- ALL
- All rows from the source object are printed.
- num
- The maximum number of rows to be printed. Valid range: 1-99999999.
Examples
Example 1: Print data from DSN8810.EMP, in single mode. Use uncommitted read when accessing the Db2® data. Print the data in hexadecimal format.
//DBP JOB (acct),'name'
//* Print table DSN8810.EMP in SINGLE format.
//*
//FMNDB2 EXEC PGM=FMNDB2,PARM=('SSID=DSN1,SQID=ID1')
//STEPLIB DD DSN=FMN.SFMNMOD1,DISP=SHR
// DD DSN=DB2V810.DSN1.SDSNEXIT,DISP=SHR
// DD DSN=DB2.V810.SDSNLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSIN DD *
$$FILEM DBP FORMAT=SINGLE,
$$FILEM OBJIN="DSN8810"."DEPT",
$$FILEM UCREAD=YES,
$$FILEM HEX=YES,
$$FILEM NULLIND=_,
$$FILEM ROWS=ALL
/*
Return codes
The return codes from the DBP function:
- 0
- The function completed successfully
- 16
- A serious error was encountered
Related functions
None.