Mainframe Tutorials

- http://www.mainframegurukul.com/srcsinc/
  Programing, tutorials, tip to programming, links mainfreme y java

- http://mftuto.blogspot.com/
  Full tutorials, tips JCL, Cobol...

- http://gsf-soft.com/Prism-CS/Samples.shtml#list
   Sample Job Streams...
- http://ibmmainframes.com/manuals.php
IBM Mainframe Manuals for VS COBOL II, IBM COBOL, Enterprise COBOL, MVS JCL, OS/390 JCL, z/OS JCL, TSO, ISPF, SDSF, DFSORT, ICETOOL, CLIST, REXX, PL/I, CICS/ESA, CICS/TS, DB2, DB2/UDB, IMS, SQL Codes, Abend Codes, ErrorCodes, System Messages, SOC errors, CICS Abends etc... 
  Mainframe S390 Assembler Programming

Manuales online: COBOL, JCL's, DFSORT, CICS, DB2, TSO

- OS/390 
- DB2
- Others
Forums:
http://www.mainframegurukul.com/sitemap.php
http://ibmmainframeforum.com/

 



ABEND Code



1. INTRODUCTION

Interpretation of IBM operating system error codes and messages can be tedious and frustrating.
Many times the appropriate manuals are not readily available for the user's access. If the manuals
are available, the error description and corrective procedure are often impossible to interpret.
A list of the errors most commonly encountered at the CIS Technical Support Department with a
brief understandable description of their meaning and a suggested procedure for correcting the
error is given below.

2. IDENTIFYING THE ERROR CODE

Identifying the error code is the first step in the process. The first page or pages
of the printed output generated by a job is the JES3 job log or JESMSG dataset. This
is a chronological listing that specifies JES3 and system operator messages issued
during processing of your job. If your job abended (ABnormally ENDed), a message near
the end of JESMSG will appear, resembling:

hh.mm.ss SYS2 R=IEF450I jobname procname stepname-ABEND Snnn Ummmm
-
                    TIME=hh.mm.ss

The characters "IEF450I" are a message identifier code which can be looked up in
the "IBM OS/VS Message Library: VS2 System Messages" manual for a description of
the message. The actual jobname, procedure name, and stepname for your job will
appear in the indicated locations in the message. The "Snnn" and "Ummmm" identify
the more helpful parts of the message. The "Snnn" is a code denoting a SYSTEM abend.
These codes can be found in the "IBM OS/VS Message Library: VS2 System Codes" manual.
The "Ummmm" is a code denoting a USER abend. These codes will vary from one user's
program to another, therefore these will not be discussed.

Following the JES3 joblog will be a print file referred to as JESJCL. This is a
list that specifies JCL and any additional job control statements from included procedures.

The next section of output is referred to as the SYSMSG dataset. Within this file
all system messages will be printed which will include a more descriptive message
associated with the error message appearing in JESMSG. Quite commonly, one error
code has several meanings, thereby making the extra information in this section
very useful in identifying the problem. For example:

IEC150I 913-38,IFG0194C,jobname,procname,ddname,35D,UGS004,dsname
IEF472I jobname procname stepname - COMPLETION CODE - SYSTEM=913
USER=0000

The characters "IEC150I" are another message identifier code, which may be looked
up in the system messages manual. To the right of this code is the system abend
code. In this example it is "913". The "-38" is an additional code number occasionally
used to distinguish between different errors under the same system abend code.

The following are the most commonly found system abend codes. If assistance is
needed with the less common system codes, the Technical Support staff is available.

2.1 COMMONLY OCCURRING ABEND CODES

2.1.1 ABEND CODE 013

    1. ERROR ID: IEC141I
    2. DESCRIPTION: The system could not OPEN one of your datasets properly,
    generally because of an incorrect DCB parameter (BLKSIZE), or it could not
    find the specified member of a partitioned dataset.
    3. CORRECTIVE PROCEDURE: Check the BLKSIZE in the DCB parameter to insure
    that it matches the BLKSIZE of the dataset. Verify the spelling and existence
    of the member of the partitioned dataset.

2.1.2 ABEND CODE 0C1

    1. ERROR ID: none
    2. DESCRIPTION: The computer tried to execute an invalid machine instruction
    and an operation exception occurred.
    3. CORRECTIVE PROCEDURE: Check the overlaying portion of your program.
    Accidentally overlaying part of your program with data (subscript out
    of range) or bad addresses will produce this error.

2.1.3 ABEND CODE 0C4

    1. ERROR ID: none
    2. DESCRIPTION: This is a storage protection violation generally caused
    by your program trying to STORE data in memory that is not allocated for your use.
    3. CORRECTIVE PROCEDURE: Make sure any subscripts used do not exceed the
    boundary specified. Correct all bad addresses in a store-type statement.

2.1.4 ABEND CODE 0C5

    1. ERROR ID: none
    2. DESCRIPTION: The computer tried to ADDRESS an area in a non-existent
    part of memory (beyond the bounds of our installation memory).
    3. CORRECTIVE PROCEDURE: Check for improper subscripts and for inconsistent
    lists for subprograms.

2.1.5 ABEND CODE 0C7

    1. ERROR ID: none
    2. DESCRIPTION: This is a DATA exception error. The system tried to execute
    an instruction that works with packed decimal numbers and found the numbers
    to be incorrectly formatted. This error commonly occurs in PL/I and COBOL
    programs when working with data that has been incorrectly converted after
    inputting from cards or some other file or when numeric fields declared to
    contain packed decimal data are not initialized prior to use.
    3. CORRECTIVE PROCEDURE: Either correct the data or the conversion format
    in your program.

2.1.6 ABEND CODE 106

    1. ERROR ID: none
    2. DESCRIPTION: A system software or disk problem occurred during the execution
    of a LINK or LOAD instruction.
    3. CORRECTIVE PROCEDURE: Insure that the load request in the problem was
    specified correctly and was not incorrectly modified, then resubmit the job.

2.1.7 ABEND CODE 213

    1. ERROR ID: IEC143I
    2. DESCRIPTION: The system tried to open a DASD data set and encountered
    difficulties. This ABEND customarily occurs when the dataset name specified
    in the DSNAME parameter does not exist.
    3. CORRECTIVE PROCEDURE: If the dataset is catalogued, make sure the spelling
    is correct. If the dataset is not catalogued, insure that the proper volume was
    specified on the VOL=SER parameter

2.1.8 ABEND CODE 222

    1. ERROR ID: IEF301I
    2. DESCRIPTION: The operator cancelled the job.
    3. CORRECTIVE PROCEDURE: If no message is given in JESMSG, contact the operator
    for an explanation. Many times the error is caused by improperly accessing a
    magnetic tape

2.1.9 ABEND CODE 2F3

    1. ERROR ID: none
    2. DESCRIPTION: The job was executing when a system failure occurred
    3. CORRECTIVE PROCEDURE: Resubmit the job if your results are unsatisfactory
    and contact Technical Support for a job cost reimbursement

2.1.10 ABEND CODE 322

    1. ERROR ID: none
    2. DESCRIPTION: Execution of a job, job step, or catalogued procedure step
    took longer than the time specified. If no time was specified in the TIME
    parameter on your jobcard, the job was given the default value of 30 seconds.
    3. CORRECTIVE PROCEDURE: Check for program errors, such as endless loops.
    Correct any such errors and rerun the job. If no such errors were found,
    increase the time and rerun the job.

2.1.11 ABEND CODE 613

    1. ERROR ID: IEC147I
    2. DESCRIPTION: An input/output (I/O) error occurred during execution of
    an OPEN instruction for a dataset on magnetic tape. The error resulted in
    either reading or writing incorrectly a tape label or mark, or positioning
    a tape volume. This error typically occurs in standard label processing for
    multiple tape files.
    3. CORRECTIVE PROCEDURE: Rerun the job, since malfunctioning equipment has
    likely produced the error

2.1.12 ABEND CODE 722

    1. ERROR ID: none
    2. DESCRIPTION: The system cancelled your job because an output limit was
    exceeded for lines being printed or cards being punched.
    3. CORRECTIVE PROCEDURE: Assuming that the program is correct, increase the
    appropriate specification by use of a MAIN card. IF lines were exceeded (default=5000),
    the LINES parameter (in thousands) should be increased accordingly. If cards were
    exceeded (default=500), the CARDS parameter (in hundreds) should be increased.

2.1.13 ABEND CODE 804

    1. ERROR ID: none
    2. DESCRIPTION: Your job requested more virtual storage (memory) than the amount
    that was available.
    3. CORRECTIVE PROCEDURE: Increase the REGION parameter on the abending step's
    EXEC card. If no region parameter was specified, the default value for the
    procedure being executed was assumed.

2.1.14 ABEND CODE 806

    1. ERROR ID: none
    2. DESCRIPTION: This error occurred during execution of a LINK or LOAD instruction.
    The system was unable to locate a load module.
    3. CORRECTIVE PROCEDURES: Make sure the spelling of the load module name or program
    name is correct or that the appropriate STEPLIB or JOBLIB DD card defining which
    library the load module resides in is included in you JCL stream.

2.1.15 ABEND CODE 80A

    1. DESCRIPTION: This error is complimentary to system abend code 804, discussed above.
    2. CORRECTIVE PROCEDURES: The same procedures should be exercised for this error.

2.1.16 ABEND CODE 813

    1. ERROR ID: IEC149I
    2. DESCRIPTION: During execution of an OPEN instruction for a dataset on magnetic
    tape, the dataset name on the header label of the tape did not match that specified
    on the DD card.
    3. CORRECTIVE PROCEDURE: Insure that the DD statement specifies the correct DSNAME,
    volume serial number, and label for the tape being accessed.

2.1.17 ABEND CODE 913

    1. ERROR ID: IEC150I
    2. DESCRIPTION: An OPEN instruction was issued for a RACF-protected dataset on a
    DASD volume which your userid was not authorized to access. RACF only allows you
    to access datasets with a high level qualifier the same as your userid or which
    you have been explicitly given access permission to by the owner of the dataset.
    3. CORRECTIVE PROCEDURE: Make sure you have the needed access authority to the
    dataset. Attention should be given to the publication "RACF, A Component of the
    IBM Operating System of The University of Georgia." This is a brief general
    information manual published specifically for IBM users at the University. It
    may be obtained at the Technical Support Department.

2.1.18 ABEND CODE A13

    1. ERROR ID: IEC151I
    2. DESCRIPTION: The system tried to OPEN a non-existent dataset on magnetic tape.
    The system encountered the end-of-volume tape mark when forward spacing to the
    file you specified in the LABEL parameter on the DD card.
    3. CORRECTIVE PROCEDURE: Check the file sequence number and volume serial number
    from the previous job that created the dataset.

2.1.19 ABEND CODE B37

    1. ERROR ID: IEC030I
    2. DESCRIPTION: This error results if either one of two situations occurs.
    Firstly, if the DASD volume to which the system has assigned one of the program's
    output datasets does not have enough available space to allow the necessary
    secondary allocations to be made. Secondly, this ABEND can occur if the output
    dataset used all 16 extents of secondary allocations but still required more space.
    3. CORRECTIVE PROCEDURE: Estimate the space required for the output dataset
    before rerunning your program. If possible, decrease the amount of space
    requested or if more space is obviously needed increase the primary and/or
    secondary allocations.

2.1.20 ABEND CODE D37

    1. ERROR ID: IEC031I
    2. DESCRIPTION: An output dataset used all the primary space and no secondary
    space was requested.
    3. CORRECTIVE PROCEDURE: Increase the primary allocation or add a secondary
    allocation to the space parameter for that output dataset.


2.1.21 ABEND CODE E37

    1. ERROR ID: IEC032I
    2. DESCRIPTION: If creating a dataset on tape, all space available on the
    volume specified was used and the system attempted to write another record.
    If creating a partitioned dataset on direct access, 16 extents of secondary
    space were used when the program attempted to write another record.
    3. CORRECTIVE PROCEDURE: Specify at least one more tape volume or specify more
    primary space if creating a partitioned dataset.


ABEND
CAUSA PROBABLE
0C4
U1017
ERROR AL MOVER DATA EXEPTION
FALTA TARJETA SYSOUT
A13-14 INTENTAR SACAR UN PRINT A UN GDG
S001 LONGITUD DE LA TARJETA ES ERRADA
S013
FALTAN LIBRERIAS.
MIEMBRO DE LA LIBRERIA NO EXISTE. O MIENBRO NO EN LIBRERIA
EL COPY DESCRITO PARA EL ARCHIVO NO CORRESPONDE AL DEL FILE
LA LONGITUD DEL ARCHIVO NO ES CORRECTA, REVISAR EL FD.
S0C4
TARJETAS DEL SORT ESTAN MAL ESPECIFICADAS.
EN SENTENCIA WRITE, DSN FULL.
WRITE SIN DAR OPEN AL FILE.
S072-053 ARCHIVO VACIO
S076-002
STAT 37
ERROR EN LA DEFINICION DEL ARCHIVO, ES SECUENCIAL Y SE DEFINE COMO INDEXADO.
SA13 ERROR EN EL DSN DE LA CINTA. LA MONTARON ERRADA
SB37 ESPACIO DEFINIDO EN DISCO ES INSUFICIENTE
SD37 SE LLENO EL DISCO.
SE37
SE LLENO LA LIBRERIA DEL DISCO.
SE LLENO EL DISCO ASIGNADO AL GRUPO.
S80A FALTA MEMORIA PARA EJECUTAR EL PROGRAMA, PONER EL PARAMETRO REGION.
S137-0C PROBLEMAS EN LA LECTURA DEL TRAILLER DE LA CINTA
S152 USUARIO SIN AUTORIZACION PARA CONSULTAR ARCHIVO
S160 SE INTENTA SACAR PRINT A UN ARCHIVO VACIO
S168 SE DEBE CERRA EL ARCHIVO PARA PODER SACAR PRINT
S213 LA DECLARACION DEL FILE NO COINCIDE CON EL QUE ESTA EN USO POR EJEM. EL ARCHIVO ES SECUENCIAL Y SE QUIERE INTRODUCIR UN REGISTRO DE ORG. INDEXADA.
S222 OPERADOR LO CANCELA
S322 SE AGOTO EL TIEMPO DEFINIDO
S413-08 UNIDAD DE CINTA MALOGRADA
S522 EL OPERADOR SE DEMORA EN COLOCAR LA CINTA O NO ENCUENTRA ALGUN OTRO RECURSO
S613 ERROR DE I/O AL MOMENTO DE OPEN UNA CINTA.
S714-0C ERROR EN EL CLOSE DE LA CINTA.
S722 SE LLEGO AL LIMITE DE IMPRESION DEL OUTLIM.
S803
NO SE ENCUENTRA LA CINTA.
MODULO ACCESADO NO ENCUENTRA EL PROGRAMA EN LA LINK.
S806 MODULO ACCESADO NO ENCUENTRA EL MODULO LINK.
S878 FALTA REGION EN EL JOB O AUMENTAR REGION
S813-04
LONGITUD DEL FD NO COINCIDE CON LA DEL REGISTRO.
DCB NO CORRECTO.
LABEL DE LA CINTA NO COINCIDE CON EL ESPECIFICADO.
NO EXISTE VERSION ESPECIFICADA.
ARCHIVO VACIO.
S837-8| AL SORTEAR POSIBLE .. AUMENTAR EL SPACE
S913
NO SE PUDO OBTENER LA MEMORIA SOLICITADA POR EL PARAMETRO 'REGION'.
SE DESEA UTITIZAR UNA FACILIDAD DEL SISTEMA SIN CONTAR CON LA AUTORIZACION NECESARIA.
S922 SE DETECTO UNA FALLA EN EL SISTEMA
S001 An I/O error ocurred. Check reason code for exact cause. Examples are trying to read beyond End of File, trying to write to an input file or a file length error
S002 Invalid I/O record, eg attempting to write a record that is longer than the maximum record length.
S004 Error occured during OPEN. Eg Invalid DCB.
S013 Error OPENing a dataset, eg PDS member does not exist, record length in program doesn’t match dataset’s record length
S0C1 Operation Exception. Check for subscript errors, missing DD card, file not opened
S0C4 Protection Exception/Storage Violation. Trying to access storage not available to the program. Can be caused by a subscripting error or reading/writing a file that isn’t open.
S0C7 Program Check Exception - Data. Check for spaces in a packed decimal or numeric field. Check to see if record layouts or file layouts have been changed.
Sx22 Job has been cancelled. The value of x will vary depending on the way the job was cancelled. S222 means job was cancelled by a user or operator without a dump. If a TSO session times out you will probably get an S522 abend code.
S806 Unable Link or Load. The job was unable to find the specified load module. Check that the job is looking at the correct Load Libraries, specify a STEPLIB if required.
S80A Not enough Virtual Sorage to satisfy a GETMAIN or FREEMAIN request.
S822 Unable to obtain to obtain enough space to satisfy a REGION= request May need to change REGION statement in the JCL
S878 Not enough storage available to satisfy a GETMAIN or FREEMAIN request.. Job was anable to allocate an area of memory of the correct size. Try Specifying or amending the ‘REGION=’ JCL statement
S913 You are trying to access a dataset which you are not authorized to use
Sx37 Unable to allocate enough storage for a dataset. You might need to increase the amount of primary and secondary space to be allocated for a dataset in the ‘SPACE=’ parameter, or you may have to move the dataset to a different DASD devive which has enought space to store the dataset. ‘x’ will vary, likely Abends are SB37, SD37 or SE37.
U1020 I/O Logic error. Typical reasons are; trying to write to a file opened as input; Rewrite without a previous read. See the message IGZ020I for details of the exact reason.
U1035 Inavlid OPEN/CLOSE. Check there is a DD statement for the file. See the message IGZ035I for more detailed information
.

Determining equivalent SQL and COBOL data types


The precompiler determines the base SQLTYPE and SQLLEN of host variables based on this table. If a host variable appears with an indicator variable, the SQLTYPE is the base SQLTYPE plus one.
COBOL declarations mapped to typical SQL data types

COBOL data type
SQLTYPE of host variable
SQLLEN of host variable
SQL data type
S9(i)V9(d) COMP-3 or S9(i)V9(d) COMP or S9(i)V9(d) PACKED-DECIMAL
484
i+d in byte 1, d in byte 2
DECIMAL(i+d,d)
S9(i)V9(d) DISPLAY SIGN LEADING SEPARATE
504
i+d in byte 1, d in byte 2
No exact equivalent use DECIMAL(i+d,d) or NUMERIC (i+d,d)
S9(i)V9(d)DISPLAY
488
i+d in byte 1, d in byte 2
NUMERIC(i+d,d)
S9(i) BINARY or S9(i) COMP-4 where i is from 1 to 4
500
2
SMALLINT
S9(i) BINARY or S9(i) COMP-4 where i is from 5 to 9
496
4
INTEGER
S9(i) BINARY or S9(i) COMP-4 where i is from 10 to 18.
Not supported by OPM COBOL.
492
8
BIGINT
S9(i)V9(d) BINARY or S9(i)V9(d) COMP-4 where i+d ≤ 4
500
i+d in byte 1, d in byte 2
No exact equivalent use DECIMAL(i+d,d) or NUMERIC (i+d,d)
S9(i)V9(d) BINARY or S9(i)V9(d) COMP-4 where 4 < i+d ≤ 9
496
i+d in byte 1, d in byte 2
No exact equivalent use DECIMAL(i+d,d) or NUMERIC (i+d,d)
COMP-1
Not supported by OPM COBOL.
480
4
FLOAT(single precision)
COMP-2
Not supported by OPM COBOL.
480
8
FLOAT(double precision)
Fixed-length character data
452
m
CHAR(m)
Varying-length character data
448
m
VARCHAR(m)
Fixed-length graphic data
Not supported by OPM COBOL.
468
m
GRAPHIC(m)
Varying-length graphic data
Not supported by OPM COBOL.
464
m
VARGRAPHIC(m)
DATE
Not supported by OPM COBOL.
384

DATE
TIME
Not supported by OPM COBOL.
388

TIME
TIMESTAMP
Not supported by OPM COBOL.
392
26
TIMESTAMP
The following table can be used to determine the COBOL data type that is equivalent to a given SQL data type.
SQL data types mapped to typical COBOL declarations

SQL data type
COBOL data type
Notes
SMALLINT
S9(m) COMP-4
m is from 1 to 4
INTEGER
S9(m) COMP-4
m is from 5 to 9
BIGINT
S9(m) COMP-4 for ILE COBOL.
Not supported by OPM COBOL.
m is from 10 to 18
DECIMAL(p,s)
If p<64: S9(p-s)V9(s) PACKED-DECIMAL or S9(p-s)V9(s) COMP or S9(p-s)V9(s) COMP-3. If p>63: Not supported
p is precision; s is scale. 0<=s<=p<=63. If s=0, use S9(p) or S9(p)V. If s=p, use SV9(s).
NUMERIC(p,s)
If p<19: S9(p-s)V9(s) DISPLAY If p>18: Not supported
p is precision; s is scale. 0<=s<=p<=18. If s=0, use S9(p) or S9(p)V. If s=p, use SV9(s).
FLOAT(single precision)
COMP-1 for ILE COBOL.
Not supported by OPM COBOL.

FLOAT(double precision)
COMP-2 for ILE COBOL.
Not supported by OPM COBOL.

CHAR(n)
Fixed-length character string
32766≥n≥1
VARCHAR(n)
Varying-length character string
32740≥n≥1
CLOB
None
Use SQL TYPE IS to declare a CLOB for ILE COBOL.
Not supported by OPM COBOL.
GRAPHIC(n)
Fixed-length graphic string for ILE COBOL.
Not supported by OPM COBOL.
16383≥n≥1
VARGRAPHIC(n)
Varying-length graphic string for ILE COBOL.
Not supported by OPM COBOL.
16370≥n≥1
DBCLOB
None
Not supported by OPM COBOL.
Use SQL TYPE IS to declare a DBCLOB for ILE COBOL.
BINARY
None
Use SQL TYPE IS to declare a BINARY.
VARBINARY
None
Use SQL TYPE IS to declare a VARBINARY.
BLOB
None
Not supported by OPM COBOL.
Use SQL TYPE IS to declare a BLOB.
DATE
Fixed-length character string or DATE for ILE COBOL.
If the format is *USA, *JIS, *EUR, or *ISO, allow at least 10 characters. If the format is *YMD, *DMY, or *MDY, allow at least 8 characters. If the format is *JUL, allow at least 6 characters.
TIME
Fixed-length character string or TIME for ILE COBOL.
Allow at least 6 characters; 8 to include seconds.
TIMESTAMP
Fixed-length character string or TIMESTAMP for ILE COBOL.
n must be at least 19. To include microseconds at full precision, n must be 26. If n is less than 26, truncation occurs on the microseconds part.
DATALINK
Not supported

ROWID None Use SQL TYPE IS to declare a ROWID.

Equivalences SQL and COBOL data types:
When you declare host variables in your COBOL programs, the precompiler uses equivalent SQL data types. When you retrieve data of a particular SQL data type into a host variable, you need to ensure that the host variable is of an equivalent data type.
The following table describes the SQL data type and the base SQLTYPE and SQLLEN values that the precompiler uses for host variables in SQL statements.
SQL data types, SQLLEN values, and SQLTYPE values that the precompiler uses for host variables in COBOL programs
COBOL host variable data type
SQLTYPE of host variable1
SQLLEN of host variable
SQL data type
COMP-1 480 4 REAL or FLOAT(n) 1<=n<=21
COMP-2 480 8 DOUBLE PRECISION, or FLOAT(n) 22<=n<=53
S9(i)V9(d) COMP-3 or S9(i)V9(d) PACKED-DECIMAL 484 i+d in byte 1, d in byte 2 DECIMAL(i+d,d) or NUMERIC(i+d,d)
S9(i)V9(d) DISPLAY SIGN LEADING SEPARATE 504 i+d in byte 1, d in byte 2 No exact equivalent. Use DECIMAL(i+d,d) or NUMERIC(i+d,d)
S9(i)V9(d) NATIONAL SIGN LEADING SEPARATE 504 i+d in byte 1, d in byte 2 No exact equivalent. Use DECIMAL(i+d,d) or NUMERIC(i+d,d)
S9(4) COMP-4, S9(4) COMP-5, S9(4) COMP, or S9(4) BINARY 500 2 SMALLINT
S9(9) COMP-4, S9(9) COMP-5, S9(9) COMP, or S9(9) BINARY 496 4 INTEGER
S9(18) COMP-4, S9(18) COMP-5, S9(18) COMP, or S9(18) BINARY 492 8 BIGINT
Fixed-length character data 452 n CHAR(n)
Varying-length character data 1<=n<=255 448 n VARCHAR(n)
Varying-length character data m>255 456 m VARCHAR(m)
Fixed-length graphic data 468 m GRAPHIC(m)
Varying-length graphic data 1<=m<=127 464 m VARGRAPHIC(m)
Varying-length graphic data m>127 472 m VARGRAPHIC(m)
SQL TYPE is BINARY(n), 1<=n<=255 912 n BINARY(n)
SQL TYPE is VARBINARY(n), 1<=n<=32 704 908 n VARBINARY(n)
SQL TYPE IS RESULT-SET-LOCATOR 972 4 Result set locator2
SQL TYPE IS TABLE LIKE table-name AS LOCATOR 976 4 Table locator2
SQL TYPE IS BLOB-LOCATOR 960 4 BLOB locator2
SQL TYPE IS CLOB-LOCATOR 964 4 CLOB locator2
SQL TYPE IS DBCLOB-LOCATOR 968 4 DBCLOB locator2
USAGE IS SQL TYPE IS BLOB(n) 1≤n≤2147483647 404 n BLOB(n)
USAGE IS SQL TYPE IS CLOB(n) 1≤n≤2147483647 408 n CLOB(n)
USAGE IS SQL TYPE IS DBCLOB(m) 1≤m≤10737418233 412 n DBCLOB(m)3
SQL TYPE IS XML AS BLOB(n) 404 0 XML
SQL TYPE IS XML AS CLOB(n) 408 0 XML
SQL TYPE IS XML AS DBCLOB(n) 412 0 XML
SQL TYPE IS BLOB-FILE 916/917 267 BLOB file reference2
SQL TYPE IS CLOB-FILE 920/921 267 CLOB file reference2
SQL TYPE IS DBCLOB-FILE 924/925 267 DBCLOB file reference2
SQL TYPE IS XML AS BLOB-FILE 916/917 267 XML BLOB file reference2
SQL TYPE IS XML AS CLOB-FILE 920/921 267 XML CLOB file reference2
SQL TYPE IS XML AS DBCLOB-FILE 924/925 267 XML DBCLOB file reference2
SQL TYPE IS ROWID 904 40 ROWID
Notes:
  1. If a host variable includes an indicator variable, the SQLTYPE value is the base SQLTYPE value plus 1.
  2. Do not use this data type as a column type.
  3. m is the number of double-byte characters.
The following table shows equivalent COBOL host variables for each SQL data type. Use this table to determine the COBOL data type for host variables that you define to receive output from the database. For example, if you retrieve TIMESTAMP data, you can define a fixed-length character string variable of length n
This table shows direct conversions between SQL data types and COBOL data types. However, a number of SQL data types are compatible. When you do assignments or comparisons of data that have compatible data types, DB2® converts those compatible data types.

COBOL host variable equivalents that you can use when retrieving data of a particular SQL data type
SQL data type
COBOL host variable equivalent
Notes
SMALLINT
S9(4) COMP-4,
S9(4) COMP-5,
S9(4) COMP,
or S9(4) BINARY

INTEGER
S9(9) COMP-4,
S9(9) COMP-5,
S9(9) COMP,
or S9(9) BINARY

DECIMAL(p,s) or NUMERIC(p,s)
S9(p-s)V9(s) COMP-3 or
S9(p-s)V9(s)
 PACKED-DECIMAL
 DISPLAY SIGN
 LEADING SEPARATE
 NATIONAL SIGN
 LEADING SEPARATE
p is precision; s is scale. 0<=s<=p<=31. If s=0, use S9(p)V or S9(p). If s=p, use SV9(s). If the COBOL compiler does not support 31–digit decimal numbers, no exact equivalent exists. Use COMP-2.
REAL or FLOAT (n)
COMP-1
1<=n<=21
DOUBLE PRECISION, DOUBLE or FLOAT (n)
COMP-2
22<=n<=53
BIGINT S9(18) COMP-4, S9(18) COMP-5, S9(18) COMP, or S9(18) BINARY
CHAR(n)
Fixed-length character string. For example,
01 VAR-NAME PIC X(n).
1<=n<=255
VARCHAR(n)
Varying-length character string. For example,
01 VAR-NAME.
   49 VAR-LEN PIC S9(4)
 USAGE BINARY.
   49 VAR-TEXT PIC X(n).
The inner variables must have a level of 49.
GRAPHIC(n)
Fixed-length graphic string. For example,
01 VAR-NAME PIC G(n)
   USAGE IS DISPLAY-1.
n refers to the number of double-byte characters, not to the number of bytes. 1<=n<=127
VARGRAPHIC(n)
Varying-length graphic string. For example,
01 VAR-NAME.
   49 VAR-LEN PIC S9(4)
 USAGE BINARY.
   49 VAR-TEXT PIC G(n) 
      USAGE IS DISPLAY-1.
n refers to the number of double-byte characters, not to the number of bytes.
The inner variables must have a level of 49.
BINARY(n) SQL TYPE IS BINARY(n) 1<=n<=255
VARBINARY(n) SQL TYPE IS VARBINARY(n) 1<=n<=32 704
DATE
Fixed-length character string of length n. For example,
01 VAR-NAME PIC X(n).
If you are using a date exit routine, n is determined by that routine. Otherwise, n must be at least 10.
TIME
Fixed-length character string of length n. For example,
01 VAR-NAME PIC X(n).
If you are using a time exit routine, n is determined by that routine. Otherwise, n must be at least 6; to include seconds, n must be at least 8.
TIMESTAMP
Fixed-length character string of length n. For example,
01 VAR-NAME PIC X(n).
n must be at least 19. To include microseconds, n must be 26; if n is less than 26, truncation occurs on the microseconds part.
TIMESTAMP(0)
Fixed-length character string of length n. For example,
01 VAR-NAME PIC X(n).
n must be at least 19.
TIMESTAMP(p) p > 0
Fixed-length character string of length n. For example,
01 VAR-NAME PIC X(n
).
n must be at least 19. To include fractional seconds, n must be 20+x where x is the number of fractional seconds to include; if x is less than p, truncation occurs on the fractional seconds part.
TIMESTAMP(0) WITH TIME ZONE
Varying-length character string. For example,
01 VAR-NAME.
49 VAR-LEN PIC S9(4) USAGE
BINARY. 49 VAR-TEXT PIC
X(n).
The inner variables must have a level of 49. n must be at least 25.
TIMESTAMP(p) WITH TIME ZONE
Varying-length character string. For example,
01 VAR-NAME.
49 VAR-LEN PIC S9(4) USAGE
BINARY. 49 VAR-TEXT PIC
X(n).
The inner variables must have a level of 49. n must be at least 26+p.
Result set locator
SQL TYPE IS
RESULT-SET-LOCATOR
Use this data type only for receiving result sets. Do not use this data type as a column type.
Table locator
SQL TYPE IS
 TABLE LIKE
 table-name
 AS LOCATOR
Use this data type only in a user-defined function or stored procedure to receive rows of a transition table. Do not use this data type as a column type.
BLOB locator
USAGE IS SQL TYPE IS
BLOB-LOCATOR
Use this data type only to manipulate data in BLOB columns. Do not use this data type as a column type.
CLOB locator
USAGE IS SQL TYPE IS
CLOB-LOCATOR
Use this data type only to manipulate data in CLOB columns. Do not use this data type as a column type.
DBCLOB locator
USAGE IS SQL TYPE IS
DBCLOB-LOCATOR
Use this data type only to manipulate data in DBCLOB columns. Do not use this data type as a column type.
BLOB(n)
USAGE IS SQL TYPE IS
BLOB(n)
1≤n≤2147483647
CLOB(n)
USAGE IS SQL TYPE IS
CLOB(n)
1≤n≤2147483647
DBCLOB(n)
USAGE IS SQL TYPE IS
DBCLOB(n)
n is the number of double-byte characters. 1≤n≤1073741823
XML SQL TYPE IS XML AS BLOB(n) 1≤n≤2147483647
XML SQL TYPE IS XML AS CLOB(n) 1≤n≤2147483647
XML SQL TYPE IS XML AS DBCLOB(n) n is the number of double-byte characters. 1≤n≤1073741823
BLOB file reference
USAGE IS SQL TYPE IS
BLOB-FILE
Use this data type only to manipulate data in BLOB columns. Do not use this data type as a column type.
CLOB file reference
USAGE IS SQL TYPE IS
CLOB-FILE
Use this data type only to manipulate data in CLOB columns. Do not use this data type as a column type.
DBCLOB file reference
USAGE IS SQL TYPE IS
DBCLOB-FILE
Use this data type only to manipulate data in DBCLOB columns. Do not use this data type as a column type.
XML BLOB file reference SQL TYPE IS XML AS BLOB-FILE Use this data type only to manipulate XML data as BLOB files. Do not use this data type as a column type.
XML CLOB file reference SQL TYPE IS XML AS CLOB-FILE Use this data type only to manipulate XML data as CLOB files. Do not use this data type as a column type.
XML DBCLOB file reference SQL TYPE IS XML AS DBCLOB-FILE Use this data type only to manipulate XML data as DBCLOB files. Do not use this data type as a column type.
ROWID
SQL TYPE IS ROWID