Operations
Find Save Info on an Object
The Display Object Description (DSPOBJD) command can provide you with a quick and simple method of determining the last time an object(s) was saved and on what media (tape, diskette, or save file) and where (volume/sequence number) on tape the object is located. The command output can be directed to the screen, the printer, or an outfile that you can read in a program. The Retrieve Object Description (RTVOBJD) command can provide the same information to a CL program. The information is returned to your program as CL variables.
With V2R1, IBM added six data areas in QSYS that, while they do not contain any data, contain save/restore information in their object descriptions. The data areas and the information their descriptions contain are listed below:
QSAVLIBALL - info on SAVLIB (*NONSYS) operation. QSAVALLUSR - info on SAVLIB (*ALLUSR) operation. QSAVIBM - info on SAVLIB (*IBM) operation. QSAVUSRPRF - last use of SAVSYS, SAVSECDTA, and RSTUSRPRF commands. QSAVSYS - info on last use of SAVSYS command. QSAVSTG - info on last use of SAVSTG command.
- Fred Skinner
Renaming Device, Controller, or Line Descriptions
Version 2 of the operating system lets you rename device, controller or line descriptions. The object must be varied off first; then use the WRKDEVD, WRKCTLD, WRKLIND or RNMOBJ commands.
This is very handy when installing new displays and printers. If you don't like any of the AS/400 naming conventions, you can allow the system to auto- configure the device and then rename it. This way, you'll be sure that the display or device is configured correctly.
If you use the WRKCFGSTS command to rename a device, and select the *BASIC assistance level, you don't even have to vary the device off before changing the name. Use option 9 to rename the object and Operational Assistant will vary the device off, rename the object, and then vary the device on again.
- Fred Skinner
Estimate Job Completion Time
When a batch job is processing a file sequentially, you can estimate its completion percentage. Display the job using DSPJOB option (*OPNF), or select option 5 and then 14 from the WRKUSRJOB, WRKSBMJOB or WRKACTJOB.
If the file is being read in arrival sequence, you can use the relative record number column to determine how many records have been processed. Comparing the number of records processed to the active record count of the file estimates the percentage complete. By extrapolation with the elapsed time, an estimated finish time may be computed based on the current system load.
- Douglas Handy
Apply Parameter Values to More Than One Object at a Time
Suppose you have five reports in an output queue named OUTQ1. You want all of those reports to be sent to output queue P1, with each one printing 3 copies. This can easily be done by keying a "2" next to each file to be changed and entering the options and parameters OUTQ(P1) COPIES(3) on the command line. Then press Enter.
- Michael Catalani
Simple Method for Job Termination Notification
When you want to know if a job has completed without constant monitoring with the WRKACTJOB command, change your profile MSGQ delivery to a status of *BREAK:
CHGMSGQ MSGQ(your profile message queue) DLVRY(*BREAK)
When your job completes it sends a break message to your screen. No more waiting!
You can also change the message queue for your user profile through the CHGPRF command:
CHGPRF DLVRY(*BREAK)
The change will take effect after the next sign-on.
- Todd Cash
Changing Spool File Attributes
There is a way to change the attributes of a spool file, such as the characters-per-inch value, that is already on the output queue. Here is an example of how you would change from 10 CPI to 15.
1. Create a physical file to receive a copy of the spool file:
CRTPF FILE(*curlib/spl001) + RCDLEN(133)
2. Copy the spool file to the created physical file with First Character Form Control (*fcfc):
CPYSPLF FILE(spool file) + TOFILE(*curlib/spl001) + JOB(number/userid/job) + CTLCHAR(*fcfc)
3. Override QSYSPRT to the new CPI and specify control character *fcfc:
OVRPRTF FILE(qsysprt) + CPI(15) + CTLCHAR(*fcfc)
4. Copy the saved spool file to QSYSPRT:
CPYF FROMFILE(spl001) + TOFILE(qsysprt)
- Alon Fluxman
Special Profile Quit
Create a user profile called QUIT that will enable a quick return to an active session if SysRq 1 is accidentally pressed or if a passthrough session is ended with SIGN-OFF rather than ENDPASTHR.
The initial program should process an ENDPASTHR command (with a MONMSG if passthrough is not active) and then process the SIGNOFF command.
- Tim Horne
A Better System Request Option 90
Our system uses both the LDA and QTEMP heavily. When an error occurs during an interactive job there is no way of viewing the contents of either. To solve this problem I:
Changed the message description for message ID CPX2313 in QCPFMSGF by replacing SIGNOFF with my command name "SYSRQS90".
Created a display program as the CPP for the SYSRQS90 command that shows two options, "Enter to continue" and "CMD-01 to signoff". On the display is a non-display field that is used to enter a password. When the correct password is entered, the command entry is displayed. This allows the programmers to view the contents of the LDA, QTEMP or whatever else they want.
Then to make it a little more secure (because any user would be able to attempt to enter the password) I created a data area to be used as a switch which the programmer sets on when needed; then I check it in the program. If the switch is on, the password works; if not, it does not. This gives more control on when the option is used.
- Greg Leister
Avoid Static on Magnetic Tapes
To overcome the problem of static electricity on magnetic tape reels, just crumple the first 6 to 8 inches of the tape in the palm of your hand. Then smooth the end of the tape back around the reel. The wrinkles in the tape will not allow the end of the tape to cling to the rest of the reel.
The tape will work on both vertical and horizontal tape drives. Unlike vertical tape drives which have the added power of gravity to help pull the end of the tape away from the rest of the reel, this tip works especially well for horizontal tape drives.
- Harvey Lee
Command Line Window
One of the nice things about SEU is the F21 option for the command line window. The command line window can be invoked in your user applications as well. The following command will invoke the program that displays the AS/400 command line window:
CALL QUSCMDLN
The window will appear at the bottom of the screen. In it, you can enter any command. F12, or Enter with no input, will close the window. You can call QUSCMDLN from your RPG programs too.
- Steven Kontos
LATEST COMMENTS
MC Press Online