AS/400 HELP    

                                      "QBATCHLOG" 

                                   (QBATCH JOB LOG)

                           

 

QBATCHLOG   saves and displays a log of QBATCH job initiations and completions.

 The exit point   QIBM_QWT_JOBNOTIFY  sends the job name to dtaq QBLOG in library QBATCHLOG .

Program QBLOG records the start of the job  into file QBATCHLOG.  API QUSRJOBI is used at this point to add info about this job. Program QBLOG2 records the time the job completed.  Both programs sit in subsystem Qinter waiting for entries from the dtaq.

Program  QBHIST displays these records and allows you to select a particular user id.

QBATCHLOG was developed at V5r1. 

DOWNLOAD qbatchlog.SAVF

 

Please read and understand all the instructions below before installing QBATCHLOG.

 

PC INSTRUCTIONS:

Download "QBATCHLOG” to your PC.

Go to a DOS session and enter the following;

FTP SYSTEM                                        (system = your AS/400’s name or IP address)

Enter a valid user id and password

CD QGPL

LCD C:\DIRECTORY (directory= the directory on your pc where you downloaded “ qbatchlog.savf”

QUOTE    SITE     NAMEFMT   1

BIN

PUT       QBATCHLOG.SAVF

QUOTE   RCMD   RSTLIB   SAVLIB(QBATCHLOG)   DEV(*SAVF)   SAVF(QGPL/CQBATCHLOG)

 Note:  If there is a security problem restoring all objects with the command above,  sign on to your as/400 as Qsecofr and run RSTLIB  from the command line.

 

AS/400 INSTRUCTIONS:

INSTALL SECTION;  (1 time only after library QBATCHLOG is restored to the As/400)

ADDJOBQE SBSD(QSYS/QINTER) JOBQ(QBATCHLOG/QBATCHLOG) MAXACT(2) SEQNBR(NNN)

NNN = a unique sequence number. Use the command:

DSPSBSD SBSD(QSYS/QINTER)  and take option 6.  Use a Seq Nbr not already allocated.

WRKREGINF

Look for QIBM_QWT_JOBNOTIFY  and take option 8

Enter  1  and enter  Program   1   or a number higher than the highest exit program number currently used.

For fields; Program…………       QBLOG   

            Library………        QBATCHLOG

Hit F10 and roll up

For fields; Length of data………    74

           Program data         0003QBATCH    QSYS

NOTE: you must enter it exactly as above  (0003QBATCH followed by 4 spaces and QSYS)

 

NOTE This exit point will start working only AFTER QBATCH has been stopped and restarted.  Either wait for the next IPL or manually stop and restart SUBSYSTEM Qbatch.    

 

STARTING AND STOPPING QBATCHLOG:  

To start:    CALL QBATCHLOG/STARTQBL

To End:      CALL QBATCHLOG/STOPQBL

NOTE: Jobs not yet completed will have their date/times as -------------

NOTE: QBATCHLOG works by using 2 PROGRAMS to get the starting and ending times of jobs submitted to QBATCH via dtaq entries.  The actual time to complete each job is the difference between start and end. (The time listed in the system log (DSPLOG) is CPU time.) If QBATCHLOG is not working properly or interrupted for any reason it may apply an incorrect job end time.

The cycle is as follows;  Program QBLOG receives 0001  job start info from QIBM_JOB_NOTIFY and writes to file QBLOG.  Program QBLOG2 receives 0002 job end info and updates the record created by QBLOG with the system time. The actual time may be off a second or two depending on your system (job load or processor etc) but it reflects the time the job spent loading and executing the job which is a better way to gage how much time is actually spent by QBATCH JOBS.    

  

NOTE: Verify QBATCHLOG is working by entering command: WRKACTJOB. You should see QBATCHLOG running under QINTER.

NOTE: QBATCHLOG populates the D0ooooooooopTAQ QBLATCHLOG/QBLOG.  You can use the program DTAQS from this web site to see the actual number of entries. The number of entries in QBLOG should be 0 after all QBATCH jobs have completed. 

NOTE: STARTQBL starts QBLOG & QBLOG2 programs in Qinter and waits for the a  string of job name  from the exit point or a string with the the word ‘QUIT’ (from STOPQBL)  N

NOTE: STOPQBL sends the word ‘QUIT’ to QBLOG dtaq which stops the programs from collecting data. If QBATCHLOG is not active this entry will wait in the dtaq until read and then perform its job.  Calling STOPQBL twice or more in succession will make it appear QBATCHLOG is not working as it will stop QBATCHLOG every time ‘QUIT’ goes through.

NOTE:  If you stop using QBATCHLOG for good don’t forget to use WRKREGINF on QIBM_QWT_JOBNOTIFY and remove the entries you added otherwise records will continue to populate dtaq QBLOG.

NOTE:  The key to the QBLOG file contains the six digit JOB NUMBER( 999,999). Eventually this number rolls around and restarts at 0.  Depending on how busy your system is you may want to do a CLRPFM once in a while to stop the addition of duplicate records.

NOTE:  Program QBHIST is written in free format. QBHISTOLD is the fixed format version included in qrpglesrc.

 

 

To display the log file……

ADDLIBLE  QBATCHLOG 

CALL  QBHIST