02/23/09 Learn more about any IPL process

Want to know more about an IPL than simply the date and time of the last IPL? Sometimes, the information provided by system values is just not sufficient. For instance,

- Did your last IPL take longer than usual?
- Did you recently apply PTFs and wanted to know how long that IPL step took?
- Need to know how long your system spent doing journal recovery?
- Need to know how long it actually takes to "power down"?

By making a simple program call, you can get a spool file that shows your last
power-down and IPL in full detail - Every system reference code and sub-code
is shown, along with the date and timestamp it was issued.

CALL QWCCRTEC

This program runs very quickly, and does not issue any messages. It produces
a QPSRVDMP spool file of about 15-20 pages. Look beyond column 85 for the
information you need. Here's a sample :


*XPF PWRDWN 10/25/08 07:14:20*
* D900 2740 10/25/08 07:14:21*
* D900 2750 10/25/08 07:14:22*
* D900 2770 10/25/08 07:14:22*
* D900 2780 10/25/08 07:14:22*
* D900 2790 10/25/08 07:14:22*
* D900 27C0 10/25/08 07:14:22*
*End PWRDWN 10/25/08 07:14:25*
*XPF IPL 10/25/08 12:40:05*
* C900 2810 10/25/08 12:40:05*
* C900 2820 10/25/08 12:40:05*
* 10 20 0010 10/25/08 12:40:05*
* 10 20 0020 10/25/08 12:40:05*
* 10 30 0010 10/25/08 12:40:05*
* 10 30 0020 10/25/08 12:40:05*
* 10 30 0030 10/25/08 12:40:05*
* 10 30 0040 10/25/08 12:40:05*
* 10 30 0050 10/25/08 12:40:05*
* 10 3A 0010 10/25/08 12:40:05*
* C900 2830 10/25/08 12:40:05*

Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2009, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.



2/15/09 Quickly see every physical and logical file on a system

Display the file QSYS/QADBXREF

Caution: Never change anything in this file!

Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2009, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

2/05/09 How to quickly delete multiple unsaved journal receivers

If you need to delete several journal receivers that have not been saved there are several ways to go about it.

If you use OPTION 4 from PDM or WRKOBJ screens you will receive an *INQUIRY message for each unsaved receiver telling you that is has not been saved and asking you to Ignore or Cancel. Deleting the receiver from within the WRKJRNA display will give you the same messages.

There is a quicker way.

From the command line enter
DLTJRNRCV JRNRCV(receiverlib/receivername) DLTOPT(*IGNINQMSG)

The DLTOPT(*IGNINQMSG) parameter will suppress the messages.


Note: You can enter a generic for the receiver name.

Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2009, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

01/28/09 How to change the object ownership of all objects in a library

The CHGOBJOWN command doesn't accept *ALL as an object name, but you can use a "UNIX-like" approach to the problem through the IFS representation of the i5/OS libraries:

CHGOWN OBJ('QSYS.LIB/yourlib.LIB/*.*') NEWOWN(newuser)


Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2009, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

1/22/09 Send messages to all users attached to a group profile

Have you ever wanted to send a message to all users attached to a group profile? Here is a command and a CL program that you can use to do exactly that.


Note: Before you can compile the CL program SNDPGMMSG, you need to create a 132 character physical file named SPOOL132. That is done using this command: CRTPF /SPOOL132 RCDLEN(132)

SNDGRPMSG command

SNDGRPMSG: CMD PROMPT('Send Group Message')
PARM KWD(MSG) TYPE(*CHAR) LEN(512) EXPR(*YES) +
PROMPT('Message text, or')
PARM KWD(MSGID) TYPE(*CHAR) LEN(7) +
PROMPT('Message identifier')
PARM KWD(MSGF) TYPE(QUAL) PROMPT('Message file')
PARM KWD(MSGDTA) TYPE(*CHAR) LEN(512) EXPR(*YES) +
PROMPT('Message data field values')
PARM KWD(TOGRP) TYPE(*CHAR) LEN(10) PROMPT('To +
group profile')
QUAL: QUAL TYPE(*NAME) LEN(10)
QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) +
SPCVAL((*LIBL) (*CURLIB)) PROMPT('Library')



SNDPGMMSG CL program


PGM PARM(&MSG &MSGID &MSGFLB &MSGDTA &TOGRP)

DCL VAR(&MSG) TYPE(*CHAR) LEN(512)
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
DCL VAR(&MSGFLB) TYPE(*CHAR) LEN(20)
DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(512)
DCL VAR(&TOGRP) TYPE(*CHAR) LEN(10)

DCL VAR(&MSGF) TYPE(*CHAR) LEN(10)
DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&POS) TYPE(*DEC) LEN(3 0)

DCLF FILE(SPOOL132)

CHGVAR VAR(&MSGF) VALUE(%SST(&MSGFLB 1 10))
CHGVAR VAR(&MSGFLIB) VALUE(%SST(&MSGFLB 11 10))

DSPUSRPRF USRPRF(&TOGRP) TYPE(*GRPMBR) OUTPUT(*PRINT)
MONMSG MSGID(CPF0000) EXEC(DO)
SNDUSRMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('No +
messages sent to group profile' *BCAT +
&TOGRP) MSGTYPE(*INFO) TOUSR(*REQUESTER)
RETURN
ENDDO

CRTDUPOBJ OBJ(SPOOL132) FROMLIB(*LIBL) OBJTYPE(*FILE) +
TOLIB(QTEMP)
CPYSPLF FILE(QPUSRPRF) TOFILE(QTEMP/SPOOL132) +
SPLNBR(*LAST)
DLTSPLF FILE(QPUSRPRF) SPLNBR(*LAST)
CPYF FROMFILE(QTEMP/SPOOL132) +
TOFILE(QTEMP/SPOOL132A) MBROPT(*REPLACE) +
CRTFILE(*YES) INCCHAR(*RCD 1 *EQ ' ')
DLTF FILE(QTEMP/SPOOL132)
CPYF FROMFILE(QTEMP/SPOOL132A) +
TOFILE(QTEMP/SPOOL132B) MBROPT(*REPLACE) +
CRTFILE(*YES) INCCHAR(*RCD 49 *EQ ' ')
DLTF FILE(QTEMP/SPOOL132A)
OVRDBF FILE(SPOOL132) TOFILE(QTEMP/SPOOL132B)
READLOOP:
RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDJOB))
CHGVAR VAR(&POS) VALUE(2)
MSGLOOP:
IF COND(&POS *LE 106) THEN(DO)
IF COND(%SST(&SPOOL132 &POS 1) *NE ' ') THEN(DO)
IF COND(&MSG *NE ' ') THEN(DO)
SNDUSRMSG MSG(&MSG) MSGTYPE(*INFO) +
TOUSR(%SST(&SPOOL132 &POS 10))
MONMSG MSGID(CPF0000)
ENDDO
ELSE CMD(IF COND(&MSGID *NE ' ') THEN(DO))
SNDUSRMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +
MSGDTA(&MSGDTA) MSGTYPE(*INFO) +
TOUSR(%SST(&SPOOL132 &POS 10))
MONMSG MSGID(CPF0000)
ENDDO
ENDDO
ELSE CMD(DO)
GOTO CMDLBL(READLOOP)
ENDDO
CHGVAR VAR(&POS) VALUE(&POS + 26)
GOTO CMDLBL(MSGLOOP)
ENDDO
GOTO CMDLBL(READLOOP)
ENDJOB:
DLTOVR FILE(SPOOL132)
DLTF FILE(QTEMP/SPOOL132B)
ENDPGM


Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2009, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

01/14/09 How to determine a lock on an IFS object

Many times when enrolling an Integrated File Systems (IFS) object into journaling a message appears stating the attempt was unsuccessful. Typically this outcome occurs because of locks. Unfortunately, there is no WRKOBJLCK command for IFS so an API is needed to display all the jobs that have a lock on an IFS object.

Call the API program: CALL QP0FPTOS PARM(*LSTOBJREF '/ifspath/ifsfile' *FORMAT2)

You will need *SERVICE authority to call this API.

This API will output a detailed spooled file with all the jobs that have a lock(s) on that IFS object and the type of lock that exists.

Note: the third character (from the left) in the API object name is a ‘zero’ and the seventh character is an alpha letter ‘O’.


Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2009, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

01/07/08 - How to find more information about a command and its parms

When a command is prompted (F4) and displayed, position the cursor on the command title at the top of the screen and press F1 for Help.

To know more information about a command parameter, when the command is prompted, position the cursor on the parameter and press F1 for Help.

To know the list of values for a command parameter, when the command is prompted, position the cursor on the parameter and press F4 for List.


Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2009, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.