Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Extracting data from a journal

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

  • Extracting data from a journal

    I usually dump the journal entries to an OUTFILE with DSPJRN *RCD. Then create a DDS PF that contains the same first 17 fields JOxxxx as in the outfile. The 18th field is the raw data, JOESD. Put your database field definitions as fields 18 - nnn in this DDS PF. Compile this PF. Then CPYF *NOCHK. Chris

  • #2
    Extracting data from a journal

    Chris, I'm sure you know this but Michael may not. There are 5 different types of outfile and I think the one you're describing is the Type1 file which has the least amount of info. We have an application that uses the Journal to track all activity to our Master files and when we dump the Journal we use the Type3 outfile because it includes additional information, most importantly for us, a TimeStamp field for when the DB activity occurred instead of 6 char Date and Time fields used in Type1 and Type2. Reading the docs it's my interpretation that the 6 char fields are formatted based on the Date/Time Format of the Job associated with the DB event that triggered the Journal Entry and this format info isn't available in the Outfile. So the TimeStamp field seemed to involve less guess-work and seemed more "Audit-Proof" as well. Also if you need to know which Receiver the Entry came from, I think that the Type5 outfile is the only one to provide that information. Mike

    Comment


    • #3
      Extracting data from a journal

      You don't have to manually code all of your field definitions so that the journal data is correctly formatted. Instead declare the record format as a data structure in your program's D specs and then MoveL the field JOESD to that data structure in your C specs like so:
      Code

      Comment


      • #4
        Extracting data from a journal

        Just depends on what you need. For example, I and others need to run SQL ad hoc queries over the journal entry data fields to find rogue programs, etc. It's much easier if JOESD is already parsed out in a PF. I don't need RPG to do that. Chris

        Comment


        • #5
          Extracting data from a journal

          I have turned on jounraling for a file on our iSeries, and I was wondering is there any APIs out there that would allow you to read the data into an RPG progam. I may need to do this in order to recover some data that is being corrupted by a bug in a program that I haven't been able to nail down yet. Any help would be greatly appreciated.

          Comment


          • #6
            Extracting data from a journal

            Try the EXPJRNE command. You give it a file name,it reads all the online receivers and produces a file, complete with the correct field names, of all changes to the file. You can then read this file into your RPG program. Or analyse it with SQL or Query. It's fairly easy to download and install. http://www.tools400.de/English/Freew...utilities.html

            Comment

            Working...
            X