To get to the Command Entry screen from any command line, do a Call QCMD. Once you are on the Command Entry screen, to view a full screen of lines for the entry of your command, press F11. Pressing F11 again brings your screen back to a partial display mode. If you select F10 (with the screen on partial display mode) it will include all detailed messages and commands that you have previously executed and show you the request level that they were run under.
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, i5/OS and AS/400 are trademarks of International Business Machines Corporation. All other brands are property of their respective registered owners.
08/19/08 Command Entry screen tips
08/12/08 Creating a single startup program for multiple systems
This tip is particularly useful if you are using an iSeries high availability product for disaster recovery purposes. The idea is to create one startup program that will work on two or more systems -- one source code for multiple systems.
Use a data area to define the system's role in the iSeries replication environment. For example, the production system data area would have a setting of SRC and the backup system the setting of TGT. You may also want to define a value of SWT when the system is in the process of switching.
When a system is the production system, you want production subsystems/processes to start when the system is IPL'd. When a system is the backup system, you likely do not want these subsystems/processes to be started when the backup system is IPL'd. Of course, there will be some things you will want to start on all systems regardless of its role.
In the startup program, retrieve the pre-defined data area and then process accordingly.
Example source code for the startup program:
PGM
DCL VAR(&SYSROLE) TYPE(*CHAR) LEN(3)
RTVDTAARA DTAARA(YOURLIB/SYSROLE (1 3)) RTNVAR(&RTNVAL)
MONMSG MSGID(CPF1015) EXEC(CHGVAR VAR(&RTNVAL) +
VALUE('UNK'))
SELECT
WHEN COND(&SYSROLE = 'SRC') THEN(DO)
/* INSERT COMMANDS TO RUN WHEN SYSTEM IS THE SOURCE */
ENDDO
WHEN COND(&SYSROLE = 'TGT') THEN(DO)
/* INSERT COMMANDS TO RUN WHEN SYSTEM IS THE TARGET */
ENDDO
WHEN COND(&SYSROLE = 'SWT') THEN(DO)
/* INSERT COMMANDS TO RUN WHEN SYSTEM IS MID SWITCH */
ENDDO
ENDSELECT
/* INSERT COMMANDS TO RUN REGARDLESS OF SYSTEM ROLE */
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 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.
8/4/08 Designating authorities for journaled objects
System managers who work with journals don’t always realize when they create new journals that an authority can be designated for the journal receiver that differs from the object being journaled.
For more information on managing authorities for journals and receivers, see the IBM Redbook Technote on the topic at: http://www.redbooks.ibm.com/abstracts/tips0604.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.
7/28/08 Using the System Request menu.
The System Request menu is basically a shortcut screen that allows you to access some commonly used commands without leaving the your current screen.
Accessing the System Request menu can be done in a variety of ways depending on your environment and emulation program. Common ways are: pressing the SHIFT and SysRq keys together, or if using PC emulation, right clicking your mouse and selecting ‘SysRq’ from the pop-up window.
Transfer to secondary display session.
Choosing Option 1 will give you a second sign on for the same session, but there is a caveat: once you start another session the first one is paused and it will not resume until you go back to it. This is important to remember if you are running an interactive query, compile, etc.
Cancel a display session
To cancel out the display session that your are viewing, use Option 2.
Display user messages
User messages for your log-on profile can be seen by selecting Option 4. From there you can also manage the messages (i.e. remove all or selected messages).
View System Operator messages (QSYSOPR) To display the system operator messages use Option 6. It takes you right to the QSYSOPR messages screen. This is particularly useful if your display session is running a program and receives an error message that needs to be answered.
View current job information
See your current job information by selecting option 7. This is particularly useful if you need to see job names and job numbers. If you have second display session running, you can see that job information too.
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.
7/23/08 How to change/create a CL source member and compile on a system where PDM is not available.
Use the command/parms: EDTF FILE(srclib/srcfile) MBR(srcmbr)
You will not be able to prompt the CL commands, but you can cut and paste or simply type the syntax that you want.
Press F3 twice, then use the CRTCLPGM to recompile the program.
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.
7/14/08 How to fix a print job that hangs because record count is exceeded.
If a job that creates a spool file hangs up with the message, "Reached Maximum number of spooled records for file XXXXXX in library YYYYYY", the printer file has tried to generate spool file records that exceeds the number of records the print job specified. A finite limit to the number of records in a spool file is usually specified in order to control a runaway job from filling up disk space. To increase the number of records the spool file can hold, change MAXRCDS parameter in the CHGPRTF command within the program. Example
CHGPRTF FILE(XXXXXX) MAXRCDS(100000)
Caution: You can change the value of the MAXRCDS parm to *NOMAX, but keep in mind that this takes away the “governor.” If the program somehow gets into a "loop" while the spool file, it will create output until system storage is completely used up causing your system to shut down.
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.
07/08/08 Automatically monitor message queues for Save While Active checkpoints to execute other actions
The following describes two CL programs that can automate your save process so that prior to it starting a program is submitted to batch that creates a job to monitor the message queue for the checkpoint message. When the checkpoint message is received other processes can then be initiated.
Create a save program (i.e.:pgmlib/savepgm)
PGM
CLRMSGQ MSGQ(QUSRSYS/SWAMSGQ)
MONMSG MSGID(CPF2403) EXEC(CRTMSGQ MSGQ(QUSRSYS/SWAMSGQ))
/* INSERT THINGS TO DO PRIOR TO THE SAVE SO A CHECKPOINT CAN BE REACHED */
/* Example ENDSBS SBS(QINTER) OPTION(*IMMED) */
SBMJOB CMD(CALL PGM(yourlibrary/SWAMONMSGQ)) JOB(#SWAMONMSG)
SAVLIB LIB(libtosave) DEV(yourdevice) +
SAVACT(*SYNCLIB) SAVACTMSGQ(QUSRSYS/SWAMSGQ)
ENDPGM
Create a program to monitor for checkpoint (i.e.: pgmlib/SWAMONMSGQ) that will monitor the message queue for the save while active checkpoint message. When the message is processed, other actions can then be executed; i.e.: letting users back into an application or restarting another process. If multiple backups are running at one time, a message queue for each save should be used.
PGM
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
LOOP: RCVMSG MSGQ(QUSRSYS/SWAMSGQ) MSGID(&MSGID)
IF COND(&MSGID *NE 'CPI3712') THEN(GOTO CMDLBL(LOOP))
/*INSERT THINGS TO DO AFTER THE CHECKPOINT MESSAGE IS REACHED HERE */
/* Example STRSBS SBSD(QINTER) */
ENDPGM
Submit or schedule the save program you created (pgmlib/savepgm)
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.







