AS/400 HELP    

                                       "CMDLOG" 

                           

 

CMDLOG  saves and displays / prints  selected commands entered on  the command line and via AS/400 menus.  You can use CMDLOG to track the usage of certain commands by your users .   It uses the EXIT POINT     QIBM_QCA_RTV_COMMAND. 

 

CMDLOG  saves info (up to 512 bytes)  for the  commands you select  via the WRKREGINF command.   You can then display  the  history log with CMDHIST.

CMDLOG was developed at V4r5 .  It was also tested at V5R1

DOWNLOAD cmdloglib.SAVF

 

PC INSTRUCTIONS:

Download "CMDLOGLOG 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 “ cmdloglib.savf”

QUOTE    SITE     NAMEFMT   1

BIN

PUT       CMDLOGLIB.SAVF

QUOTE   RCMD   RSTLIB   SAVLIB(CMDLOG)   DEV(*SAVF)   SAVF(QGPL/CMDLOGLIB)

 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 CMDLOG is restored to the As/400)

MOVOBJ  OBJ(CMDLOG/CMDLOG) OBJTYPE(*FILE) TOLIB(QGPL)

MOVOBJ  OBJ(CMDLOG/CMDLOGL1) OBJTYPE(*FILE) TOLIB(QGPL)

NOTE: Make sure library QGPL is in the qsyslibl or Qusrlibl library list. Otherwise CMDLOG will not find the log file CMDLOG and its logical. USE DSPSYSVAL QSYSLIBL and / or DSPSYSVAL QUSRLIBL to insure QGPL is on either list. If not Use WRKSYSVAL QSYSLIBL and add QGPL to the list. If you can’t add QGPL to either list you must place files CMDLOG and CMDLOGL1 in a library that is available when the EXIT POINT runs.   

ADD COMMANDS SECTION;  

Enter   WRKREGINF   and press enter

Find    QIBM_QCA_RTV_COMMAND   and enter   8  next to it

Use OPT  1   to add     Exit Program  CMDLOG  in Library CMDLOG and press enter

In the next screen  enter  a program  number. Start with 1 and add 1 for each subsequent command you want to log

Press F10

Roll Up

For  Length of data  enter      20

For  Program data    enter  CCCCCCCCLLLLLLLLLL

         Where CCCCCCCCCC = command   LLLLLLLLLL  = library                           

Example                      SAVLIB    QSYS                            __

Note:  You must enter the command as 10 characters followed by the library where this command is held (QSYS) Do a WRKOBJ on the command to verify the library.  In the example above it’s SAVLIB followed by 4 spaces (10 total) and then QSYS   (DLTF would be followed by 6 spaces and then QSYS (you get the idea))

NOTE: Use Uppercase only.

NOTE: Not all commands are allowed. You can’t use the CALL command (and some others) The display will highlight for non-eligible commands.

NOTE: EXIT POINTS take resources. I don’t recommend adding too many commands to QIBM_QCA_RCV_COMMAND

 

TO view / print the history log

ADDLIBLE CMDLOG

CALL  CMDHIST