Model 204 Frequently Asked Questions
Autofix: Part 2 by Brian Kelley
Last month we told you how to prepare to apply the Early Warning fixes by allocating the OUTxxxx files. This month we describe how to apply the maintenance and verify the results. Application of maintenance is operating system dependent.
Object replacement under OS/390: running a relink
Your screen output displayed which OUTcsect files were generated. Consult the Early Warning text to find out which modules they are in and how to set up your JCL for the relink, for example:
Note: an error was discovered in the following code. Please, see Correction in the October 2000 edition of CCAPrint for replacement code.
//JOBCARD //STEP01 EXEC PGM=IEWL,REGION=2048K, // PARM='LIST,LET,MAP,NCAL,SIZE=(700K,200K),AC=1' //SYSPRINT DD SYSOUT=C //SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,90,,CONTIG) //OLDLOAD DD DSN=prefix.OLD.LOADLIB,DISP=SHR //SYSLMOD DD DSN=prefix.NEW.LOADLIB,DISP=SHR //OBJLIB DD DISP=SHR,DSN=prefix.NEWOBJ(EVSO) // PEND //STEP01.SYSLIN DD * * Then include the old ONLINE module: INCLUDE OLDLOAD(ONLINE) * Include the new object module(s) for ONLINE, e.g.: INCLUDE OBJLIB(EVSO) ENTRY MAINTASK NAME ONLINE(R) /* * Same for Batch204, IFAM1, and IFAM4, if applicable to these modules.
Object replacement under VM: running a regen
Under VM, use the M204GEN job to pick up the objects named csect TXTnnn to create the new module(s) (where TXT420 is version 4.2.0, TXT411 is version 4.1.1, and so on). Be sure your OUTcsect files have the correct file name, such as EVSO, BXCI, as well as the correct file type, TXTnnn.
You can either rename the old TXTnnn files or backup the disk and overwrite the original object files, which are usually located on the D disk.
Alternatively, you can put the object replacements on your A disk where VM picks up these files instead of the similarly named ones on the D disk.
Then the regen is accomplished by entering:
M204GEN ALL (options
If you store the object replacements on the A disk, you should, after a testing period, copy them to the D disk. This insures that subsequent regens will use the correct object.
Object replacement under VSE
You must add new object modules to the correct sublib, then use them as input to the linkage editor to create a new phase. Since all Model 204 object modules are under control of MSHP, you must specify the MSHP parameter when LIBR is invoked. Using the following example, you must set your site requirements for all JCL and parameters prefixed with the at character (@).
// JOB LIBR REPLACE OBJ MODS // DLBL M204LIB,'M204.LIBRARY' // EXTENT ,@volser // DLBL IJSYSIN,'@name.of.the.dataset.used.as.the.target.of.the.OUTcsect' // EXTENT SYSIPT,@volser ASSGN SYSIPT,DISK,VOL=@volser,SHR // EXEC LIBR,PARM='MSHP;ACC S=M204LIB.V@sublib;CAT @csect.OBJ R=Y' /* CLOSE SYSIPT,SYSRDR /&
Applying zaps under OS/390: running a zap job
Zaps under OS/390 are applied to object modules using the IBM utility AMASPZAP. Modify your job to point to the load library to be zapped and OUTZAPS file used by Autofix to download zaps.
//JOBCARD //ZAP EXEC PGM=AMASPZAP,REGION=128K,PARM=IGNIDRFULL //SYSPRINT DD SYSOUT=* //SYSLIB DD DSN=prefix.M204.LOADLIB,DISP=SHR //SYSIN DD DSN=prefix.M204.OUTZAPS,DISP=SHR
Applying zaps under VM: zap the modules
First, spool your console to the reader, so you can look at the zap output when it is finished, by issuing the following command:
cp spool cons start to *
To apply the zaps, enter:
ZAP MODULE (INPUT outzaps
where outzaps is the filename of the file that contains the zap(s); the filetype must be ZAP. For example:
FILEDEF OUTZAPS DISK OUTZAPS ZAP A (LRECL 80 RECFM FB BLKSIZE 80
Now, stop your console with the following command:
cp spool cons close
You can look at the output in the reader list with the RLIST command. A file is automatically created called modulename ZAPLOG; it contains a line for each csect that you zapped. modulename might be M204AUDIT, M204IFM1, M204ONLN, M204UTILC, or M204UTILJ or a name starting with X, which indicates DCSS modules.
Check this output to make sure all the zaps applied.
Applying zaps under VSE
Zaps under VSE are applied to object modules in your sublib using MSHP.
Using the following example, you must set your site requirements for all JCL and parameters prefixed with an at character (@).
// JOB MSHP APPLY M204 ZAP(s) // ASSGN SYS002,DISK,VOL=@volser,SHR // DLBL IJSYSHF,'@dataset.name.of.the.history.file' // EXTENT SYS002,@volser,1,0,@starting.track,@number.of.tracks // DLBL IJSYSIN,'@name.of.the.dataset.used.as.the.target.for.OUTZAPS' // EXTENT SYSIPT,@volser ASSGN SYSIPT,DISK,VOL=@volser,SHR // DLBL M204LIB,'@dataset.name.of.the.target.library' // EXTENT ,@volser // EXEC MSHP /* /&
You must create a new phase. To do this, use the existing linkedit JCL on your system. This should be the JCL that was used when Model 204 was initially installed. Consult the Early Warning text to determine which phase(s), based on the object(s) that were zapped, will need to be relinked.
Verifying fixes to Online or Batch204
You can logon to the Online or run a Batch204 job and then issue the following System Manager command:
DISPLAY EW ALL
The output of the DISPLAY command is a list of all Early Warnings applied. This list is updated whenever a zap is applied (zap to EWDP). Most fixes reflect this at the end of the zap. It simply turns on the bit in EWDP indicating that the fix was applied. The list for Online can differ from Batch204, if some of the fixes do not apply to both modules.
Verifying fixes to other modules
Because the DISPLAY EW ALL command affects only Online and Batch204, you can run a zap job using the REPs as VERs to verify other modules, such as AUDIT204. The original zap might look something like this:
NAME IFAM4 DKBM$ VER 0010 0001,0002,0003,0004 REP 0010 0005,0006,0007,0008
The VER command says: verify that at location 10 the contents are 0001,0002,0003,0004. The REP command says: replace whats at location 10 with 0005,0006,0007,0008.
Set up a job that uses the same OUTZAPS file, remove the VER lines and replace REP with VER. You are verifying that the zap, the original REP lines, has been applied.
How do I know that the object replacement has been done?
To verify that you are running with a new object module, use the following System Manager command:
*LOOK csect X'0000' 10
where csect is the object module you want to check. For example, after you finish applying 4.2.0 Early Warning 59 that required an object replacement for EVSO, in addition to seeing 59 in the DISPLAY EW ALL command output, you should also see the following:
*LOOK EVSO X0000 10 EVSO 0000B190 EVSO +00000000 C5E5E2D6 40404040 F44BF24B F0D2C440 *EVSO 4.2.0KD*
The version number is displayed at the far right, in this case 4.2.0KD. You must verify this against the Object Level indicated within the Early Warning text.
Note: A DISPLAY EW ALL command is not fail safe. If there is object replacement(s) and you have not relinked or regenned, the fix is not on correctly.
How do I get fixes?
Autofix tapes are sent to your sites System Manager. To have an Autofix tape automatically shipped when new tapes are available, return your current tape.
Your system manager can download fixes from the Web. To get them off the Web site, youll need a User ID and password so that you can access our "Secure Maintenance Information" area.
Next question?
In Autofix: Part 3 we will discuss which comes first, the zap or the object replacement.
System 1032 Optimizing Random Selection in PL1032 by Tym Stegner
Recently I made extensive use of the $RANDOM system function while reproducing a customer problem. To simulate an application system, my test program was designed to randomly open and close datasets and then track the system memory used.
First, the test randomly opens 250 datasets from a pool of 532 datasets. Next, a REPEAT loop closes a randomly selected dataset from the 250 open datasets. Then another randomly chosen dataset is opened from the 283 closed datasets. When a threshold number of opens are completed, the 250 open datasets are closed in random order. The dataset pool is represented by a set of records in another dataset.
To minimize I/O overhead, the dataset records are read into an array structure as they are first used, to be read from the array for subsequent processing.
Seeding $RANDOM
You must seed $RANDOM with a large, odd number at the beginning of your program. I used the value of $NOW to seed $RANDOM, as shown in the following code:
Let $RANDOM = $DINT($TEXT($NOW,D5..2)&"3")
The value of the $NOW system function is converted to a D5.2 formatted text string, which renders the date as MMDDYY HHMMSS. The second period in the date format suppresses the space between the date and time, for example 000410162317. Concatenation of the 3 ensures the result is an odd number. (You can use any odd number you like). The $DINT system function converts the numeric string to double integer to guard against integer overflow.
Minimizing $RANDOM checking
The standard methodology of random number generation multiplies the value of $RANDOM by the number of choices, then adds 1. The resulting number is compared via a tracking mechanism to eliminate duplicate choices. If not already chosen, the number represents the random choice.
The following example demonstrates the random selection of 532 numbers, with no repeats.
Variable lx Array (532) Of Integer ! List of choices Variable rx,nx Integer Initially 0
For nx From 1 To 532 Do Let lx(nx)=nx ! Populate sample choices End_For
Repeat ! Begin the master loop Let rx = ($RANDOM*532)+1 ! Get a possible choice If lx(rx) NE Missing Then ! Chosen yet? Write nx-1 lx(rx) ! No? Then output value Let nx=nx-1, ! and decrement number chosen lx(rx)=Missing ! and mark as chosen End_If ! If already chosen, retry Until nx EQ 1 ! Until all found
In the early repeats of the loop, each cycle likely finds a never-before-selected object. But after a while the cycles find only already-selected objects, requiring a retry cycle. This cycling begins to take its toll, requiring multiple repeats to locate a never-before-selected object. For the previous example, the average number of repeats was 3675 over 100 trials. The program did an average of six tries for each object.
Reducing the number of retries
As the test program was opening thousands of randomly chosen tables, I felt I needed to reduce this processing overhead. The first approach is to compress the never-before-selected object list after each selection, and thus reduce the range of numbers to be generated. The random number generated is now the index into the object array, rather than the value itself. The array acts as a container for the value, rather than a means of indicating the value was chosen. This way, the list is one object shorter each time, and each repeat is effectively against a fresh list.
Variable nx Integer Initially 532 Variable rx,ix Integer Initially 0 ! One additional integer variable Variable lx Array (532) Of Integer
For ix From 1 To 532 Do Let lx(ix)=ix ! Populate sample choices End_For
Repeat ! Begin Master REPEAT loop Let rx = ($RANDOM*nx)+1 ! Get a possible choice If lx(rx) NE Missing Then ! Been chosen yet? Write nx lx(rx) ! No? Then output value For ix From rx To nx-1 Do ! New code to compress choice list Let lx(ix)=lx(ix+1) End_For Let lx(nx)=Missing, ! Set last field missing nx=nx-1 ! and reduce the list size End_If Until nx EQ 0 ! Until no more choices
Using the previous test code, the number of repeats is exactly 532 for any number of trials. As each repeat now provided a valid value, I could simplify the repeat loop to eliminate the If test.
Reducing the number of LET commands
However, although the number of repeats is reduced, the total number of LET commands necessary to compact the array averaged 71,500. So the trick is to somehow eliminate the need to pack down the array. To accomplish this, I called on the power of System 1032 selection sets to replace the array structure.
Open Dataset ALLDS Readonly ! Can use ANY dataset
Variable nx,rx Integer Initially 1
Set Dataset ALLDS Find All ! Locate records to be randomly chosen Let $RANDOM = $DINT($TEXT($NOW,D5..2)&"3")
Repeat Set Ds allds ! Always restore context Let nx = $NREC, ! Determine number of objects rx = ($RANDOM*nx)+1 ! Pick one Getrecord rx ! Choose THAT record Write nx dsname ! Take necessary data Drop ! Lose this record Getset ! Back to selection set mode Until nx EQ 1 ! No more records!
This method takes the idea of $RECNO as the array index. Dropping the record from the selection set serves the same purpose as the array compression, so again, each repeat gets a random record from the pool.
To fulfill my test program, I had to combine methods one and three, as I not only needed to read the records from the selection set randomly, but I also needed to reuse the randomly selected datasets after they had been taken from the pool dataset.
In the end, the program randomly selected the first 250 datasets using method three, while at the same time posting the dataset names into an array structure. In addition to the dataset name, the array structure also contained an element to indicate whether the dataset was opened or closed.
Method three continued on in the program until all 532 datasets were read from the selection set. At that point, the program was effectively performing method one, as it was checking the array structure to see if the randomly selected dataset was opened or closed.
Summary and thanks
While the standard random selection methodology often wins out in the end, the previously described test provides a very efficient mechanism for random selection from datasets. As Ive described, a combination of these techniques might be needed for your application.
I want to thank Ardie Schneider of Southwest Texas State University, long-time user of System 1022 and System 1032, for his ideas about seeding $RANDOM and the underpinnings of the random dataset selection technique.
Education Schedule AprilMay 2000
The scheduled location for the following Model 204 courses is Framingham, Massachusetts. For more information call the Framingham office at 508-270-6666.
Model 204 Certification Update
Computer Corporation of America has completed regression testing and certification of supported Model 204 releases, V4R1.1 and V4R2.0, for the following operating system environments:
Sites running Model 204, V4R1.1 or V4R2.0, VSE as a guest under VM require one of the following early warnings:
At this time these Early Warnings are available through CCA Customer Support only, 1-800-755-4222.
Copyright © 2008 Computer Corporation of America. All right reserved. Published in the United States of America.
Contact CCA Webmaster Copyright 2008