Newsgroups: bit.listserv.jes2-l
Date:         Mon, 5 Oct 1992 13:18:00 EDT
From:         Mike Alexander <ZSYSWMA@UCCCMVS.BITNET>
Subject:      Re: Location of PAGEDEF/FORMDEF in JES2 control blocks

Dave,

You can get to the information you want out of Exit 15 in the following
manner:

   1). Get the pointer to the PDDB from the parameter list
   2). Get the SWB track address from field PDBSWBOT in the PDDB
   3). Issue an $EXCP
   4). Process the SWB that was returned. It has the PAGEDEF/FORMDEF
       information in it.

The code I use in Exit 15 to acquire the PAGEDEF follows:

         $MODULE NOTICE=NONE,                                         X 01110000
               (SJPRFX,GEN),       Make sure these two dsects are     X 01260000
               ($SWBIT,GEN),       included                           X 01260000
               $PDDB,                                                 X 01260000

         LR    R6,R1                              Copy parm pointer
         $GETBUF TYPE=HASP,FIX=YES,WAIT=YES       Get a work buffer
         LR    R12,R1                             Set buffer address
         USING BFPDSECT,R12                       Set addressability
         LA    R7,BUFSTART                        Point to data area

         L     R15,12(R6)                         Get PDDB pointer
         USING PDB,R15                            Set addressability
         L     R3,PDBSWBOT                        SWB track address
         DROP  R15                                Finished with PDDB
         LTR   R3,R3                              Was SWB spooled ?
         BZ    error_message                      NO...Skip section
         SPACE
                                  There is a SWB associated with this
                                  output.....read in the control block
         SPACE
         ST    R12,PCEBUFAD                       Save buffer address
         MVI   PCEDEVTP,PCEDARD                   Set READ option
         LA    R0,IOBCCW1                         Point to CCW chain
         ST    R0,IOBSTART                        Set pointer in IOB
         ST    R3,PCESEEK                         Set track address
         LA    R1,PCEDADCT                        Point to DA DCT
         SPACE
         $EXCP (R1),WAIT=YES                      Initiate read request
         BM    error_message                      Request failed

                                  Copy the buffer pointer and then set
                                  set addressability to it

         LR    R15,R12                            Copy original buffer
         USING SWBIT,R15                          Set addressability
         LA    R3,SWBDATA                         Point to variable data
         DROP  R15                                Finished with SWBIT
         USING SJPRFX,R3                          Set prefix pointer
         SR    R15,R15                            Clear prefix length
         SR    R14,R14                            Clear data length
         ICM   R15,B'0001',SJPRPLEN               Set prefix length
         LH    R14,SJPRDLEN                       Set data length
         LA    R3,0(R15,R3)                       Bump past prefix
         DROP  R3
         EJECT
*                                 Should be pointing to the start of
*                                 the OUTPUT statement sub-parameters.
*                                 For now, simply parse thru the list
*                                 looking for a X'001F' prefix which is
*                                 the identifier for the PAGEDEF data

X15#SCAN DS    0H
         CLC   0(2,R3),=X'001F'                   Is this the PAGEDEF
         BE    X15#MTCH                           YES..Go process it
         LA    R3,1(R3)                           NO...Bump source
         BCT   R14,X15#SCAN                       Try again
         B     error_message

                                  For now assume single entry until we
                                  additional information

X15#MTCH DS    0H
         MVC   JCTUSER7(8),$BLANKS                Clear entire field
         LH    R14,4(R3)                          Pick up parm length
         LA    R3,6(R3)                           Point to the data
         LA    R15,JCTUSER7+1                     Point to the target
         STCM  R14,B'0001',JCTUSER7               Save default length
         BCTR  R14,0                              Decrement for execute
         EX    R14,X15#SAVE                       Save JDE name

X15#SAVE MVC   0(*-*,R15),0(R3)



When developing this code, I forced an abend right after the $EXCP (or
at least soon after it) and traced the control blocks myself to see
what was there.

I agree with Doran's response in that unless you can isolate it in an
exit, you may be opening yourself up for a few problems down the road.
Even disregarding the inherent problems with source mods, there is no
guarantee that theinterface will not change with the next release.

Good luck,

Mike Alexander (ZSYSWMA@UCCCMVS)
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU