Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Journal information

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Journal information

    I would like to retrieve some jounal information programatically. I would like to us the functionality of WRKJRNA and/or DSPJRNRCVA in a program. I can't find any RTV journal commands or even better, journal APIs that will give me this info. Thanks.

  • #2
    Journal information

    In V4R2 there are several new APIs in the area of journaling. Two of interest to you would be QjoRetrieveJournalInformation() and QjoRtvJrnReceiverInformation(). These are documented in the Journal and Commit APIs chapter of the System API Reference. For earlier releases the information was also available through the MI instructions MATJPAT and MATJSAT; and for security level 40 and above systems MI like APIs (QusMaterializeJournalPortAttr and QusMaterializeJournalSpaceAttr). The APIs were provided to get around the domain failures seen in the direct MI usage at higher security levels. These APIs are also in the System API Reference Journal and Commit APIs chapter though I do not recall off hand what release they first became available (though it is earlier than V4R2).

    Comment


    • #3
      Journal information

      do you have an example of the QjoRtvJrnReceiverInformation() API? I need to know how many enteries are currently in a receiver or how large that receiver is. Would this API work for what I need to be done?

      Comment


      • #4
        Journal information

        Not real sure how this will format, but here's a sample: PGM DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(512) DCL VAR(&RCVVARSIZ) TYPE(*CHAR) LEN(4) VALUE(X'00000200') DCL VAR(&JRNRCVNAM) TYPE(*CHAR) LEN(20) VALUE('AUDRCV01 QSYS ') DCL VAR(&FORMAT) TYPE(*CHAR) LEN(8) VALUE('RRCV0100') DCL VAR(&SIZE) TYPE(*DEC) LEN(9 0) DCL VAR(&NUMENT) TYPE(*DEC) LEN(9 0) CALLPRC PRC('QjoRtvJrnReceiverInformation') PARM(&RCVVAR &RCVVARSIZ + &JRNRCVNAM &FORMAT *OMIT) CHGVAR VAR(&SIZE) VALUE(%BIN(&RCVVAR 53 4)) CHGVAR VAR(&NUMENT) VALUE(%BIN(&RCVVAR 61 4)) ENDPGM

        Comment


        • #5
          Journal information

          Thank you. That helped a lot.

          Comment


          • #6
            Journal information

            Bruce, Thanks for the great example. I found that the Size returned did not equal that reported by the DSPJRNATR command. Here's a debug dump of my CL program and the &SIZE, &NUMENT, &RCVVAR variables: DCL VAR(&SIZE) TYPE(*DEC) LEN(10 0) DCL VAR(&NUMENT) TYPE(*DEC) LEN(10 0) CALLPRC PRC('QjoRtvJrnReceiverInformation') + PARM(&RCVVAR &RCVVARSIZ &JRNRCVNAM + &FORMAT *OMIT) CHGVAR VAR(&SIZE) VALUE(%BIN(&RCVVAR 53 4)) CHGVAR VAR(&NUMENT) VALUE(%BIN(&RCVVAR 61 4)) ENDPGM &JRNRCVNAM = 'DMCJRN0685D_MIRROR ' &RCVVAR = ....5...10...15...20...25...30...35...40...45...50 ...55...60 1 ' DMCJRN0685D_MIRROR DMCJRN D_MIRROR ' 61 ' 5 20 1001211030001100121106000' 121 '30000000000000NE OLR/NCR Journal Receiver ' 181 ' 00 ' 241 ' DMCJRN06' 301 '84D_MIRROR DMCJRN0686D_MIRROR ' &SIZE = 0000738088. &NUMENT = 0000589626. The DSPJRNRCVA command shows that the byte size is: DMCJRN0685 Library . . . . . . . : D_MIRROR DMCJRN Library . . . . . . . : D_MIRROR *NONE Size . . . . . . . . . : 755802112 Any ideas why the SIZE in the &Size parameter doesnon't match that in the DSPJRNRCVA command?

            Comment


            • #7
              Journal information

              Here's a sample CL program to retrieve the Attached Journal receiver name. It errors on the parameter list, can anyone offer help! Thanks in advance! PGM DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(372) DCL VAR(&RCVVARSIZ) TYPE(*CHAR) LEN(4) VALUE(X'00000174') DCL VAR(&JRNNAM) TYPE(*CHAR) LEN(20) + VALUE('DMCJRN D_MIRROR ') DCL VAR(&FORMAT) TYPE(*CHAR) LEN(8) VALUE('RJRN0100') DCL VAR(&ATTACHRCVR) TYPE(*CHAR) LEN(10) CALLPRC PRC('QjoRetrieveJournalInformation') + PARM(&RCVVAR &RCVVARSIZ &JRNNAM + &FORMAT *OMIT) CHGVAR VAR(&ATTACHRCVR) VALUE('&RCVVAR 201 10') ENDPGM

              Comment


              • #8
                Journal information

                Here's a sample CL program to retrieve the Attached Journal receiver name. It errors on the parameter list, can anyone offer help! Thanks in advance! PGM DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(372) DCL VAR(&RCVVARSIZ) TYPE(*CHAR) LEN(4) VALUE(X'00000174') DCL VAR(&JRNNAM) TYPE(*CHAR) LEN(20) + VALUE('DMCJRN D_MIRROR ') DCL VAR(&FORMAT) TYPE(*CHAR) LEN(8) VALUE('RJRN0100') DCL VAR(&ATTACHRCVR) TYPE(*CHAR) LEN(10) CALLPRC PRC('QjoRetrieveJournalInformation') + PARM(&RCVVAR &RCVVARSIZ &JRNNAM + &FORMAT *OMIT) CHGVAR VAR(&ATTACHRCVR) VALUE('&RCVVAR 201 10') ENDPGM

                Comment


                • #9
                  Journal information

                  For your size question: prior to V4R5 the DSPJRNRCVA size output was in bytes while the API size output was in kilobytes. So if you take the API size and multiply by 1024 (738088 * 1024) you will get the DSPJRNRCVA size of 755802112. In V4R5 I believe DSPJRNRCVA is changed to also provide the size in kilobytes. For your parameter list question: it appears that you are using the number of parameters as defined for QjoRtvJrnReceiverInformation rather than the number and type of parameters for QjoRetrieveJournalInformation. The former has 5 parameters with the fifth being an omissible error code, while the latter has six parameters with the sixth being an omissible error code. Looks like you need to add the Journal information to retrieve parameter.

                  Comment

                  Working...
                  X