How to Convert Multiformat S/36 Files to Native
Use this conversion technique to convert multiformat S/36-files to native files:
1. Convert each format to one single physical external described file. The Midrange Computing Resource CD offers a utility (FI2DDS) to help accomplish the task. (See “Utility Converts AS/400 System/36-compatible F & I Specs to DDS,” MC, August
1989.)
2. Create a multiformat logical file, in which each physical file is a separate record type. Consider naming this file the same as the old S/36 file to reduce program modification.
3. Use the Copy File (CPYF) command to copy the S/36 data to the new physical files. Use the command’s Include by Character Test (INCCHAR) parameter to select the appropriate records for each physical file.
4. If you find decimal date errors in the new physical files, use the Fix Decimal Errors (FIXDECERR) utility to correct them. (See the Resource CD, “Stamp Out Decimal Data Errors,” MC, January 1992).
— Carsten Flensburg
Editor’s note: If you replace a S/36 disk file with a multiformat logical file, you may need a format selector program. See “Multiformat Files,” TechTalk, MC, February 1995 for more details.
Your AS/400’s Database Needs a Name
When you are first installing an AS/400, one of the first actions that you should perform is to add a Relational Database (RDB) directory entry. Without this entry, you will notice messages that contain a value of “*N” where there should be a database, system, or device name. Not having a RDB directory entry can also cause referential integrity errors, requiring you to perform a reclaim storage procedure. If you are an AS/400 systems
administrator, you already know that this can take a long time. I have also seen the omission of a RDB directory entry cause ODBC errors.
To work with your existing (if any) RDB directory entries, issue the Work with Relational Database Directory Entries (WRKRDBDIRE) command from an AS/400 command line. If your system does not have a directory entry, enter a 1 in the leftmost column and press the Enter key to add it. Specify “*LOCAL” for the remote location name.
— Chris Green ASTECH Solutions Inc.
Are You Sure Your SAVSYS Tape Will Load?
If you’ve installed a RISC system, you likely created a Save System (SAVSYS) tape of the new version of OS/400. Have you set the IPL mode to “D” (indicating the tape drive) and “Manual,” then actually tried to load from that tape drive? If you have not yet tried this “test,” you should schedule it right now! You don’t have to do anything with the system’s Licensed Internal Code (LIC) programs menu when it comes up; just see if the tape will load and display what is expected.
There are several reasons you may not be able to IPL from a tape drive on a RISC system. Conditions that may prevent an IPL from tape include out-of-date tape drive microcode, a SCSI address that must be 0 on 34xx and 35xx drives, and, on certain e- series models, the alternate installation device.
If your SAVSYS tape won’t load, find out why and fix it! — Dan Herron
Don’t Lose Subsystem Modifications When Installing a New Release
Once upon a time, when OS/400 was very young (not higher than Version 2), the typical subsystem descriptions used by most installations were defined in library QGPL. During the teenage years (Version 3), IBM moved some of these objects to library QSYS. What a great idea this was, and is—except when user modifications to the subsystem description, particularly for tuning and work management, get wiped out. During a new release installation, all objects in QSYS get replaced. (I have seen people get bitten by this beast more than once!)
One thing you can do is copy the appropriate subsystem descriptions to another library, such as QGPL.
CRTDUPOBJ OBJ(sbsd_name) +
FROMLIB(QSYS) +
OBJTYPE(*SBSD) +
TOLIB(QGPL)
Then, change your startup program to start the subsystems from the copied descriptions:
STRSBS QGPL/sbsd_name
Now, installing new releases will not replace your tuned subsystem description. Consider subsystems with names that begin with Q (e.g., QCTL, QBATCH, QPGMR, and QINTER) as candidates for this protective change. You might have changed the pools, the routing entries, etc. on any or all of these subsystems.
This tip is, of course, true for any user objects in QSYS that you may have changed. I have observed changed commands, command options, tuned subsystem
descriptions, and queues of all kinds. Think about the idea, and fix it so you won’t be bothered by release installations causing operational problems.
— Dan Herron
Editor’s note: It is a good idea to rename the subsystem descriptions when you copy them. OS/400 does not require them to start with the letter Q. Giving them other names distinguishes them from the IBM-supplied objects.
If you do not rename IBM-supplied objects, you should put your versions in a library that precedes QSYS in the system library list, in case programs scan the library list for those objects.
Are You Using Passive Hubs?
The new e Series models of AS/400 have differences in the electrical circuits for twinax-connected devices. These differences become most apparent when you have a passive (i.e., nonpowered) hub and are using twisted-pair connections.
If you’re planning to upgrade to these new models and have passive hubs, you may have to replace them with active hubs.
— Dan Herron
Browsing Libraries with the Client Access/400 File Transfer
Q:When I use the Windows 95/NT Client Access/400 data transfer programs to browse available libraries on the AS/400, only the QGPL and QIWS libraries appear in the Browse Files and Members window. How can I access other libraries through file transfer?
A: By default, Client Access’ file transfer program uses the QUSRLIBL system value—which determines the user part of the library list—to determine what libraries to make available in the Browse Files and Members window. Your default user library list probably consists of the QGPL and QIWS libraries. To allow your users to perform file transfers from the libraries they want, you have the following options:
• Specify the explicit AS/400 library and file name you want to transfer to or from by typing that name in the data transfer file name field (as shown in Figure 1). The field must be in the format lib/file. In this example, we are transferring the HELP file from library QGPL.
• Use the Change System Value (CHGSYSVAL) command to change your user library list to include any library your user wants to perform a file transfer to or from. Be aware, however, that this is a global change that will modify the user library list for every AS/400 user on your system. Every user will now have access to these libraries.
• Change the individual user’s user library list by creating a unique job description that contains its own user library list and then assigning it to that individual’s user profile. First, create a unique job description with its own user library list by using the Create Job Description (CRTJOBD) command:
CRTJOBD JOBD(job-description-name) +
INLLIBL(QGPL SHARELIB)
Next, attach this job description to the user’s profile by using the Change User Profile (CHGUSRPRF) command:
CHGUSRPRF USRPRF(profile-name) +
JOBD(job-description-name)
Now, whenever the user signs on, the user library list in the job description will override the user library list specified in QUSRLIBL. The library list will be customized according to the individual’s needs, and it can be modified without affecting other users. An additional benefit is that this job description can be assigned to as many users as you want, giving groups of users access to the same libraries from a central location.
— Joe Hertvik Senior Technical Editor Midrange Computing
Automatically Refreshing Your WRKACTJOB Screen
You may not realize it, but you can set your Work with Active Jobs (WRKACTJOB) screen to automatically refresh itself after a set period of time. Here’s how you do it:
1. When you start WRKACTJOB, press F4 for a command prompt. On the Command Prompt screen, press F10 for additional parameters. This displays the Additional Parameters screen shown in Figure 2.
2. On the Additional Parameters screen, there is a parameter called INTERVAL (Automatic Refresh Interval) that specifies the number of seconds WRKACTJOB will wait before it refreshes itself while in refresh mode. The factory default is 300 seconds (5 minutes). If the INTERVAL value is set to *PRV, that means the value has been previously changed and WRKACTJOB is using the last changed value. To set your own value, change INTERVAL to any number between 5 seconds and 999 seconds. This will become your new default INTERVAL refresh rate and will be used whenever someone executes WRKACTJOB and puts the screen into refresh mode.
3. Press Enter to start WRKACTJOB.
4. To put WRKACTJOB into refresh mode, press F19 on your keyboard. WRKACTJOB will now refresh its data according to the schedule you established in the INTERVAL parameter. If you specified 30 seconds, for example, it will refresh the screen every 30 seconds. To exit from refresh mode, press F19 a second time and it will stop refreshing.
Be aware, however, that refresh mode is a restricted mode for WRKACTJOB. You cannot display information about running jobs while in refresh mode, and you are limited to using the following function keys:
F3: Exit
F10: Restart Statistics
F11: Display Elapsed Data
F12: Previous
F19: End Automatic Refresh
If you want to reconfigure WRKACTJOB using its other function key features (such as Include, Exclude, Sort, etc.), you must configure WRKACTJOB using these keys before you go into refresh mode. Refresh mode will redisplay current information based on how the WRKACTJOB screen was configured before refresh mode was started.
One last point: If you use WRKACTJOB in refresh mode, be careful that you don’t bog your AS/400 by using inappropriate parameters. You can refresh your screen
every five seconds if you want to, but the constant polling and refreshing of activity data will choke off your other jobs and negatively affect response time. Even the rate of 30 seconds I discuss here will somewhat affect performance. The key to using WRKACTJOB in refresh mode is to use it to gather data at whatever reasonable interval you wish and then end it as quickly as possible so that it doesn’t degrade your system performance.
— Joe Hertvik Senior Technical Editor Midrange Computing
How to Force Jobs to Run in Debug Mode
In our shop, programmers are restricted from updating production data by staying in debug mode. However, when a job in debug mode submits another job to run in batch, the new job does not run in debug mode. We needed a way for programmers’ batch jobs to run in debug mode also.
We accomplished this by using a customized routing entry program for our batch subsystem. We created a CL routing program that tests the current user profile for that of a programmer. If the user is a programmer, the program does a Start Debug (STRDBG) command and transfers control to the system program QCMD to continue execution.
Our program, which I’ll call ROUTINGCL, is shown in Figure 3. We changed the default routing entry attached to the batch subsystem to use our new CL program. This is done using the Change Routing Entry (CHGRTGE) command.
CHGRTGE SBSD(QBATCH) +
SEQNBR(9999) +
PGM(ROUTINGCL)
— Mark McCall
Check for Active Jobs from a Batch Program
Do you have jobs that need to run continuously but sometimes terminate for whatever reason? You can easily set up a CL program to check for active jobs in a specific job queue, and start jobs that should be active but are not. This program will check all of the jobs in a subsystem. If the job you specify is found, the CL program will terminate. If the job that you specify is not found, the CL program will submit a job to start it.
You will need to declare variables for job, user, and job number, and retrieve these variables with the Retrieve Job Attributes (RTVJOBA) command. You will also need to declare a file that contains one text field of 132 characters. This file will need to be created before the CL program is compiled. I have chosen QTEMP for the file’s library, because it requires no cleanup after the job ends.
First, trap all of the jobs currently running in the specified subsystem. Do this by using the Work with Subsystem Jobs (WRKSBSJOB) command, with the output going to *PRINT. Override the printer file QPDSPSBJ to hold on the output queue.
Next, copy the spooled file to the work file created in QTEMP, using the Copy Spooled File (CPYSPLF) command. This is where you will need the variables for job, user, and job number. Delete the spooled file after it is copied.
Finally, read the work file. Positions 4 through 13 contain the name of the job. Use the substring function to extract this field and compare it to the name of the job you are looking for. If you find the job, leave the program. If you do not find the job, read the next
record. If EOF is encountered and you have not found your job, submit it and exit the program.
The complete program is shown in Figure 4 You can put this program in your job scheduler to run at whatever frequency you desire, eliminating the need for an operator to check for these jobs on a regular basis.
— Lisa Patteson CMI Industries, Inc. Greensboro, NC
Editor’s note: This is a simple and easily implemented solution to a problem, but don’t forget that IBM has been known to change the format of reports. You may have to modify this program when upgrading to a new version or release, or installing PTFs.
Include IFS Files in Your Nightly Backup
If you are running the AS/400’s HTTP server for serving Web pages, you are probably storing HTML and other files on the AS/400’s Integrated File System (IFS). You may be storing other “PC-style” files in IFS directories on your AS/400. Are you backing this data up regularly?
Our Web materials are stored in a directory named /WEBSAMP. We back up all the files and subdirectories it contains by using the following command, which is included in our nightly backup process:
SAV DEV(‘/QSYSLIB/TAP02.DEVD’) +
OBJ((‘/WEBSAMP/*’))
Even though the Save Entire System command, run from option 21 of the SAV menu, does save them, you may be executing that command only on a monthly basis.
— Steve Swett Newaygo County CIMS Consortium
Shortcut Commands
Would you like to create a shortcut command to replace an often-keyed, lengthy command? You can create the command without creating a CL program to execute the long version of the command. The technique utilizes the QCMDEXC program as the command processing program (CPP).
You simply create a command that passes parameters to QCMDEXC as constants. The first parameter is the command string to be executed (whatever length you want), and the second parameter is a 15,5 length decimal field containing the length of the command string in parameter one.
For example, to create a shortcut command that executes the Work with Output Queue (WRKOUTQ) command to view the output queue QPRINT, create source member OQ (see Figure 5). When you create the command, specify QCMDEXC as the CPP. That’s all there is to it!
— Paul Jackson
Startup Program Customization
When I started a job as system administrator of a new AS/400 shop, the first thing I had to do was change the system startup program. The startup program is like the AUTOEXEC.BAT file on a DOS-based PC—the first job that runs when the system is
powered up. On the AS/400, it starts all the important subsystems such as QINTER, QBATCH, and QSPL, and it also starts up some jobs that need to be run at IPL time, such as the automatic cleanup. Like me, you may need to modify the startup program to add programs or start subsystems at IPL. Here’s how I did it.
I had to alter the program to start the RBTSLEEPER subsystem that runs Help/Systems’ Robot program. Since our startup program is the IBM-supplied program, QSTRUP, and IBM doesn’t supply the source code for it, I had to retrieve the source code, alter it to start RBTSLEEPER, recompile the program to a different library, and indicate to the AS/400 that it should run the modified code instead of the IBM-supplied program.
To retrieve the name of your startup program, run the Display System Value (DSPSYSVAL) command, specifying system value QSTRUPPGM. The system presents a panel that shows the name of the startup program.
If your startup program is QSTRUP in library QSYS, retrieve the source code for it with the Retrieve CL Source (RTVCLSRC) command, as follows:
RTVCLSRC PGM(QSYS/QSTRUP) +
SRCFILE(QGPL/QCLSRC) +
SRCMBR(*PGM)
This command places the source code in source file QGPL/QCLSRC, member QSTRUP. PDM then allows you to change the code. (You may, of course, use a different source file and library.) I compiled to QGPL (instead of QSYS) because I preferred to keep the original version of the program intact. That meant that I needed to change system value QSTRUPPGM to point to the new, updated program in QGPL rather than the original, IBM-supplied program in QSYS.
To change QSTRUPPGM, run the Work with System Values (WRKSYSVAL) command, position the system value list to QSTRUPPGM, and place an option 2 next to it. Then, type in the new name of the program and its library. In my case, the program name was the same (QSTRUP), but the library was QGPL.
At the next IPL, the operating system looked into system value QSTRUPPGM to determine what program to run at startup and consequently ran QGPL/QSTRUP. This procedure enabled me to start subsystem RBTSLEEPER at IPL and retrieve the CL code of the startup program for future modifications.
— Joe Hertvik Senior Technical Editor
LATEST COMMENTS
MC Press Online