12/17/09 How to search for text in a file at the member level

Use the command: FNDSTRPDM.

Simply type "FNDSTRPDM" at a command line and press F4 to list all available parameters for this command.

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

11/20/09 Simplify replication of devices between two systems by matching hardware resource names

Is CMN01 a V.32 interface on your source and an ethernet port on your target? That can prevent device descriptions from replicating properly.

You can change the resource names so that they match, by using system service tools (SST). You may have to juggle a bit and create temporary resource names in order to move things around (because you can’t have duplicates), but with a little work, you can match up the important ones.

Enter system service tools with the STRSST command (you must have *SERVICE special authority, and you’ll need a user name and password for SST (it’s different from your regular login).

  • From the SYSTEM SERVICE TOOLS (SST) menu, select option 1 (START A SERVICE TOOL)
  • From the START A SERVICE TOOL menu, select option 7 (HARDWARE SERVICE MANAGER)
  • Use option 1 (PACKAGING HARDWARE RESOURCES) and drill down to help you find resource names attached to your hardware
  • To rename a resource:
    1. Use option 3 (LOCATE RESOURCE BY RESOURCE NAME)
    2. Enter the existing name for the resource on the prompt
    3. Use option 2 (CHANGE DETAIL) to give the resource a new name

This way, you can make CMN01 match on both source and target, and easily replicate the configuration of the v.32 line, and all the associated controllers and devices. Make sure you’re not using any of the resources you’re changing, and when you do change them, make certain your existing devices and controllers are updated with the right resource names.

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

10/21/09 Know the impact of using the ENDJOBABN command

If you use the ENDJOBABN command to end an active job that just won’t go away after the ENDJOB is issued, you need to be aware of the longer term impact of using this command.

When you use ENDJOBABN, a marker is set in the system that causes the next IPL to be considered an "abnormal" IPL – that is – the system will behave as if it ended abnormally, instead of in a controlled fashion from a PWRDWNSYS. This means that the first IPL you do after an ENDJOBABN will take longer than a normal IPL.

This is important to remember, because if you only IPL monthly or even less frequently, you might be surprised by the impact of an ENDJOBABN issued weeks prior.


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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.


10/2/09 How to rapidly set up a network printer using IBM Personal Communications.

1. Start the configuration of a new 5250 session. The System name should be the name of your system (or IP address) that you want this printer to be available to.

2. Specify a workstation ID as the name of the printer. (This will also be the OUTQ name on the iSeries.)

3. Select the “Type of Emulation,” to be “Printer”

4. Accept remainder of defaults and press “OK”. Your session should display a window to say “Ready,” and “Online.”

The printer session will print to the default windows computer associated with the computer that the printer was configured from. To change this printer, simply open up the 5250 printer session, from the “File” menu, select “Printer Setup,” and select a different printer.

To print to this printer from the iSeries, do the following:

1. Locate the spool file on the iSeries that you wish to print.

2. Use option 2 “Change” to modify the field “Printer” and key in the exact name of the printer.

3. To find the status of this spooled file, go to WRKOUTQ and replace XYZ with the name of your printer.

Note: The 5250 printer session must be active (emulator status of “Online,” and “Ready) in order for the printer to be used from the iSeries.


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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

9/16/09 How to obtain further message logging for interactive or submitted jobs

To change the message logging level, and thus gather more logging information on any job, you need to access and change the job parameters per one of the following:

- To change your own interactive job, enter the CHGJOB command, then press F4.

- To change another interactive job: Locate the job using WRKACTJOB SBS(subsystem), use OPTION 2 next to the job, press F4.

- To change a submitted job: Put the JOBQ on HLD status temporarily (WRKJOBQ jobqname, OPTION 3 to HOLD), submit the job, use WRKJOBQ OPTION 5 to “Work With JOBQ,” and use OPTION 2, press F4.

*CAUTION* Holding the JOBQ will hold all jobs being submitted into that JOBQ for the duration that the JOBQ is actually on hold. Once the message level is changed, it is critical to release the JOBQ.)

Once the interactive or batch job is identified, and the OPTION 2 “Change,” menu has been entered, do the following:

1) Press F10 for further detail.

2) Modify the parameters as follows: Message Logging: Level 4, Severity 00, Text *SECLVL, Log CL Program Commands *YES, press enter.

3) Release the JOBQ. (WRKJOBQ jobqname, OPTION 6 “Release”

*Note* The message level will only remain for the job it was changed for, and would need to be repeated anytime it is needed unless further measures are taken to change the Job Description, in which doing so affects all jobs that utilize that Job Description.


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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

8/27/09 How to find the primary key of a file created using DDS (rather than SQL)

Primary keys are called Unique keys in iSeries DDS. The Unique key can be held to two places, on the physical file itself or on a logical file based over that physical file.

To check the physical file, on a command line use the Display File Description command over the physical file; e.g. DSPFD library/file. Page down the displayed information looking for "Access Path Description." If the Access Path is shown as "Arrival" then the physical file is non-keyed and the records are stored by Relative Record Number (row number) sequence. If the Access Path is keyed then the file is keyed, but the key will only be a primary key if the "Unique key values required’ value is showing "Yes." The key fields themselves will be listed on the lines just below this entry.

To check whether there is a logical file with a Unique key use this two step process: First, find the names of all the logical files based over the physical file by using the Display Data Base Relations command, eg DSPDBR library/file. Second use the Display File Description command (DSPFD) for each logical file, as described above, checking the Access Path information as previously described.

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

8/09/09 Using RUNRMTCMD to tell other systems to perform tasks and run scripts

You can have Linux, UNIX and Windows servers do tasks and runs scripts right from an i5/OS command line or a CL program. If you use CL, your program will even wait until the other sever completes its task before moving to the next instruction.

Use the RUNRMTCMD command and enter the foreign system command in the COMMAND parameter, the IP address or host name in the REMOTE LOCATION parameter, and indicate *IP for Type. Of course, you’ll also need a user name and password for the remote server.

The RUNRMTCMD will end and the next CL statement will execute when the command completes on the target system. If you want things to happen "asynchronously," use the COMMAND parameter to run a script on the foreign system that submits another job or spawns off another process. Just remember, whatever process you invoke on the target system has to finish before control returns to your CL. If the target system gets stuck, so does your program.

Using this command can also be a handy way to automatically perform functions when switching servers using the your high availability automation; you can trigger scripts that automatically change DNS, clear DNS cache, alter software configurations, and more.


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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

7/17/09 How to find journaled files that are regularly cleared

If you are using a logical replication or high availability solution and you have certain files that are cleared on a regular basis, the following command can be used to identify those objects. If the file is cleared then it may be a file that does not need to be replicated, which will save you bandwidth in the replication process.

DSPJRN JRN(library/journal) RCVRNG(*CURCHAIN) ENTTYP(CR)


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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

6/30/09 There's a backup version of the controlling subsystem (QCTL)

If you’ve changed attributes of the QCTL subsystem and lost track of what the defaults should be, or worse yet you’ve changed the controlling subsystem in some way that the system refuses to IPL properly, there’s a little known “backup” version of the controlling subsystem called QSYSSBSD. It’s specially protected so that it cannot be changed, only displayed. It’s always there, in the QSYS library, waiting for you “just in case”.

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

6/19/09 How To Generate a Disk Analysis Report

Another way to see what is taking up your disk space is to view the i5/OS disk analysis report. To build the Disk Analysis file, use the following command:

SBMJOB CMD(RTVDSKINF) JOB(RTVDSKINF) JOBQ(QSYSNOMAX)

You can monitor the job by issuing the following:

WRKACTJOB SBS(QSYSWRK)
Job name = RTVDSKINF

Once the job finishes running, create the print report:
SBMJOB CMD(PRTDSKINF RPTTYPE(*LIB)) JOB(PRTDSKINF) JOBQ(QSYSNOMAX)


Other ways of seeing what is using disk space can be found on these two posts:
http://visionsolutionsinc.blogspot.com/2008/04/easy-way-to-figure-out-what-is-eating.html
http://visionsolutionsinc.blogspot.com/2009/03/031609-two-ways-to-see-what-is-using.html


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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.



6/08/09 Create a Virtual Printer

Use the following steps to create a virtual printer that will print directly from an output queue to a network deskjet or laser printer.

  1. Start System i Navigator on your PC (If you do not have System i Navigator on your PC then it is possible to complete this task using CRTDEVPRT from a 5250 session)
  2. Select Basic operations, Printers.
  3. Right click and select Add Printer.
  4. Use the wizard and accept defaults, enter the IP address of the printer, enter your own name for the printer (not OfficeJet…).
  5. When wizard complete no need to print a test page as this will not print correctly anyway.
  6. Go on to a 5250 session and enter GO PRINTER
  7. Take Option 4 on the PRINTER menu
  8. Take Option 8 against the Printer Description created in step 4. For more information about this on the internet, go to the IBM information center using this link http://publib.boulder.ibm.com/iseries/. Search for the command “CHGDEVPRT” and you will find a list of printer manufacturers and models, lookup the Manufacturer and Model of your printer in the list of information and make a note of the value for MFRTYPMDL (e.g. *HP520 is the HP Deskjet 520.
  9. Return to the 5250 session and take Option 2, scroll down and change the setting for MFRTYPMDL to the value appropriate to your printer (e.g. *HP520).

    You can now print directly to the Printer Description. You may need to first start the writer (GO PRINTER option 2 and option 1 against the appropriate printer).

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

5/29/09 Working with Spool files on System ASPs or iASPs

An output queue can be created in a library on an ASP or iASP. However, when using the WRKSPLF command you may not see the spool files that exist on the ASP/iASP unless you first set the iASP group using the command SETASPGRP (ASP/iASP Name).

Note to programmers: If you do programming with some iSeries APIs that retrieve information about spool files, it is not always necessary to specify the ASP/iASP name (unless, of course, you wish to). For example the API QUSLSPL will retrieve a list of spool files on *SYSBAS and on all available ASPs/iASPs without the need to use SETASPGRP; similarly QUSRSPLA will also retrieve spool file attributes without the need to use SETASPGRP.



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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

5/19/09 How to see scheduled jobs in order of submission

When doing various system maintenance and management functions it is sometimes necessary to hold jobs on the Job Scheduler. Instead of using the command WRKJOBSCDE, which presents jobs alphabetically by name, use the command WRKJOBSCDE SEQ(*DATETIME). This will present the list of jobs in the order they are to be submitted, allowing you to quickly find those scheduled jobs that will occur during the timeframe of your system maintenance and management tasks.

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

5/8/09 How to execute a command on a remote system using FTP

Simply type the command as you normally would, but have it preceded by "QUOTE RCMD"

For example:

QUOTE RCMD CHKOBJ OBJ(QGPL) OBJTYPE(*LIB)

QUOTE RCMD CALL PGM(Yourpgm/Yourlib) PARM(Parms)


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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

4/27/09 - How to delete a specifc relative record if the file is keyed

You can delete a specific relative record number when a file is keyed and the UPDDTA command can’t do it. Simply use normal OS/400 SQL and run the following:

delete from LIBRARY/FILENAME A where RRN(A) = 3

The above example deletes RRN number 3. Just replace LIBRARY and FILENAME with library and file names the ‘A’ after file name is needed. Then change the 3 at the end to be the actual RRN number you want to delete.

You may want to use a ‘select’ statement first to ensure you have the right record, here’s an example of that:


select * from LIBRARY/FILENAME A where RRN(A) = 3

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

4/17/09 - How to view the contents of user spaces

You can easily display contents of a *USRSPC by using the EDTF command. Here is a sample syntax:

EDTF STMF('qsys.lib/yourlib.lib/yourusrspc.usrspc')

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. Vision Solutions develops and sells iSeries high availability and AIX replication and clustering solutions. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

4/06/09 - The menu of menus

Don't remember what a menu is called?

Why not use the "menu of menus?"

The WRKMNU command will display menus alphabetically. They can be displayed by library and/or generically. You can even create a new menu, change an existing one or delete it right from the screen.



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, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

03/25/09 Using the Save While Active command within IBM's BRMS backup management software

The following example is for an SAP application environment that is using an iSeries high availability software product, which is typically used for disaster recovery purposes. Because of this, the tape backup is performed on the replication target (backup) system.

The data library for the SAP environment is being saved with the Save While Active command:

Display Backup Control Group Entries S102XXXX

Group . . . . . . . . . . : R3PRDDATA
Default activity . . . . : *BKUPCY
Text . . . . . . . . . . : Save of R3PRDDATA - High Availability End and Start

Auxiliary Weekly Retain Save SWA
Backup List Storage Activity Object While Message
Seq Items Type Pool Device SMTWTFS Detail Active Queue
10 *EXIT *DFTACT
20 *EXIT *DFTACT
30 R3PRDDATA *SYSBAS *DFTACT *ERR *YES *LIB

The first user exit point in the BRMS Control Group ends the replication data group target processes:

User Exit Maintenance S102XXXX


Type command, press Enter.

Sequence number . . . . . . . : 10
Where used . . . . . . . . . : *EXIT
Weekly activity . . . . . . . : *DFTACT SMTWTFS
Command . . . . . . . . . . . . ENDDG DGDFN(R3PRD) PRC(*ALLTGT)
ENDOPT(*CNTRLD) WAIT(500) TIMOUTOPT(*ENDIMMED)


The second user exit point uses the BRMS MONSWABRM process that watches for the Save While Active checkpoint message. Once the checkpoint message is received, the replication data group target side processes are restarted:


User Exit Maintenance S102XXXX


Type command, press Enter.

Sequence number . . . . . . . : 20
Where used . . . . . . . . . : *EXIT
Weekly activity . . . . . . . : *DFTACT SMTWTFS
Command . . . . . . . . . . . . MONSWABRM LIB(R3PRDDATA) CMD(STRDG DGDFN(R3PRD)) WAITMSG(7200)


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, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

03/16/09 Two ways to see what is using disk space

Method #1

Use the commands: RTVDSKINF and PRTDSKINF. The retrieve command will build a file that can then be printed with the print command by *LIB, *FLR, *OWN, *OBJ, *SYS

Method #2
Run a query on file QAEZDISK for more granular detail.


Still another method can be found at the blog post located at: http://visionsolutionsinc.blogspot.com/2008/04/easy-way-to-figure-out-what-is-eating.html


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 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.

3/6/09 How to change System Request options

Although what is displayed on the System Request menu screen isn't easy to change, it easy to change what the options shown on that screen actually do.

The commands executed by the system request menu are stored in a message called CPX2313, which is located in QSYS/QCPFMSG. Keep in mind that the commands are not exactly in order, so you have to be careful with making changes to this message file.

Use the command DSPMSGD CPX2313 and you will see see how easy it is to change, for instance, DSPJOB to WRKJOB.

Caution: Whenever you make changes to CPX2313 it is important to remember the change is a global one and should not be used lightly!


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.

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.