The SQLUTB232 and SQLUTB264 UNLOAD utilities unload data from a table in a DBMS, and place it into an output data set file. You can use these utilities to unload all rows from a table, or unload only those rows that meet certain criteria, such as those selected from a provided field specification list. Output data sets are compatible with DB2 for z/OS in both encoding and formatting, and can be used as input to SQLUTBxx LOAD utilities.
SQLUTBxx UNLOAD utilities are similar to DSNUTILB LOAD. Include an SQLUTBxx UNLOAD card in your JCL, and execute it either from an Enterprise Developer JCL project or by submitting the JCL directly using the JES CONTROL feature in Enterprise Server. The JCL syntax must be DB2-compatible.
The following is an example of JCL using a UNLOAD card:
//ULEMP001 JOB CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID,REGION=0M //DELETE EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE MCS.UNLOAD.ULEMP001 SET MAXCC=0 //EMP001 EXEC DSNUPROC,SYSTEM=HCOD,UID=ULEMP001 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(10,10)) //SYSPRINT DD SYSOUT=* //UTPRINT DD SYSOUT=* //SYSPUNCH DD SYSOUT=* //SYSREC DD DSN=MCS.UNLOAD.ULEMP001,DISP=(MOD,CATLG), // UNIT=SYSDA,SPACE=(CYL,(1,1)), // DCB=(RECFM=VB,LRECL=107,BLKSIZE=6500) //SYSIN DD * UNLOAD DATA FROM TABLE [DSN8910].[EMP] EBCDIC /* // Where DSNUPROC is a cataloged procedure, //DSNUPROC PROC SYSTEM=DSN,SIZE=0K,UID='',UTPROC='' //TSTUTILB EXEC PGM=TSTUTILB,REGION=&SIZE, // PARM='&SYSTEM,&UID,&UTPROC' //*STEPLIB DD DSN=&LIB,DISP=SHR //* //SYSPRINT DD SYSOUT=* //UTPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=*
In contrast to DB2 for z/OS DSNUTILB UNLOAD, the default code set for the output of SQLUTBxx UNLOAD is ASCII instead of EBCDIC. Also the default record format, RECFM, is FB. You can override the RECFM default with DCB in the SYSREC definition.