| Next Tip?
Home » Database Questions, DB2, Mainframe

DB2 understanding : Part – I

8 August 2009 308 views No Comment
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
Loading ... Loading ...

The whole series us updated by Deepthi

Topics covered

  • QMF
  • SPUFI
  • Program preparation and execution
  • DCLGEN
  • LOCKS
  • DB2 Utilities

QMF

Description: QMF = Query Management Facility

An IBM database management tool that allows extensive interactive query and report writing support.  It runs     under the control of the Interactive System Productivity  Facility (ISPF), which in turn runs under Virtual Machine   (VM/CMS) or Time Sharing Option (TSO) on host computers.

SPUFI

Description: SPUFI = SQL Processing Using File Input

A facility of the TSO attachment subcomponent that enables   the DB2I user to execute SQL statements without embedding   them in an application program.

  • SPUFI requires that SQL statements to be executed be stored in a data set. One way to use SPUFI is to create the data set prior to executing
  • SPUFI.  We can make any desired changes to the data set using editing facilities provided by SPUFI before executing the statements stored in it.
  • Alternatively, we can begin a SPUFI session and use the editing facilities of SPUFI to create a data set into which we can place our SQL statements.
  • As SQL statements are processed by SPUFI, the results they generate are stored in a data set. The stored data includes a copy of each SQL statement followed by its results.
  • For a SELECT statement, the results include both the data retrieved and the value of SQLCODE that is returned.
  • By invoking the BROWSE option, we can cause the output data set to be displayed on the terminal. We can use the ISPF browse facilities to move around within the displayed data.
  • SPUFI also provides limited formatting options that we can use to specify how the data in the output data set is displayed or printed.

These formatting options can be set using the SPUFI defaults panel.

PROGRAM PREPARATION  AND EXECUTION

  • Precompile
  • Compile
  • Link-edit
  • Bind/Rebind
  • Execution

Languages that can be used with SQL :

  • Assembler
  • BASIC
  • COBOL
  • FORTRAN
  • PL/1
  • C

DB2 DATA TYPES AND EQUIVALENT COBOL FIELD DEFINITIONS

DATA TYPES      KIND OF DATA        COBOL DEFINITION

SMALLINT                 Half word integer         PIC S  9(4)  COMP

INTEGER                    Full word integer          PIC S  9(9)  COMP

DECIMAL(p,s)          Packed decimal             PIC S  9(7)V99 COMP-3

FLOAT(n)                    Floating point data       (n < 22) COMP-1

(22<= 53) COMP-2

CHAR                          Fixed-length character PIC  X(254)

VARCHAR                  Variable-length character   L  PIC  S9(4) COMP

D PIC  X(254)

GRAPHIC                    Fixed-length                 PIC  G(n) DISPLAY n=127

VARCHAR                  Variable-length           L  PIC  S  9(4)  COMP T  PIC G(127)                                                                                           DISPLAY

DATE                          Date                                     PIC  X(10)

TIME                           Time                                     PIC  X(8)

TIMESTAMP              Date and Time                  PIC  X(26)

Popularity: unranked [?]

Related interview questions

Leave your response!

You must be logged in to post a comment.