Previous Topic Next topic Print topic


SQLUTBxx UNLOAD

Note: This is a technology preview feature only. It is being made available to allow you to test and provide feedback on this new capability; however, this feature is not intended for production use and it is not supported as such. Furthermore, Micro Focus does not guarantee that this feature will be delivered at a GA level and if it is, then the functionality provided might differ considerably from this technology preview.

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.

Executing SQLUTBxx UNLOAD

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.

UNLOAD Options

Supported Specifications and Options
  • TABLESPACE – does not apply to SQL Server
  • PUNCHDDN
  • UNLDDN
  • EDCDIC – to override the default ASCII if needed
  • ASCII – default code set
  • NOSUBS
  • NOPAD
  • MAXERR
Unsupported Specifications and Options
  • PART – tablespace partition
  • FROMCOPY
  • FROMCOPYDDN
  • LIST
  • UNICODE – code set
  • CCSID
  • FORMAT INTERNAL
  • DELIMITED
  • COLDEL
  • CHARDEL
  • DECPT
  • FLOAT S390
  • FLOAT IEEE
  • SHRLEVEL
  • DECFLOAT_ROUNDMODE
Supported FROM TABLE Options
  • HEADER
  • POSITION
  • FIELD SPECIFICATION
  • STRIP
  • TRUNCATE
  • WHEN -
Unsupported FROM TABLE Options
  • SAMPLE
  • LIMIT
Supported TABLE FIELD TYPES
  • CHAR
  • VARCHAR
  • SMALLINT
  • INTEGER
  • BIGINT
  • INTEGER EXTERNAL
  • DECIMAL (PACKED)
  • DECIMAL EXTERNAL
  • FLOAT
  • FLOAT EXTERNAL
  • DOUBLE
  • REAL
  • DATE
  • DATE EXTERNAL
  • TIME
  • TIME EXTERNAL
  • TIMESTAMP
  • TIMESTAMP EXTERNAL
  • CINSTANT
Unsupported TABLE FIELD TYPES
  • BINARY
  • GRAPHIC
  • GRAPHIC EXTERNAL
  • VARGRAPHIC
  • ROWID
  • BLOB
  • CLOB
  • DBCLOB
Previous Topic Next topic Print topic