|
I have seen messages in the past concerning monitoring an IFS folder for activity using RCVJRNE and Journaling and thought I might pass along what I found for the archives as I did not see a complete solution in the archives. To journal an IFS folder, I just went to Operations Navigator and under Database and created a journal in QGPL and told the operating system to clean up the receivers when no longer needed. I then went to file system and to the folder I wanted to monitor and did a right mouse button and selected journaling. I turned on journaling requesting that it not log open and closes. When finished each time a file is added or deleted, records are written the journal. I am only interested in the B (IFS), JT entries to get the name of the file added. To make this work you need to issue the command RCVJRNE in submitted job or in a CL. RCVJRNE JRN(IFS_AUDIT) EXITPGM(TESTJRN) JRNCDE((B)) ENTTYP(JT) ENTFMT(*TYPE1) Ok, so here is my exit test program. Instructions in header are instructions To create used by my Make tool Compile. Hope this is helpful to someone. *_> CNLLSTSPLF SRCFILE(@2/@1) SRCMBR(@3) *_> DLTPGM PGM(@5/@4) *_> DLTMOD MODULE(@5/@4) *_> CRTRPGMOD MODULE(@5/@4) SRCFILE(@2/@1) SRCMBR(@3) + *_> DBGVIEW(@9) OPTIMIZE(@8) OPTION(*EVENTF) *_> CRTPGM PGM(@5/@4) MODULE(TESTJRN) + *_> TEXT(*ENTMODTXT) BNDSRVPGM(QP0LLIB2) + *_> ACTGRP(QILE) h Option(*Srcstmt:*Nodebugio) /copy *libl/qsrcf,cb_stdtype /copy *libl/qsrcf,cb_std_con d cNoEntry... d c '0' d cSingleEntry... d c '1' d cBlockEntry... d c '2' d cReceiveChangedEnd... d c '3' d cBeginBlockMode... d c '8' d cEndReceiveJournalEntry... d c '9' // *Type One Journal Entry d TD_JournalEntry... d ds Qualified d Based(StdNulPtr) d EntryLength... d 5s 0 d SequenceNumber... d 10s 0 d JournalCode... d Like(StdChr) d EntryType... d 2a d Date... d 6a d Time... d 6s 0 d JobName... d Like(StdNam) d UserName... d Like(StdNam) d JobNumber... d 6s 0 d ProgramName... d Like(StdNam) d NamePlusLibrary... d 20a d FileId... d 16a Overlay(NamePlusLibrary:1) d ObjectName... d Like(StdNam) d Overlay(NamePlusLibrary:1) d ObjectLibrary... d Like(StdNam) d Overlay(NamePlusLibrary: d 11 ) d MemberName... d Like(StdNam) d Count_Relative... d 10s 0 d IndicatorFlag... d Like(StdChr) d CommitCycleId... d 10s 0 d InCompleteData... d Like(StdChr) d MinimizedEntry... d Like(StdChr) d Reserved1... d 6a d TD_RunStatus... d ds Qualified d Based(StdNulPtr) d Control... d Like(StdChr) d Available... d Like(StdChr) d WhatPassed... d Like(StdChr) d GetPathAPI... d pr ExtProc('Qp0lGetPathFromFileID') d Like(StdChr) d PR_OutPathName... d 256a d PR_InPathSize... d Like(StdInt) d Value d PR_InFileId... d 16a d ProgramEntrance... d pr ExtPgm('TESTJRN') d PR_InJournalEntry... d LikeDs(TD_JournalEntry) d PR_InRunStatus... d LikeDs(TD_RunStatus) d w_Path... d s 256a d Result... d s Like(StdChr) d ProgramEntrance... d pi d InJournalEntry... d LikeDs(TD_JournalEntry) d InRunStatus... d LikeDs(TD_RunStatus) /Free If InRunStatus.Control = cNoEntry; Clear InJournalEntry; Return; EndIf; // Get full path from File Id. Result = GetPathAPI(w_Path : %Size(w_Path) : InJournalEntry.FileId); Clear InJournalEntry; Return; /End-Free
As an Amazon Associate we earn from qualifying purchases.
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.