rpg de traitement des formats

BoTTom |
      * =============== source copié depuis QSYSINC ======================
 
     D*** START HEADER FILE SPECIFICATIONS *******************************
     D*
     D*Header File Name       :  H/EZDAEP
     D*
     D*Descriptive Name       :  Database Server Exit Program structures
     D*
     D*5716-SS1  (C) Copyright IBM Corp. 1995.
     D*All rights reserved.
     D*US Government Users Restricted Rights -
     D*Use, duplication or disclosure restricted
     D*by GSA ADP Schedule Contract with IBM Corp.
     D*
     D*Licensed Materials-Property of IBM
     D*
     D*Description: This include defines the parameter structures for
     D*         the four exit points defined for the database
     D*         server.
     D*
     D*          1) QIBM_QZDA_INIT format ZDAI0100
     D*               Used when the database server is started
     D*
     D*          2) QIBM_QZDA_NDB1 format ZDAD0100
     D*               Used for all native database requests, except
     D*               the Add Library List request
     D*             QIBM_QZDA_NDB1 format ZDAD0200
     D*               Used for the native database Add Library List
     D*               request
     D*
     D*          3) QIBM_QZDA_ROI1 format ZDAR0100
     D*               Used for all retrieve object information
     D*               requests, except the Foreign and Primary
     D*               Key requests
     D*             QIBM_QZDA_ROI1 format ZDAR0200
     D*               Used for the retrieve object information
     D*               Foreign and Primary Key requests
     D*
     D*          4) QIBM_QZDA_SQL1 format ZDAQ0100
     D*               Used for SQL requests of 512 bytes or less
     D*             QIBM_QZDA_SQL1 format ZDAQ0200
     D*               Used for SQL requests of more than 512 bytes
     D*
     D*


|
     D*Header Files Included: None.
     D*
     D*Macros List: None.
     D*
     D*Structure List: Qzda_Init_Format_t
     D*            Qzda_NDB_Format1_t
     D*            Qzda_NDB_Format2_t
     D*            Qzda_ROI_Format1_t
     D*            Qzda_ROI_Format2_t
     D*            Qzda_SQL_Format_t
     D*            Qzda_SQL_Format2_t
     D*
     D*Function Prototype List: None.
     D*
     D*Change Activity:
     D*
     D*CFD List:
     D*
     D*FLAG REASON    LEVEL DATE   PGMR      CHANGE DESCRIPTION
     D*---- --------- ----- ------ --------- -------------------------
     D*$A0= P3978167  3D60  950210 ROCHESTER:New Include
     D*$A1= P3613759  3D70  960314 M S Moore:Add new SQL format
     D*
     D*End CFD List.
     D*
     D*Additional notes about the Change Activity
     D*End Change Activity.
     D*** END HEADER FILE SPECIFICATIONS *********************************
     D*Server ID constants
     D*Format name constants
     D*Function ID constants for init portion of the database server
     D*Function ID constants for the NDB portion of the database server
     D*Function ID constants for the ROI portion of the database server
     D*Function ID constants for the SQL portion of the database server
     D*******************************************************************
     D*Typedef for the database init exit point format
     D*******************************************************************
     DEZDQIF           DS
     D*                                             Qzda Init Format
     D EZDUP                   1     10
     D*                                   User profile name
     D EZDSID                 11     20
     D*                                   Server identifier
     D EZDFN                  21     28


|
     D*                                   User exit format name
     D EZDFID                 29     32B 0
     D*                                   Requested function id
     D*******************************************************************
     D*Typedef for the native database exit point format £1
     D*******************************************************************
     DEZDNDBF1         DS
     D*                                             Qzda NDB Format1
     D EZDUP00                 1     10
     D*                                   User profile name
     D EZDSID00               11     20
     D*                                   Server identifier
     D EZDFN00                21     28
     D*                                   User exit format name
     D EZDFID00               29     32B 0
     D*                                   Requested function id
     D EZDFILN                33    160
     D*                                   File name
     D EZDLN                 161    170
     D*                                   Library name
     D EZDMN                 171    180
     D*                                   Member name
     D EZDORITY              181    190
     D*                                   Authority
     D EZDBFILN              191    318
     D*                                   Base file name
     D EZDBLN                319    328
     D*                                   Base library name
     D EZDOFILN              329    338
     D*                                   Override file name
     D EZDOLN                339    348
     D*                                   Override library name
     D EZDOMN                349    358
     D*                                   Override member name
     D*******************************************************************
     D*Typedef for the native database exit point format £2
     D*******************************************************************
     DEZDNDBF2         DS
     D*                                             Qzda NDB Format2
     D EZDUP01                 1     10
     D*                                   User profile name
     D EZDSID01               11     20
     D*                                   Server identifier
     D EZDFN01                21     28


|
     D*                                   User exit format name
     D EZDFID01               29     32B 0
     D*                                   Requested function id
     D EZDNOL                 33     36B 0
     D*                                   Number of libraries in list
     D EZDLN00                37     46    DIM(00001)
     D*                                   List of library names
     D*******************************************************************
     D*Typedef for retrieve object information exit point format £1
     D*******************************************************************
     DEZDROIF1         DS
     D*                                             Qzda ROI Format1
     D EZDUP02                 1     10
     D*                                   User profile name
     D EZDSID02               11     20
     D*                                   Server identifier
     D EZDFN02                21     28
     D*                                   User exit format name
     D EZDFID02               29     32B 0
     D*                                   Requested function id
     D EZDLN01                33     52
     D*                                   Library name
     D EZDRDBN                53     88
     D*                                   Relational database name
     D EZDPN                  89    108
     D*                                   Package name
     D EZDFILN00             109    364
     D*                                   File name
     D EZDMN00               365    384
     D*                                   Member name
     D EZDFN03               385    404
     D*                                   Format name
     D*******************************************************************
     D*Typedef for retrieve object information exit point format £2
     D*******************************************************************
     DEZDROIF2         DS
     D*                                             Qzda ROI Format2
     D EZDUP03                 1     10
     D*                                   User profile name
     D EZDSID03               11     20
     D*                                   Server identifier
     D EZDFN04                21     28
     D*                                   User exit format name
     D EZDFID03               29     32B 0


|
     D*                                   Requested function id
     D EZDPKLN                33     42
     D*                                   Primary key library name
     D EZDPKN                 43    170
     D*                                   Primary key table name
     D EZDFKLN               171    180
     D*                                   Foreign key library name
     D EZDFKN                181    308
     D*                                   Foreign key table name
     D*******************************************************************
     D*Typedef for the SQL exit point format
     D*******************************************************************
     DEZDQSQLF         DS
     D*                                             Qzda SQL Format
     D EZDUP04                 1     10
     D*                                   User profile name
     D EZDSID04               11     20
     D*                                   Server identifier
     D EZDFN05                21     28
     D*                                   User exit format name
     D EZDFID04               29     32B 0
     D*                                   Requested function id
     D EZDSN                  33     50
     D*                                   Statement name
     D EZDCN                  51     68
     D*                                   Cursor name
     D EZDPO                  69     70
     D*                                   Prepare option
     D EZDOA                  71     72
     D*                                   Open attributes
     D EZDPN00                73     82
     D*                                   Package name
     D EZDPLN                 83     92
     D*                                   Package library name
     D EZDRDACI               93     94B 0
     D*                                   DRDA connect indicator
     D EZDCI                  95     95
     D*                                   Commit indicator
     D EZDSQLST               96    607
     D*                                   SQL statement text
     D*******************************************************************
     D*Typedef for the SQL exit point format £2                    àA1A
     D*******************************************************************
     DEZDSQLF2         DS


|
     D*                                             Qzda SQL Format2
     D EZDUP05                 1     10
     D*                                   User profile name
     D EZDSID05               11     20
     D*                                   Server identifier
     D EZDFN06                21     28
     D*                                   User exit format name
     D EZDFID05               29     32B 0
     D*                                   Requested function id
     D EZDSN00                33     50
     D*                                   Statement name
     D EZDCN00                51     68
     D*                                   Cursor name
     D EZDPO00                69     70
     D*                                   Prepare option
     D EZDOA00                71     72
     D*                                   Open attributes
     D EZDPN01                73     82
     D*                                   Package name
     D EZDPLN00               83     92
     D*                                   Package library name
     D EZDRDACI00             93     94B 0
     D*                                   DRDA connect indicator
     D EZDCI00                95     95
     D*                                   Commit indicator
     D EZDDSQLL               96    105
     D*                                   Default SQL Collection àA1A
     D EZDRSVA               106    232
     D*                                   Reserved for future useàA1A
     D EZDQLSTL              233    236B 0
     D*                                   Length of SQL Stmt textàA1A
     D EZDSQLST00            237   2028
     D*                                   SQL statement text     àA1C
 
      * =============== fin de copie======================================
     Dparam            DS
     D profil                        10
     D serverID                      10
     D format                         8
     D filler                      2000
 
     dtblaction        s              9B 0 dim(8)
     d                                     ctdata perrcd(1)
 


|
     dtblcde           s             10    dim(8)
     d                                     ctdata perrcd(1)
 
     D i               s              2  0
 
 
     C     *entry        plist
     C                   parm                    param
     C                   parm                    msg             512
     c                   select
      * connection
     c                   when      format = 'ZDAI0100'
     c                   eval      ezdqif = param
     c                   exsr      connectSR
 
      * gestion des fichiers
     c                   when      format = 'ZDAD0100'
     c                   eval      ezdndbf1 = param
     c                   exsr      wrkbaseSR
 
      * gestion de *libl
     c                   when      format = 'ZDAD0200'
     c                   eval      ezdndbf2 = param
     c                   exsr      addliblSR
 
      * extraction d'informations/fichier
     c                   when      format = 'ZDAR0100'
     c                   eval      ezdroif1 = param
     c                   exsr      dspffdSR
 
      * extraction d'informations(clé primaire)
     c                   when      format = 'ZDAR0200'
     c                   eval      ezdroif2 = param
     c                   exsr      pfcstSR
 
      * requete SQL (<= 512 octets)
     c                   when      format = 'ZDAQ0100'
     c                   eval      ezdqsqlf  = param
     c                   exsr      sql1SR
 
      * requete SQL (> 512 octets)
     c                   when      format = 'ZDAQ0200'
     c                   eval      ezdsqlf2 = param
     c                   exsr      sql2SR


|
     c                   endsl
 
     c                   return
      *+++
      *+++  sous/pgms
      *+++
     c     connectSR     begsr
     c                   eval      msg = profil + ' se connecte'
     c                   endsr
 
 
 
     c     wrkbaseSR     begsr
     c                   eval      i = 1
     c     EZDFID00      lookup    tblaction(i)                           50
     c                   eval      msg = profil + ' lance la commande ' +
     c                              tblcde(i)
     c                   endsr
 
 
     c     addliblSR     begsr
     c                   eval      msg = profil + ' ajoute ' +
     c                              EZDLN00(1) + ' à *libl'
     c                   endsr
 
 
     c     dspffdSR      begsr
     c                   eval      msg = profil + ' extrait des infos sur '
     c                              + EZDFILN00
     c                   endsr
 
 
     c     pfcstSR       begsr
     c                   eval      msg = profil + ' demande la clé de '
     c                              + EZDPKN
     c                   endsr
 
 
     c     sql1SR        begsr
     c                   eval      msg = profil + ' exécute la requête '
     c                              + EZDSQLST
     c                   endsr
 
 


|
     c     sql2SR        begsr
     c                   eval      msg = profil + ' exécute la requête '
     c                              + EZDSQLST00
     c                   endsr
** tblaction
000006144
000006145
000006146
000006147
000006148
000006149
000006150
000006153
** tblcde
CRTSRCPF
CRTPF
ADDPFM
CLRPFM
RMVM
OVRDBF
DLTOVR
DLTF




©AF400