Try this.

Don't hard code the Fixed portion of the D/S (ie 1st parm)   Use DDS
(ETPFZ1) at bottom to SoftCode it.

Use Pointers to reference offset to the before and after image.

Here is a whole  Generic (replace DCPFDCC with your file name and you are
off and running)

John Carr

(Yes I am rewriting this for Free format and V5R1 BIF's)

enjoy

  *=====================================================================
  *    Parm1 - First Parm from OS/400, It contains the Trigger Data
  *=====================================================================
 DPARM1          E DS                  EXTNAME(ETPFZ1)

 D  Buffer                 1  10000
 D BArray                         1A   OVERLAY(Buffer) Dim(%SIZE(Buffer)

  *=====================================================================
  *    Parm2 - 2nd Parm from OS/400, It not used in this program
  *=====================================================================
 DPARM2            DS
 D      LEN                       8B 0
  *==================================================================
  *    Before Image of Record
  *==================================================================
 D BDS           E DS                  EXTNAME(DCPFDCC) PREFIX(B)
 D                                     BASED(Bptr)
  *==================================================================
  *    After Image of Record
  *==================================================================
 D ADS           E DS                  EXTNAME(DCPFDCC) PREFIX(A)
 D                                     BASED(Aptr)
 *==================================================================
  *    Standard image of the record
  *==================================================================
 D DCC          E DS                  EXTNAME(DCPFDCC)
 *===================================================
 *    Named Constants Used In Program
 *===================================================

D Aptr            S               *
D Bptr            S               *

C     *ENTRY        PLIST
C                   PARM                    PARM1
C                   PARM                    PARM2
C*
C                   EVAL      Bptr     =    %ADDR(BArray(Z1OROFF +1))
C                   EVAL      Aptr     =    %ADDR(BArray(Z1NROFF +1))

C                   SELECT
 *    Z1EVENT 1 = Add
C                   WHEN      Z1EVENT   = '1'
C                   EVAL      DCC       =  ADS

C                   EXSR      DO_ADD

*     Z1EVENT 2 = Delete
C                   WHEN      Z1EVENT   = '2'
C                   EVAL      DCC       = BDS

C                   EXSR      DO_DELETE

C*    DDMEVENT 3 = Update
C                   WHEN      RVMEVENT   = '3'
C                   EVAL      DCC        = ADS

C                   EXSR      DO_UPDATE

C                   ENDSL


A                                                   REF(ETFR001)
A          R ETRFZ1                    TEXT('ET - Trigger Program Parameter
Template')
A*
A            Z1FILE    R
A            Z1LIB     R
A            Z1MBR     R
A            Z1EVENT   R
A            Z1TIME    R
A            Z1COMMIT  R
A            Z1RESERVE1R
A            Z1CCSID   R
A            Z1RESERVE2R
A            Z1OROFF   R
A            Z1ORLEN   R
A            Z1ORNBO   R
A            Z1ORNBL   R
A            Z1NROFF   R
A            Z1NRLEN   R
A            Z1NRNBO   R
A            Z1NRNBL   R
A            Z1RESERVE3R
A*


Part of my field ref file  ETFR001


A*
A            Z1FILE    R               REFFLD(FILE       *SRC)
A            Z1LIB     R               REFFLD(LIBRARY    *SRC)
A            Z1MBR     R               REFFLD(MEMBER     *SRC)
A            Z1EVENT        1
A                                      TEXT('Event - 1=Insert, 2=Delete
A                                      3=Update')
A                                      COLHDG('Event' '1=Add,2=Del' +
A                                      '3=Upd')
A            Z1TIME         1
A                                      TEXT('Timing - 1=After, 2=Before
A                                      COLHDG('Timing' '1=After'    +
A                                      '2=Before')
A            Z1COMMIT       1
A            Z1COMMIT       1
A                                      TEXT('Commitment Level')
A                                      COLHDG('Commitment' 'Levle')
A*
A            Z1RESERVE1     3
A                                      TEXT('Reserved 3 Bytes')
A                                      COLHDG('Reserved' '3 Bytes')
A*
A            Z1CCSID        8B
A                                      TEXT('CCSID ID')
A                                      COLHDG('CCSID' 'ID')
A*
A            Z1RESERVE2     8
A                                      TEXT('Reserved 8 Bytes')
A                                      COLHDG('Reserved' '8 Bytes')
A*
A            Z1OROFF        8B
A                                      TEXT('Old Record Offset')
A                                      COLHDG('Old' 'Record' 'Offset')
A*
A            Z1ORLEN        8B
A                                      TEXT('Old Record Length')
A                                      COLHDG('Old' 'Record' 'Length')
A*
A            Z1ORNBO        8B
A                                      TEXT('Old Record Null Byte +
A                                      Map Offset')
A                                      COLHDG('Old Record' 'Null Byte'
A                                      'Map Offset')
A*
A            Z1ORNBL        8B
A                                      TEXT('Old Record Null Byte +
A                                      Map Length')
A                                      COLHDG('Old Record' 'Null Byte'
A                                      'Map Length')
A*
A*
A            Z1NROFF        8B
A                                      TEXT('New Record Offset')
A                                      COLHDG('New' 'Record' 'Offset')
A*
A            Z1NRLEN        8B
A                                      TEXT('New Record Length')
A                                      COLHDG('Old' 'Record' 'Length')
A*
A            Z1NRNBO        8B
A                                      TEXT('New Record Null Byte +
A                                      Map Offset')
A                                      COLHDG('New Record' 'Null Byte'
A                                      'Map Offset')
A*
A            Z1NRNBL        8B
A                                      TEXT('New Record Null Byte +
A                                      Map Length')
A                                      COLHDG('New Record' 'Null Byte'
A                                      'Map Length')
A            Z1RESERVE3    16
A                                      TEXT('Reserved 16 Bytes')
A                                      COLHDG('Reserved' '16 Bytes')




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.