Q
Get started Bring yourself up to speed with our introductory content.

Finding the time that a WRKOBJ command was input.

Is there any way of finding the time that a WRKOBJ command was inputted on the system and also the parameters that were entered?


Probably the easiest way to accomplish this task is to display the job log, if it's still available. Beyond that, you could put a validity-checking program on the WRKOBJ command and in the validity-checking program, record those values to a database file. A validity-checking program intercepts the parameters of a command and allows you to specify any additional processing that will occur every time the command is run. A sample shell of a CL validity-checking program for the WRKOBJ command follows.

0001.00 PGM PARM(&P20 &P7 &P1)
0002.00 DCL VAR(&P20) TYPE(*CHAR) LEN(21)
0003.00 DCL VAR(&P7) TYPE(*CHAR) LEN(7)
0004.00 DCL VAR(&P1) TYPE(*CHAR) LEN(1)
0005.00 DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
0006.00 DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
0007.00
0008.00 /* SEPARATE FILE AND LIBRARY FROM INCOMING PARAMETER */
0009.00 CHGVAR VAR(&FILE) VALUE(%SST(&P20 1 10)) 0010.00 CHGVAR VAR(&LIB) VALUE(%SST(&P20 11 10)) 0011.00
0012.00 /* ADD ANY ADDITIONAL PROCESSING HERE */
0013.00
0014.00 ENDPGM

To enable the validity checking program, you need to change the WRKOBJ command to use your new program. Ex. CHGCMD CMD(WRKOBJ) VLDCKR(*LIBL/MYPGM). If you use a validity checker program on an IBM supplied command, the validity-checking program will only remain in effect for the command until you apply the next release of OS/400. If you change any IBM supplied objects, it's also a good idea to add the same change to a CL program that will be run after applying a new OS/400 release. In this way, you will have a centralized record of your changes and a quick way to reinstate them.

If you are doing this in order to track who deleted, changed or accessed certain objects, I would skip the validity checking program approach and instead implement security auditing and/or journaling, depending on your needs. Information on security auditing can be found in the OS/400 Security - Reference manual (SC41-5302).


This was last published in March 2001

Dig Deeper on iSeries SQL commands and statements

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...

Close