doc
Mainframe
Performance Guidelines
Prepared By :
Document Control
Version History
Changed
Version Date Nature of amendment
by
Mainframe
0.1 13 Sep 2007 Initial Draft
practices
Table of Contents
1 INTRODUCTION...........................................................................................................................4
1.1 OBJECTIVE .................................................................................................................................4
1.2 SCOPE ........................................................................................................................................4
2 COBOL GUIDELINES...................................................................................................................5
2.1 GENERAL GUIDELINES ................................................................................................................5
2.2 PERFORMANCE GUIDELINES ........................................................................................................5
3 CICS PERFORMANCE GUIDELINES....................................................................................... 10
3.1 GENERAL GUIDELINES .............................................................................................................. 10
3.2 PERFORMANCE GUIDELINES...................................................................................................... 11
4 DB2 GUIDELINES ....................................................................................................................... 14
4.1 GENERAL GUIDELINES .............................................................................................................. 14
4.2 PERFORMANCE GUIDELINES...................................................................................................... 15
5 IMS GUIDELINES ....................................................................................................................... 20
5.1 GENERAL GUIDELINES .............................................................................................................. 20
5.2 PERFORMANCE GUIDELINES ...................................................................................................... 21
6 JCL GUIDELINES ....................................................................................................................... 22
6.1 GENERAL GUIDELINES .............................................................................................................. 22
6.2 PERFORMANCE GUIDELINES ...................................................................................................... 23
1 Introduction
1.1 Objective
There is no comprehensive document on performance guidelines. The intention of this
document is to list down a comprehensive set of guidelines that could be adopted by
various accounts with minimal customization. This will ensure consistency across the
vertical. In the absence of any client specific guidelines, the guidelines described in this
document could be implemented as it is. In cases, where client specific guidelines are
present, the guidelines described in this document could be implemented based on client
consent.
1.2 Scope
The scope of this document is to outline performance standards for COBOL, CICS, JCL,
DB2 and IMS. The document also mentions a set of good practices / guidelines, which
are effective in enhancing an application program’s performance and efficiency.
• COBOL
• CICS
• IMS/DB
• JCL/PROC
• DB2
• IMS/DC
• Assembler
• REXX
• PLI
2 COBOL Guidelines
2.1 General guidelines
• In use of relational operators, at least one blank character should precede and follow
the operator.
• Linear Search (SEARCH) is fast if the amounts of search operations are lesser,
Binary search (SEARCH ALL) is used if the amounts of search operations are more.
• For efficiency, put frequently accessed items at the beginning of the TABLE for
sequential searches
• Comparison using Equals (=) is faster than comparison using NOT EQUALS (^=)
• In Evaluate statement, put the conditions that are most likely to occur as the first
condition.
• Usage of performs: PERFORM Paragraph compiler converts up to 6 machine
instructions and PERFORMs with VARYING will require many more machine
instructions. It will be a problem if the code is executed millions of times.
Maintainability with speed need to be considered while using them.
• QSAM: Large block size should be used by using block contains clause in File
Section. Best practice is to allow system to decide the optimal block size by
specifying “Block Contains 0 “clause for creating any new files and omitting BLKSIZE
option in JCL. This should significantly improve file processing time (Both CPU time
and elapsed time)
• Increasing the number of I/O buffers for heavy I/O jobs can improve both the CPU
and elapsed time performance, at the expense of using more storage. This can be
accomplished by using the BUFNO sub parameter of the DCB parameter in the JCL
or by using the RESERVE clause of the SELECT statement in the FILE-CONTROL
paragraph
• When writing to variable-length blocked sequential files, use the APPLY WRITE-
ONLY clause for the file or use the AWO compiler option. This reduces the number of
calls to Data Management Services to handle the I/Os.
• When using VSAM files, increase the number of data buffers (BUFND) for sequential
access or index buffers (BUFNI) for random access. Also, select a control interval
size (CISZ) that is appropriate for the application. A smaller CISZ results in faster
retrieval for random processing at the expense of inserts whereas a larger CISZ is
more efficient for sequential processing. In general, using large CI and buffer space
VSAM parameters may help to improve the performance of the application.
• For VSAM; ACCESS IS DYNAMIC is optimal when reading one record in a random
order and then reading several subsequent records sequentially. VSAM may pre
fetch multiple tracks of data when using ACCESS IS DYNAMIC.
• In general, sequential access is the most efficient, dynamic access the next, and
random access is the least efficient. However, for relative record VSAM
(ORGANIZATION IS RELATIVE), using ACCESS IS DYNAMIC when reading each
record in a random order can be slower than using ACCESS IS RANDOM,
• Random access results in an increase in I/O activity because VSAM must access the
index for each request. If you use alternate indexes, it is more efficient to use the
Access Method Services to build them than to use the AIXBLD run-time option. Avoid
using multiple alternate indexes when possible since updates will have to be applied
through the primary paths and reflected through the multiple alternate paths.
• To get the best performance from arithmetic statements always use the simplest
forms. Use simple two-operand arithmetic statements wherever possible.
• Use Proper USAGE clause for the numeric items, like for counters use COMP, for
arithmetic calculations use COMP-3, this will be used for optimization – both speed
and storage...
• Use COMP or COMP-3 declarations when handling files, this helps save space.
• Use SYNCHRONIZED clause which is used to optimize the speed of processing, but
it does so at the expense of storage. When using binary (COMP) data items, the use
of the SYNCHRONIZED clause specifies that the binary data items will be properly
aligned on half word, full word, or double word boundaries. This may enhance the
performance of certain operations on some machines. Additionally, using signed data
items with eight or fewer digits produces the best code for binary items.
• The following shows the performance considerations (from most efficient to least
efficient) for the number of digits of precision for signed binary data items (using
PICTURE S9(n) COMP):
n is from 1 to 8
n is from 10 to 17
n is 9
Full word values are converted to double word format and then double word
arithmetic is used (this is SLOWER than any of the above)
n is 18
Double word values are converted to a higher precision format and then
arithmetic is done using this higher precision (this is the SLOWEST of all for
binary data items)
• Main program not COBOL: If the first program in the application is not COBOL, there
can be a significant degradation if COBOL is repeatedly called since the COBOL
environment must be initialized and terminated each time a COBOL main program is
invoked. This overhead can be reduced by using run time options like LIBKEEP,
RTEREUS etc.
• Use Dynamic calls wherever feasible.
• Avoid using USAGE DISPLAY data items for computations (especially in areas that
are heavily used for computations). When a USAGE DISPLAY data item is used,
additional overhead is required to convert the data item to the proper type both
before and after the computation. In some cases, this conversion is done by a call to
a library routine, which can be expensive compared to using the proper data type that
does not require any conversion
• When using PACKED-DECIMAL (COMP-3) data items in computations, use 15 or
fewer digits in the PICTURE specification to avoid the use of library routines for
multiplication and division. A call to the library routine is very expensive when
compared to doing the calculation in-line. Additionally, using a signed data item with
an odd number of digits produces more efficient code since this uses an integral
multiple of bytes in storage for the data item.
• For PACKED-DECIMAL : Using an odd number of digits is 6% faster than using the
next lower even number of digits using the fewest odd number of digits as possible
may result in an additional 5% to 15% savings compared to using the next larger
number of odd digits
• Plan the use of fixed-point and floating-point data types. Performance of an
application can be enhanced by carefully determining when to use fixed-point and
floating-point data.
• When conversions are necessary, binary (COMP) and packed decimal (COMP-3)
data with nine or fewer digits require the least amount of overhead when being
converted to or from floating-point (COMP-1 or COMP-2) data.
• When using fixed-point exponentiations with large exponents, the calculation can be
done more efficiently by using operands that force the exponentiation to be evaluated
in floating point.
• Forcing an exponentiation to be done in floating point is 98% faster than doing it in
fixed point.
• Using indexes to address a table is more efficient than using subscripts since the
index already contains the displacement from the start of the table and does not have
to be calculated at run time. Subscripts, on the other hand, contain an occurrence
number that must be converted to a displacement value at run time before it can be
used.
• When using subscripts to address a table, use a binary (COMP) signed data item
with eight or fewer digits (for example, using PICTURE S9 (07) COMP for the data
item). This will allow full word arithmetic to be used during the calculations.
Additionally, in some cases, using four or fewer digits for the data item may also offer
some added reduction in CPU time since half word arithmetic can be used.
• When using OCCURS DEPENDING ON (ODO) data items, ensure that the ODO
objects are binary (COMP) to avoid unnecessary conversions each time the variable-
length items are referenced.
Some performance degradation is expected when using ODO data items
since special code must be executed every time a variable length data item is
referenced. This code determines the current size of the item every time the item is
referenced. It also determines the location of variably-located data items. Because
this special code is out of line, it may inhibit some optimizations. Furthermore, code
to manipulate variable-length data items is substantially less efficient than that for
fixed-length data items. For example, the code to compare or move a variable length
data item may involve calling a library routine and is significantly slower than the
equivalent code for fixed-length data items. If you do use variable-length data items,
copying them into fixed-length data items prior to a period of high-frequency use can
reduce some of this overhead.
• When using tables, evaluate the need to verify subscripts to determine if the
subscript is out of bounds. Using the SSRANGE option (to catch the errors) causes
the compiler to generate special code at each subscript reference. However, if
subscripts need to be checked at only few places in the application to ensure that
they are valid, then coding your own checks can improve the performance when
compared to using the SSRANGE compiler option.
Example:
write:
rather than:
• Use Continue instead of Next Sentence. Next sentence adds run time overheads as
the control needs to be passed to the next COBOL sentence (COBOL statement after
a period is found) whereas Continue means execute the next logical instruction.
.
• Do not use the CORRESPONDING option of the MOVE verb. Also do not use
STRING and UNSTRING verbs.
• Avoid COBOL SORT, use SYNCSORT instead. COBOL SORT is only advisable
when the input file needs to be sorted and outputted in vertical slices of the file.
For e.g. - Input file is 300 byte and the output should be - Sort the file on column 1,
length 5, and the output files are - file1 - column 1-50, file2 - column 51-100, file3 -
column 101-150... file6 column - 251-300.
• For file processing, SORT the file on key value and built logic in the program to avoid
DB access for repetitive keys (current-key = previous-key)
• Define and populate and SORT Arrays in Working Storage for tables that have small
volume to data to reduce DB I/O.
• Avoid GO TO Statements
• Comparisons using EQUALS (=) or NOT EQUAL are faster than comparisons using
GREATER (>) or LESS (<).
Example:
Here's an example to illustrate this. In the example we are checking a VSAM status code.
The most likely value is 00 (Executed without any errors), the later is more efficient.
• Watch compiler options. Some compiler options can result in longer running
times. For example SSR, which checks for subscripts going out of range actually
adds extra code to your program to check subscripts. SSR would be acceptable
in a test environment, but may not be appropriate in the production environment.
• If at all possible, avoid doing a sort within a COBOL program. COBOL sorts are
very inefficient. If you must do a sort in a COBOL program, specifying the
FASTSRT compiler option may speed up the sorting process.
• Minimize the number of interactions between a CICS transaction program and a file
system such as the SFS server or the database product.
• Efficiency can be improved by using auxiliary trace to review your application programs. It
can identify many common coding problems, such as:
ü Unnecessary code
ü Too many or too large EXEC CICS GETMAIN commands
ü Failure to release storage when it is no longer needed
ü Failure to unlock records held for exclusive control that are no longer needed
ü Unintended logic loops.
• Many programmers check for the presence of a COMMAREA by simply checking to see
if EIBCALEN is greater than zero and, if true, moving the LINKAGE SECTION item
DFHCOMMAREA into a WORKING STORAGE area. This technique may seem proper
on the surface, but it is not. CICS has no knowledge of the length of the LINKAGE
SECTION item DFHCOMMAREA. The length and layout of this item are set at compile
time. At execution time, the actual length passed from the invoking program is provided in
the EIB item EIBCALEN. It is the called program's responsibility to insure that EIBCALEN
matches the compile time length of DFHCOMMAREA. Failure to verify that EIBCALEN
matches the length of the DFHCOMMAREA passed can lead to ASRA / 0C4 ABENDs,
storage overlays, or invalid data being moved into the working storage area of a program.
• When working with VSAM datasets, you can avoid deadlocks by following these rules:
ü An application must end all browses on a file by means of ENDBR commands
(thereby releasing the VSAM lock) before issuing a READ UPDATE, WRITE, or
DELETE (without RIDFLD) to the file.
ü All applications that update multiple resources should do so in the same order.
For example, if a transaction is updating multiple records in a dataset, it can do
so in ascending key order. A transaction that is accessing more than one file
should do so in the same predefined sequence of files.
ü An application that issues a READ UPDATE command should follow it with a
REWRITE, DELETE (without RIDFLD), or UNLOCK to release the position
before doing anything else to the file.
ü A sequence of WRITE MASSINSERT requests must terminate with the UNLOCK
command to release the position. No other operation should be performed before
the UNLOCK command has been issued.
• Hold resources only as long as required, rather than waiting until the task is terminated to
let CICS release them for you. Resource contention is always a big performance
problem. Transactions which do not release resources can hold up the processing of
other transactions. The transactions which are held up are also holding resources which
may be needed by other transactions. Eventually the whole system can grind to a halt.
• Use CALL statement instead of LINK or XCTL because execution overhead is least for a
CALL, as no CICS services are invoked; for example, the working storage of the program
being called is not copied.
• If the invoking program does not need to have control returned to it after the invoked
program is processed, it should use an XCTL command. Both processor and storage
requirements are much greater for a LINK command than for an XCTL command.
ü Use the MASSINSERT option if you are adding many records in sequence. This
improves performance by minimizing processor overheads and therefore
improves the response times.
ü Use skip sequential processing if you are reading many records in sequence
whose keys are relatively close together but not necessarily adjacent. (Skip
sequential processing begins with a start browse (STARTBR command).) Each
record is retrieved with an READNEXT command, but the key feedback area
pointed to, by RIDFLD is supplied with the key of the next requested record
before the READNEXT command is issued.
GETMAIN SHARED is allocated from storage that is shared between all CICS tasks.
The total available is configured in the region database. GETMAIN SHARED remains
allocated until explicitly freed by a transaction program.
• The CICS programs should follow the technique of Pseudo-conversational and Re-
entrant
IMMEDIATE, which also allows you to do this. With RETURN IMMEDIATE, CICS
initiates a task to execute the transaction named in the TRANSID option
immediately, before honouring any other waiting requests for a task at that
terminal and without accepting input from the terminal. The old task can even
pass data to the new one. The new task accesses this data with a RECEIVE, as
if the user had initiated the task with unsolicited input, but no input/output occurs.
• The advantages of using the RETURN IMMEDIATE command versus the START
commands are :
• VSAM: Use LISTCAT to analyze your files regularly. REORG your files frequently.
ü Make note of splits, CISIZEs, FREESPACE, and dataset extents.
ü Avoid CA splits, which can cause excessive arm movement on the DASD device,
increase response time, and may use additional OSCOR. If CA splits occur often,
increase CA FREESPACE.
ü Avoid multiple extents (fragmentation), which may also cause excessive arm
movement and increase response time. Increase primary allocation parameter to
get the file into a single extent, if possible.
ü Alter % of CA/CI FREESPACE to avoid CA/CI splits.
ü For random insertion use more CI FREESPACE.
ü For non-random insertion use more CA FREESPACE.
ü If not inserting records online, use zero FREESPACE. If inserting online, allow
enough FREESPACE to avoid splits.
ü Allocate space by CYLINDERS rather than by RECORDS. Allocating space by
RECORDS can cause a CA to be smaller than 1 cylinder.
ü Always specify CISIZE for the DATA component of a VSAM dataset. The
recommended data CISIZE is 4096 (4K). IDCAMS will probably pick a larger size
than is optimum for our online system if you let the DATA component CISIZE
default.
ü Let IDCAMS pick the INDEX CISIZE for you; that is, let the INDEX CISIZE
default. IDCAMS does a good job of picking the best CISIZE for INDEX
components. If you prefer to specify your own INDEX CISIZE, 1K is preferred
because CNS has a large number of 1K buffers specified in the CICS LSR pool.
ü Buffer space is wasted if CISIZEs are chosen which do not have matching buffer
sizes in the CICS LSR pool. The only available buffer sizes in the LSR pool at
CNS are 512, 1K, 2K, 4K, 8K, 12K, 20K, and 32K. A dataset with a CISIZE other
than one of these will use the next larger buffer size, thus wasting the unused
space in the buffer.
ü All alternate index datasets should be defined with the UPGRADE option to force
VSAM to maintain all pointers to new records and keys.
ü SHAREOPTIONS (2, 3) is recommended for dataset integrity purposes. There
are absolutely no data integrity guarantees when using SHAREOPTIONS (3, 3) -
neither READ integrity nor WRITE integrity. Datasets can become corrupted and
data can be lost. If you still choose to bet your data on the use of this option, in
spite of the warnings, do so at your own risk (and keep your resume updated).
ü Use NOWRITECHECK when defining VSAM files.
ü Use SPEED when defining KSDS datasets and RECOVERY when defining
ESDS datasets.
ü Avoid MASSINSERT if possible. If MASSINSERT is used, request that the file
NOT be placed in the CICS LSR pool.
ü AIX paths should be READ ONLY. Perform all updates, insertions, and deletions
against a base cluster. Updating via an alternate index is not allowed in CICS at
CNS.
ü When requesting CICS table definitions for AIX paths, be sure to identify them as
such in the memo. There is a parameter in the FCT which associates a path with
its base cluster and should be defined properly to insure data integrity.
4 DB2 Guidelines
4.1 General Guidelines
• Filtering non qualifying rows as soon as possible reduces the CPU consumption of SQL.
Include the predicates in the SQL and not in the application logic. It also applies to the
processing inside DB2. Exploit stage 1 predicates as much as possible.
• Code the most restrictive predicate first: While coding predicates in select statement,
place the predicate that will eliminate the greatest number of rows first.
• Use indexes wherever possible, DB2 usually performs more efficiently when it can satisfy
a request using an existing index rather than no index
• If a table has only multicolumn indexes, try to specify the high-level column in the
WHERE clause the query. This results in an index scan with at least one matching
column.
• Use ORDER BY only when sequence is important: Code the ORDER BY clause when
the sequence of rows being returned is important. Order only those columns that are
absolutely necessary in order to improve efficiency.
• Use BETWEEN rather than <= and >= : BETWEEN allows the optimizer to select a more
efficient access path.
• Use IN instead of LIKE: If you know that only a certain number of occurrences exist,
using IN with the specific list is more efficient than using LIKE. The functionality of LIKE
can be imitated using a range of values. For example, for retrieving all employees with a
last name starting with "M," use BETWEEN 'maaaaaaaaaaaaaaa' and
'mzzzzzzzzzzzzzzz' instead of LIKE 'm%'
• Avoid using % or _ at the beginning as it prevents DB2 from using a matching index.
Instead use it at the end.
• Use Joins instead of Subqueries. Joins will give the DB2 optimizer more options for data
access than a subquery.
• As a general rule, use the LOCK TABLE only after discussing its implications with DBA
staff. LOCK TABLE can significantly decrease an applications processing time by
eliminating page locks, but will also make the tablespace unavailable to any other
access. It locks ALL tables in a Tablespace. The locks are held until a COMMIT or
DEALLOCATE, and all users are locked out of the tablespace.
• Before embedding SQL in an application program, test it using SPUFI. This reduces the
amount of program testing by ensuring that all SQL code is syntactically correct and
efficient before it is placed in an application program.
• Indexes are used in a WHERE clause with the following predicate types:
ü column = value
ü column is null
ü column > value
ü column < value
ü column >= value
ü column <= value
ü column BETWEEN value1 and value2
ü column LIKE 'char%'
ü column IN list
• Indexes are NOT used in WHERE clauses with the following predicate types:
ü column not null
ü column not BETWEEN value1 and value2
ü column LIKE '%char'
ü column LIKE '_char'
ü column LIKE host variable
ü column not IN list
• Use EXPLAIN utility to determine if indexes are being used in the SQL statement.
• When using ORDER BY, GROUP BY, DISTINCT, and UNION, it is best to use only
indexed columns.
• Columns used in joins should be of the same data type, length, and name.
• Avoid SELECT *
• Include as many matching predicates as possible to limit the number of rows that need to
be processed. Do not have filtering in the application as it will consume more resources
to pass a row to the application than to verify in DB2 that the row does not qualify your
search criteria.
• Use a singleton select for queries that return only one row
• When comparing Column values to Host Variables use the same Data type, Length
• Use EXISTS to test for a condition and return TRUE/FALSE instead of returning rows
• When building the SQL create the most restrictive predicate first i.e., predicate which will
eliminate the greatest number of rows
A further level of optimization is the stage at which predicates are applied. DB2
has two logical levels at which predicates are applied:
ü Stage 1, which is the most efficient level that can make optimal use of the
indexes.
ü Stage 2, which needs to obtain the information from stage 1, causes additional
CPU consumption. If your SQL contains only stage 2 predicates on an indexed
column, you can use that index-only in a nonmatching index scan, without index
screening, which might be a very inefficient access path.
• Rebind your applications over time as the data changes. Rebinding will generally improve
the overall performance of your applications because the access paths will be better
designed based on an accurate view of the data.
• Let SQL do the work instead of the program. For example, code an SQL join instead of
two cursors using program logic to join.
• Be sure to build a COMMIT strategy into every batch program that changes data. Failing
to COMMIT can cause locking problems.
• Include OPTIMIZE FOR n ROWS and FETCH FIRST n ROWS ONLY. These clauses,
placed at the end of a SELECT statement, are optimal when the whole result set isn't
needed.
• If you intend to update fetched data, you should specify FOR UPDATE clause in
the SELECT statement of the cursor definition. It decreases the possibility of deadlock
and save the cost to perform lock conversions
• Use Compound SQL and Stored procedures for better performance and will minimize
data transmission.
• Use partitioned table spaces when the amount of data to be stored is very large and to
improve recoverability.
• Use a simple table space only when the data needs to be mixed from different tables on
one page.
• Length of fields like transaction number , account number etc which forms nerve of an
application should always be defined with more data length e.g. define account number
as PIC X(9) instead of PIC X(5).
• Use partitioned tablespaces for tables over 1 million rows. With partitioned tablespaces
you have the capability to take image copies of (and in release 2.3, reorganize) one or
more partitions simultaneously (or one at a time while the other partitions are available
for other processing).
• Use PCTFREE and FREEPAGE for tables with high levels of updates and/or inserts.
Bachman will calculate appropriate values based on growth statistics.
• The SEGSIZE (n) for segmented tablespaces must be multiple of 4 such that 4 <= n <=
64. Unless a tablespace contains fewer than 64 pages, define segment size as
SEGSIZE 64. With fewer than 64 pages, define SEGSIZE as an even multiple of 4 as
close to the actual number of pages as possible.
• Create tablespaces explicitly rather than implicitly (tablespaces are created implicitly by
creating a table without naming the tablespace that will contain the table).
• USE WITH HOLD option with CURSOR, if the cursor needs to be used after the
COMMIT.
The COMMIT process closes all open cursors unless they are declared with the
WITH HOLD option. These cursors must then be reopened and repositioned after each
COMMIT in the batch application. To reduce the complexity of your application logic and
to save the execution cost of cursor repositioning, you should use the WITH HOLD option
for cursors declared in your batch applications.
• Specify CLOSE NO for frequently used tables to prevent the automatic closing of all
datasets in the tablespace when there are no current users. Only specify CLOSE YES
for tables that are rarely used.
• Set PCTFREE and FREEPAGE to 0 for tables which will have read-only access (such
as Information Center tables).
• Always specify primary and secondary (PRIQTY and SECQTY) quantities since the
default values will usually be too small. These values are in units of 'K' (1024) bytes.
Values should be an even multiple of 48K for 3390 devices.
• Specify LOCKSIZE ANY on all tables, with the exception of read-only tables. This allows
DB2 to set locking at the most efficient level.
• Only use VARCHAR when the length of the column varies by more than 20 bytes.
Otherwise the additional overhead will out-weigh the potential space savings.
• Keep in mind that the LONG VARCHAR data type has the following disadvantages: 1) it
cannot be used in any character string comparison operations, 2) it cannot be used in
WHERE, HAVING, GROUP BY, and ORDER BY statements, and 3) it cannot be used
as an index.
• Avoid LONG VARCHAR if at all possible. It should only be used in cases where long
strings of free-form text are stored (such as notes).
• Always specify primary and secondary (PRIQTY and SECQTY) quantities since the
default values will usually be too small. These values are in units of "K" (1024) bytes.
Values should be an even multiple of 48K for 3390 devices.
5 IMS Guidelines
5.1 General guidelines
• Reduce lock contention. Use the minimum PROCOPT needed for processing.
• Use Two PCBs If Little Updating: If an application does relatively little updating of a
shared database, one could replace a single update PCB with a read or read-only
PCB and another update PCB. The majority of application processing could reside
with the read PCB and when an update is required, the data could be re-read and
then updated via the update PROCOPT PCB.
• Use PROCOPT Effectively: The best way to reduce the overhead of lock contention
is simply to take less locks. A share lock does not cause contention between sharing
users; only update locks cause contention hence using correct values for PROCOPT
is essential.
The read-only program can then recover from the error. PROCOPT=GON will use no
locks. PROCOPT=GOT will temporarily invoke locking if bad pointers are
encountered.
PROCOPT=E: IMS programs can obtain exclusive access to an IMS database with
the IMS PCB option, PROCOPT=E.
• For best performance in the IMS environment, use the RENT compiler option. It
causes COBOL to generate re-entrant code. You can then run your application
programs in either pre-loaded mode (the programs are always resident in storage) or
non-preloaded mode, without having to recompile with different options.
• Reduce the Number of DL/I Calls: Locking rates and contention are directly related to
the volume of concurrent, conflicting DL/I requests for shared resources, so one way
to provide a solution to locking problems is to reduce the number of DL/I calls.
• The use of path calls can retrieve more than one database segment per call.
Ø Programs should be designed to avoid issuing multiple calls for the same
segment during a single execution.
6 JCL Guidelines
6.1 General guidelines
• Each qualifier of a dataset name except the filename should be a symbolic parameter
so that it becomes flexible to override them in exec JCL. Note that filename shouldn’t
be made symbolic parameter. Otherwise, the same filename might have different
names (with different overrides) which is highly undesirable.
• There should not be any ‘SYSIN DD *’ statements. Place all the sort SYSIN cards
and other SYSIN cards required by program in a standard control card.
• There should not be any ‘SYSOUT DD *’ statements in the PROC. Instead, define
symbolic parameter for sysout destination at step level and override it in exec JCL to
‘*’, if required.
• While creating a new version, use the standard model DCB for the application. If the
application doesn’t have one, standardize it and use it across all the PROCs that
create GDGs.
• Have a common set of step libraries for all the steps of a PROC. Generalize these
libraries using symbolic parameters so that you can override them in your exec JCL.
Example:
//STEPLIB DD DISP=SHR,DSN=&STEP1
// DD DISP=SHR,DSN=&STEP2
// DD DISP=SHR,DSN=&STEP3
You may have the above STEPLIB as a common to all steps. It has 3 libraries,
which are defined as symbolic parameters: STEP1/STEP2/STEP3. Define
defaults for these symbolic parameters in the PROC. These can be overridden in
your run JCL, if required. The advantage of having common STEPLIB is that you
need not override STEPLIB of each step in your run JCL. It’s enough if you just
override the 3 symbolic parameters. If you want any step’s library different from
others, then you can achieve it through step override.
• There are times to produce the hard copies of datasets by printing them on to a
printer and also at times may need to transmit some datasets (such as those which
contains some reports) to a set of business people. It’s a good practice to check if a
dataset is empty before doing such operations.
• Test the PROC properly with the standard tools available (or with TYPRUN=SCAN)
and then only baseline it.
• The processing of VSAM files in batch and on-line environments (either sequential or
random access) can typically be greatly enhanced by proper specification of the
number of index buffers (BUFNI) and the number of data buffers (BUFND.
• Omit the BLKSIZE parameter when possible to allow the system to calculate the
most effective block-size for the type of unit being used.
• Allow at least three times the file size for sort work space allocations, with a minimum
of three sort work DDs. For very large files, always code the sorted data sets to be
catalogued. The size of the sort work space allocations, if too small, may cause
detrimental performance of the sort.
• Usage of SYNCSORT is recommended over other similar utilities, since it takes less
CPU time and better resource utilization.
• Use RLSE parameter while dataset allocation, which frees the unused space
• Use the appropriate CLASS, REGION and TIME parameter for better performance
• Use TYPRUN=SCAN and check for JCL syntax, before submitting the actual
processing (some installations have JEM, JSCAN, JJ etc editor comment for syntax
checking). Before releasing to Production, make sure such statements are removed.