ZLOAD command
The ZLOAD command supports the remote load against Db2 for z/OS servers, by taking the file and loading it as an input parameter.
Scope
The ZLOAD command supports the remote load against Db2 for z/OS servers, by taking the file and loading it as an input parameter.
Authorization
- Schema load authority.
Required connection
Database. If implicit connect is enabled, a connection to the default database is established.
Command syntax
Command parameters
- <filename>
- Specifies the single fine name that contains the data to load.
- <loadstmt>
- User can specify the SQL statement for the LOAD command.
- <Utiliyid>
- User can specify the utility-id for the LOAD command.
Examples
If you are running the ZLOAD command from a shell in Unix/Linux or from a Windows command prompt, enclose the ZLOAD command with double quotation mark delimiters:
C:\Program Files (x86)\IBM\SQLLIB_11_1\BIN>db2 "zload from block.cust.del
of int with zloadidbxslr messages zloadutil.txt using template
SORTIN DSN DOC.SORTIN UNIT SYSDA SPACE(10,10) CYL DISP(NEW,DELETE,DELETE)
TEMPLATE SORTOUT DSN DOC.SORTOUT UNIT SYSDA SPACE(10,10)
CYL DISP(NEW,DELETE,DELETE)
LOAD DATA INDDN SYSCLIEN WORKDDN(SORTIN,SORTOUT) REPLACE PREFORMAT
LOG(NO) REUSE NOCOPYPEND FORMAT DELIMITED EBCDIC STATISTICS
TABLE(ADMF001.CUSTOMER_LOCAL) index(all) column(all) INTO
TABLE ADMF001.CUSTOMER_LOCAL NUMRECS 30000 NOCOPYPEND"
If you are running the ZLOAD command from a CLP prompt or from a file, then you do not need to use double quotation mark delimiters.
zload from block.cust.del of int with zloadidbxslr messages zloadutil.txt
using template SORTIN DSN DOC.SORTIN UNIT SYSDA SPACE(10,10)
CYL DISP(NEW,DELETE,DELETE) TEMPLATE SORTOUT DSN DOC.SORTOUT
UNIT SYSDA SPACE(10,10) CYL DISP(NEW,DELETE,DELETE)
LOADDATA INDDN SYSCLIEN WORKDDN(SORTIN,SORTOUT)
REPLACE PREFORMAT LOG(NO) REUSE NOCOPYPEND FORMAT DELIMITED
EBCDIC STATISTICS TABLE(ADMF001.CUSTOMER_LOCAL) index(all)
column(all) INTO TABLE ADMF001.CUSTOMER_LOCAL
NUMRECS 30000 NOCOPYPEND
Usage notes
When a utilityid value is not provided, the driver generates a value (see the description of the SQL_ATTR_DB2ZLOAD_UTILITYID for a format of the generated value) for the utilityid of the LOAD operation.
Error scenarios:
- If the file supplied to CLP ZLOAD command has any permission problems to read or open, it throws existing SQL error “SQL2731N Error while reading from input data file "<filename>".”
- CLI returns the “CLI0150E Driver not capable.” error if user tries to turn on the LOAD against servers other than Db2 for z/OS 12 and above.
- SQL statement for LOAD utility must not be null and not more than 32704 bytes. Otherwise, CLI throws existing error “CLI0124E Invalid argument value.” and CLP throws the existing error message“SQL0102N The string constant beginning with "" is too long.” CLI or CLP does not validate or scan the SQL statement.
- If the user specifies an invalid value for record delimiter, CLI throws existing error “CLI0124E Invalid argument value.” CLP throws the existing error “SQL0104N An unexpected token "INVALID" was found following "OF". Expected tokens might include "DEL".
