How to know if AS/400 data is journaling properly?

185 pts.
Tags:
AS/400
AS/400 administration
AS/400 Data Reports
AS/400 journaling
How we can know that Data is Journaling proparly or not?

Answer Wiki

Thanks. We'll let you know when a new response is added.

What is your definition of “properly”?

If you just want to see that there is data in the journal receivers, you can issue the DSPJRN command and output to *PRINT or *OUTFILE and review the output for transaction you know you created.

Discuss This Question: 11  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • CharlieBrowne
    You can use the WRKJRN, WRKJRNA, and DSPFD commands to see the current status of the journal
    62,340 pointsBadges:
    report
  • HMSSL2K
    3,175 pointsBadges:
    report
  • TomLiotta
    I agree with requesting the definition of "properly". Without knowing how you expect to use journalling, no one can tell you a reasonable opinion of "properly". What business problem are you working on? Tom
    125,585 pointsBadges:
    report
  • PGMBOB
    Journal created Journal receiver STRJRNPF For a file Update a record in that file DMPJRNRCV output to a file. RUNQRY the output file to see journal entries.
    1,235 pointsBadges:
    report
  • Sms121
    Thanks PGMBOB
    185 pointsBadges:
    report
  • Sms121
    thanks Charlie Browne
    185 pointsBadges:
    report
  • CharlieBrowne
    Also here is a linke to a web site where you can download the command EXPJRNS It is a gret tool. I use it all the time. Plus other free commands to download. http://www.tools400.de/English/Freeware/Utilities/utilities.html
    62,340 pointsBadges:
    report
  • CharlieBrowne
    Command should have been EXPJRNE in my last note
    62,340 pointsBadges:
    report
  • bernard85
    here is the program for doing that:

         H DFTACTGRP(*NO) bnddir('U6') actgrp('AG6')
         FJRNENTWW2dCF   E             WORKSTN SFILE(SFL1:SFlRRN1) InfDS(wsDS)

          /copy cpy,u6Ibm_h
          /copy cpy,u6env_h
          /copy cpy,u6file_h
          /copy cpy,u6fmt_h
          /copy cpy,u6grid_h
          /copy cpy,u6ifs_h
          /copy cpy,u6int_h
          /copy cpy,u6jrn_h
          /copy cpy,u6msg_h
          /copy cpy,u6screen_h
          /copy cpy,u6screen_s
          /copy cpy,u6tree_h
          /copy cpy,u6xml_h
          /copy cpy,u6xView_h

         d Screen1         pr
          //˜Global constant
         d fStop           c                   const(-1)
         d fContinue       c                   const(0)
         d fBreak          c                   const(1)
          //˜Global fields
         D G               DS                  qualified
         d  pScreen                        *   procptr
         d  lOpts                          *
         d  lActions                       *
         d  lEntry1                        *
         d  lEntry1_b4                     *
         d  lEntry9                        *
         d  lEntry9_b4                     *
         d  fRefresh                       n
         d  lItem                          *   dim(20)
         d  lFiles                         *
         d  lEntries                       *
         d  lxViews                        *
         d  anzJrnPath                  255a   varying
         d  lAnz                           *
         d  hdta                         10i 0
         d  refresh                        n
         d  error                          n
         d  CanTabRight                    n   inz(*off)
         d  CanTabLeft                     n   inz(*on)
         d  freePartWidth                 3u 0
          *
         d  jrnxView       ds                  likeDs(txView) based(pJrnxView)
          //‚--------------------------------------------------------------------
          //‚main
          //‚--------------------------------------------------------------------
         d JRNENTWW2       pi
         d   AnzID                       35
          *
         d lColumn         s               *
         d Column          ds                  likeDs(tColumn) based(pColumn)
          /free
           //‚get path for journal analysis
           g.anzJrnPath=env_getFileName(cJournal:%trim(anzID));
           //‚welcome message
           msg_SndPM(pgmID:env_getWelcomeMessage());
           //‚Title
           ZTL='Work with analysis '+anzID;
           //‚Load function keys
           screen_SetAction(g.lActions:x'33':'0':%pAddr(F3):'F3=Exit');
           screen_SetAction(g.lActions:x'3a':'1':%pAddr(f10):'F10=Move to top');
           screen_SetAction(g.lActions:x'b7':'1':%pAddr(f19):'F19=Left');
           screen_SetAction(g.lActions:x'b8':'1':%pAddr(f20):'F20=Right');
           screen_SetAction(g.lActions:x'f1':'1':%pAddr(Enter));
           screen_SetAction(g.lActions:x'f4':'1':%pAddr(rollUP));
           screen_SetAction(g.lActions:x'f5':'1':%pAddr(rolldown));
           zFK=screen_getfkentitle(g.lActions);
           //‚Load options
           screen_SetOption(g.lOpts:'5':*null:%pAddr(trtOpt):'5=Display');
           zCH=screen_getChoicesEntitle(g.lOpts);
           //‚load journal                                                         -
           g.lAnz=tree_xml2tree(g.anzJrnPath:%paddr(jrn_xmlinput));
           jrn_getRoots(g.lAnz:g.lFiles:g.lEntries);
           jrn_tieEntries(g.lEntries);
           //‚load view for journal (fixed part)                                   -
           pJrnxView=xview_loadxView('JRNENTRY');
           jrnXView.hdrColor=x'28';
           xview_PosAtLeft(jrnXView:%len(xFil)/2);
           xview_sethdrs(jrnXView:0);
           jrnxView.hdrs+=x'20'+'|';

           g.freePartWidth=%len(xFil)-%len(jrnxView.hdrs);

           //‚load other views (free part)
           loadXViews();
           //‚position on the left
           f18();
           //‚get handle on data journal
           G.hDta=ifs_openForRead(env_getFileName(cData:%trim(AnzID)));
           //‚work screens                                                        -
           g.pScreen=%pAddr(screen1);
           g.lEntry1=tree_getFirst(g.lEntries);
           wrkScreens();
           //‚end of program                                                       -
           ifs_Close(g.hDta);
           *inlr=*on;
          /end-free
          //‚--------------------------------------------------------------------
          //‚loop on sceens
          //‚--------------------------------------------------------------------
         pwrkScreens       b
         d wrkScreens      pi
          *
         d Screen          pr                  extproc(g.pScreen)
          /free
           //‚loop on screens                                                      -
           dow g.pScreen<>*null;
             screen();
           endDo;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Screen 1 - list of entries about journal analysis
          //‚--------------------------------------------------------------------
         p Screen1         b
         d fkProcess       pr                  extproc(pAction)
          *
         d pAction         s               *   procptr
         d fcontrol        s               n
          /free
           //‚refresh the work area
           if g.lEntry1<>g.lEntry1_b4;
             loadwa1();
           endif;
           //‚refresh the subfile
           if g.lEntry1<>g.lEntry1_b4 or g.fRefresh;
             loadSfl1();
           endIf;
           //‚display activation                                                 -
           write msgCtl;
           write hdr1;
           *in88=*on;
           *in89=*off;
           exfmt ctl1;
           msg_rmvPM(pgmID);
           //‚get/launch function key                                            -
           screen_processFK(pgmID:g.lActions:wsds.kp:%pAddr(control));
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Load screen work area
          //‚--------------------------------------------------------------------
         p loadwa1         b
          *
         d lEntry          s               *
         d Entry           ds                  likeds(tEntry) based(pEntry)
         d NO              s              3u 0 inz(0)
         d obj$            s             10a   inz('')
         d fmt$            s             10a   inz('')
         d fXXX            s              3i 0
          /free
           clear g.lItem;
           lEntry=g.lEntry1;
           dow lEntry<>*null;
             pEntry=tree_getItem(lEntry);
             //‚Break on the entry (Format/file)
             fXXX=entryBreak(entry:NO:obj$:fmt$);
             if fXXX=fStop;
               return;
             elseif fXXX=fBreak;
               NO+=1;
               g.lItem(NO)=tree_getItemfromList(g.lXViews:kXView:fmt$);
             endif;
             //‚store the entry
             NO+=1;
             g.lItem(no)=lEntry;
             //‚minute the last entry
             g.lEntry9=lEntry;
             //‚next entry
             lEntry=tree_getNext(lEntry);
           endDo;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Entry break
          //‚--------------------------------------------------------------------
         p entryBreak      b
         d entryBreak      pi             3i 0
         d  entry                              const likeDs(tEntry)
         d  xx                            3u 0 const
         d  obj$                         10a
         d  fmt$                         10a
          *
         d  lFile          s               *
         d  file           ds                  likeDs(tFile) based(pFile)
          /free

           //‚max reached                                                         -
           if xx=20;
             return fStop;
           endif;
           //‚Same object as previously                                           -
           if obj$=entry.det.obj;
             return fContinue;
           endIf;
           obj$=entry.det.obj;

           //‚get the file/format                                                 -
           lFile=tree_getItemfromList(g.lFiles:kFile:entry.det.obj);
           pfile=tree_getItem(lFile);

           //‚Same format as previously                                           -
           if fmt$=file.format;
             return fContinue;
           endIf;
           fmt$=file.format;

           //‚retreive/define the grid view                                       -
           if xx=19;
             return fStop;
           endif;
           return fBreak;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Load lines of subfile
          //‚--------------------------------------------------------------------
         ploadSFl1         b
         d loadSFl1        pi
          *
         d xView           ds                  likeDs(tXView)  based(pXView)
         d entry           ds                  likeDs(tEntry) based(pEntry)
         d entry0          ds                  likeDs(tEntry) based(pEntry0)
         d lColumn         s               *
         d column          ds                  likeds(tColumn) based(pColumn)
         d fmt             ds                  likeds(tFormat) based(pFmt)
         d fChg            s              3i 0
          /free
           //‚clear subfile
           *in88=*off;
           *in89=*on;
           WRITE ctl1;
           g.cantabRight=*off;
           g.cantabLeft =*off;
           //‚load lines
           for sflRrn1=1 to 20;
             //‚Leave if no item
             if g.lItem(sflRrn1)=*null;
               leave;
             endif;
             //‚clear the fields of the row
             *in01=*off;
             xFil='';
             //‚Load line according to the kind of corresponding item
             if tree_isofthekind(kXView:g.lItem(sflRrn1):pXView);
               //‚header
               *in01=*on;
    // x'      xFil1='Opt'
    // x'           +jrnXView.hdrs
                    +xview_setHdrs(XView:%len(jrnXView.hdrs));
               if sflrrn1>1;
                 %subst(xfil1:1:2+%len(jrnXView.hdrs))='';
               endif;
               g.canTabRight=g.canTabRight or not XView.right.most;
               g.canTabLeft =g.canTabLeft  or not XView.Left.most;
             elseif tree_isofthekind(kEntry:g.lItem(sflRrn1):pEntry)
                and entry.det.dtaL>0
                and ENTRY.DET.CODE='R';
               //‚0) to setup the color
               if Entry.det.ENTT='DL';
                 fChg=-1;
               else;
                 fChg=%int(entry.pEntry0<>*null);
               endIf;
               //‚1) journal part
               pFmt=tree_getitem(jrnXView.lFmt);
               fmt.pBuffer1=%addr(entry.det);
               if entry.pEntry0<>*null;
                 pEntry0=entry.pEntry0;
                 fmt.pBuffer0=%addr(entry0.det);
               endif;
               loadSFC1(jrnXView:xFil:fChg);
               //‚2) separator
               %subst(xFil:%len(jrnXView.hdrs)-1:2)=x'20'+'|';
               //‚3) data part
               pFmt=tree_getitem(XView.lFmt);
               ifs_lseek(g.hDta:entry.det.aPos:0);
               ifs_read(g.hDta:fmt.pBuffer1:fmt.len);
               //
               if entry.pEntry0<>*null;
                 ifs_lseek(g.hDta:entry0.det.aPos:0);
                 ifs_read(g.hDta:fmt.pBuffer0:fmt.len);
               endif;
               loadSFC1(XView:xFil:fChg);
             endIf;
             write sfl1;
           endFor;
           //
           g.lEntry1_b4=g.lEntry1;
           g.lEntry9_b4=g.lEntry9;
           g.fRefresh=*off;
           //‚more item or bottom of list
           screen_setSflEnd(mySflEnd:tree_getNext(g.lEntry9)=*null);
          /end-free
         p                 e
    575 pointsBadges:
    report
  • bernard85
    here the part 2:
          //‚--------------------------------------------------------------------
          //‚Load subfile column
          //‚--------------------------------------------------------------------
         ploadSFC1         b
         d loadSFC1        pi
         d XView                               likeDs(tXView)
         d xFil                         128
         d fChg                           3i 0 const
          *
         d lColumn         s               *
         d Column          ds                  likeDs(tColumn) based(pColumn)
         d field           ds                  likeDS(tField) based(pField)
         d fmt             ds                  likeds(tFormat) based(pFmt)
         d string          s          32000a
          /free
           //‚plug ft cell in the view
           pFmt=tree_getitem(XView.lFmt);
           //‚Loop on each cell
           lColumn=XView.left.lColumn;
           dow 1=1;
             pColumn=tree_getItem(lColumn);
             pField=tree_getItem(Column.lFormula);
             //‚the data for the field has changed?
             if fChg=0;
               %subst(xFil:Column.pos:1)=XView.Detcolor;
             elseif fChg=-1;
               ///%subst(xFil:Column.pos:1)=XView.chgcolor;
               %subst(xFil:Column.pos:1)=x'2b';
             elseif ifs_memchg(fmt.pBuffer1+field.posinbuffer
                              :fmt.pBuffer0+field.posinbuffer
                              :field.len);
               %subst(xFil:Column.pos:1)=XView.ChgColor;
             else;
               %subst(xFil:Column.pos:1)=XView.Detcolor;
             endIf;
    
             //‚Fill the data
             String=int_getStringFromFormula(Fmt.pBuffer1
                                            :pField);
             if lColumn=XView.right.lColumn;
               %subst(xFil:Column.pos+1:XView.right.width)
               =%subst(String:XView.right.pos:XView.right.width);
               if Column.pos+XView.right.width+1<%len(xFil);
                 %subst(xFil:Column.pos+XView.right.width+1:1)=x'20';
               endif;
               return;
             elseif lColumn=XView.left.lColumn;
               %subst(xFil:Column.pos+1:XView.left.width)
               =%subst(String:XView.left.pos:XView.left.width);
             else;
               %subst(xFil:Column.pos+1)=%subst(String:1:column.maxWidth);
             endif;
             lColumn=tree_getNext(lColumn);
           endDo;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚control input
          //‚--------------------------------------------------------------------
         pControl          b
         d Control         pi              n
          /free
           return *off;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚traitement option
          //‚--------------------------------------------------------------------
         ptrtOpt           b
         d trtopt          pi
          /free
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Roll-UP
          //‚--------------------------------------------------------------------
         pRollUp           b
         d RollUp          pi
          *
         d lEntry          s               *
         d Entry           ds                  likeds(tEntry) based(pEntry)
         d NO              s              3u 0 inz(0)
         d obj$            s             10a
         d fmt$            s             10a
          /free
           if G.lEntry1=tree_getFirst(g.lEntries);
             msg_SndPM(pgmID:'You have reached the top of the list');
           else;
             no=1;
             lEntry=tree_getPrev(g.lEntry1);
             dow lEntry<>*null;
               no+=1;
               pEntry=tree_getItem(lEntry);
               if entryBreak(entry:NO:obj$:fmt$)=fStop;
                 return;
               endif;
               g.lEntry1=lEntry;
               lEntry=tree_getPrev(g.lEntry1);
             enddo;
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Roll-down
          //‚--------------------------------------------------------------------
         pRollDown         b
         d RollDown        pi
          /free
           if mySflEnd='Bottom';
             msg_SndPM(pgmID:'You have reached the bottom of the list');
           else;
             g.lEntry1=tree_getNext(g.lEntry9);
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Enter
          //‚--------------------------------------------------------------------
         pEnter            b
         d Enter           pi
          /free
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F3=Exit
          //‚--------------------------------------------------------------------
         pf3               b
         d f3              pi
          /free
           G.pScreen=*null;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F10=Move to top
          //‚--------------------------------------------------------------------
         pf10              b
         d f10             pi
          /free
           if SFLCSRRRN=0;
             msg_SndPM(pgmID:'Wrong cursor position');
           elseif tree_getKind(g.lItem(sflcsrrrn))=kXView;
             g.lEntry1=g.lItem(sflcsrrrn+1);
           else;
             g.lEntry1=g.lItem(sflcsrrrn);
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F18=Position all views on the left
          //‚--------------------------------------------------------------------
         pf18              b
         d f18             pi
          *
         d lXView          s               *
         d XView           ds                  likeDs(tXView) based(pXView)
          /free
           if g.canTabLeft;
             lXView=tree_getFirst(g.lXViews);
             dow lXView<>*null;
               pXView=tree_getItem(lXView);
               xview_PosAtLeft(XView:g.freePartWidth);
               lXView=tree_getNext(lXView);
             endDo;
             g.fRefresh=*on;
           else;
             msg_SndPM(pgmID:'Formats displayed are on the most left position');
           endif;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F19=Left
          //‚--------------------------------------------------------------------
         pf19              b
         d f19             pi
          *
         d lXView          s               *
         d XView           ds                  likeDs(tXView) based(pXView)
          /free
           if g.canTabLeft;
             lXView=tree_getFirst(g.lXViews);
             dow lXView<>*null;
               pXView=tree_getItem(lXView);
               xview_TabLeft(XView:g.freePartWidth);
               lXView=tree_getNext(lXView);
             endDo;
             g.fRefresh=*on;
           else;
             msg_SndPM(pgmID:'Formats displayed are on the most left position');
           endif;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F20=Right
          //‚--------------------------------------------------------------------
         pf20              b
         d f20             pi
          *
         d lXView          s               *
         d XView           ds                  likeDs(tXView) based(pXView)
          /free
           if g.canTabRight;
             lXView=tree_getFirst(g.lXViews);
             dow lXView<>*null;
               pXView=tree_getItem(lXView);
               xview_tabRight(XView:g.freePartWidth);
               lXView=tree_getNext(lXView);
             endDo;
             g.fRefresh=*on;
           else;
            msg_SndPM(pgmID:'Formats displayed are on the most right position');
           endif;
          /end-free
         p                 e
          //‚------------------------------------------------------------------- ---
          //‚Synch
          //‚------------------------------------------------------------------- ---
         pSync             b
         d Sync            pi
          *
         d i               s              3u 0
         d lX              s               *
          /free
           for i=1 to 19;
             lX=tree_getprev(G.lEntry1);
             if lX=*null;
               leave;
             endIf;
             G.lEntry1=lX;
           endFor;
           loadwa1();
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚load views
          //‚--------------------------------------------------------------------
         ploadxViews       b
         d loadxViews      pi
          *
         d lFile           s               *
         d file            ds                  likeDs(tFile) based(pFile)
          /free
           lFile=tree_getFirst(g.lFiles);
           dow lFile<>*null;
             pFile=tree_getItem(lFile);
             xview_getXView(g.lXViews:file.format);
             lFile=tree_getNext(lFile);
           endDo;
          /end-free
         p                 e
    
    575 pointsBadges:
    report
  • bernard85
    here you have the dedicated dspf;     

    A DSPSIZ(27 132 *DS4)
         A                                      CHGINPDFT(UL)
         A                                      PRINT
         A          R HDR1
         A                                      CHANGE(90)
         A                                      CF03
         A                                      OVERLAY
         A            ZTL          131A  O  1  2DSPATR(HI)
         A                                  3  2'Type options, press Enter.'
         A                                      COLOR(BLU)
         A            ZCH          125A  O  4  3COLOR(BLU)
         A          R SFL1                      SFL
         A  02                                  SFLNXTCHG
         A  01        XFIL1        131A  O  6  2DSPATR(HI)
         A N01        XCHO           1A  B  6  3
         A  02                                  DSPATR(RI PC)
         A N01        XFIL         128A  O  6  5
         A          R CTL1                      SFLCTL(SFL1)
         A                                      CF01 CF02 CF03 CF04 CF05 CF06 CF07
         A                                      CF08 CF09 CF10 CF11 CF12 CF13 CF14
         A                                      CF15 CF16 CF17 CF18 CF19 CF20 CF21
         A                                      CF22 CF23 CF24 ROLLDOWN ROLLUP
         A                                      CSRLOC(CSRTOROW   CSRTOCOL)
         A                                      OVERLAY
         A                                      SFLCSRRRN(&SFLCSRRRN)
         A  88                                  SFLDSP
         A N89                                  SFLDSPCTL
         A  89                                  SFLCLR
         A                                      SFLSIZ(0020)
         A                                      SFLPAG(0020)
         A            SFLCSRRRN      5S 0H
         A            CSRTOROW       3S 0H
         A            CSRTOCOL       3S 0H
         A            SFLRRN1        4S 0H
         A            MYSFLEND      11A  O 26122DSPATR(HI)
         A            ZFK          119A  O 26  2COLOR(BLU)
         A          R EMPTY1
         A                                      OVERLAY
         A                                  8  5'(No item has been found)'
         A          R MSGSFL                    SFL SFLMSGRCD(27)
         A            MSGSFLKEY                 SFLMSGKEY
         A            PGMID                     SFLPGMQ(10)
         A          R MSGCTL                    SFLCTL(MSGSFL)
         A                                      SFLDSP SFLDSPCTL SFLINZ
         A N98                                  SFLEND
         A                                      SFLPAG(1) SFLSIZ(2)
         A            PGMID                     SFLPGMQ(10)
    
    575 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: