Mainframe-Attached Clients - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-06-28
dita:mapPath
wmy1488824663431.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities
  • BTEQ intercepts I/O abends and either converts them to a user 1000 abend or handles the error, allowing the program to continue.
  • When BTEQ converts an abend to a user 1000, it includes a reason code in general register 15 that gives additional information on the abend. The reason code associated with the abend is the C error number value.
    The following is a list of error number values that cause abends:
    • ENOMEM
    • EBADF
    • ENOENT
    • ENOSPC
    • EIO
    • ESPIPE
    • EMVSERR
    • EBUSY
    • EMFILE
  • When BTEQ receives an I/O abend, system error messages appear in the z/OS JES job log.
  • When BTEQ receives an I/O error or an abend, the IBM/C runtime library produces an LSCX (C runtime) message that might provide additional information about the error.
  • JCL applications that are coded to receive only a return code of zero might terminate because of nonzero default return codes even if no other errors occur.

Example – Handling an I/O Abend on z/OS

BTEQ converts an abend to user 1000. This is useful to automate processes based on -job step -condition code checking, as shown in the following example:

//YNBTQ  JOB 1,'Your Name',CLASS=B,Notify=YN,
//              MSGCLASS=A,MSGLEVEL=(1,1)
//BTEQ   EXEC   PGM=BTQMAIN
.............................................
.............................................
//NOFILE DD     DSN=nofile.inthis.location,DISP=SHR
//SYSIN  DD     DATA,DLM=##
.Logon <TDPID>/<UserName>,<PassWd>;
.............................................
.Import Data File=NOFILE
.............................................
   ##
   //CCTEST IF    (ABENDCC=U1000) THEN
   //CRDAFL EXEC  PGM=CRATDTFL
   .............................................
   .............................................
   //NOABND ELSE
   //PROCED EXEC  PGM=DOSMTHNG
   .............................................
   .............................................
   //       ENDIF

In the example, the program CRATDTFL is executed if running the BTEQ program results in a user abend 1000 due to an I/O error. If the BTEQ program runs successfully, DOSMTHNG is executed.