CA2E StandardsGuide ENU
CA2E StandardsGuide ENU
Standards Guide
r8.5
This documentation and any related computer software help programs (hereinafter referred to as the
“Documentation”) is for the end user’s informational purposes only and is subject to change or withdrawal by CA at
any time.
This Documentation may not be copied, transferred, reproduced, disclosed, modified or duplicated, in whole or in
part, without the prior written consent of CA. This Documentation is confidential and proprietary information of CA
and protected by the copyright laws of the United States and international treaties.
Notwithstanding the foregoing, licensed users may print a reasonable number of copies of the documentation for
their own internal use, and may make one copy of the related software as reasonably required for back-up and
disaster recovery purposes, provided that all CA copyright notices and legends are affixed to each reproduced copy.
Only authorized employees, consultants, or agents of the user who are bound by the provisions of the license for
the product are permitted to have access to such copies.
The right to print copies of the documentation and to make a copy of the related software is limited to the period
during which the applicable license for the Product remains in full force and effect. Should the license terminate for
any reason, it shall be the user’s responsibility to certify in writing to CA that all copies and partial copies of the
Documentation have been returned to CA or destroyed.
EXCEPT AS OTHERWISE STATED IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT PERMITTED BY
APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION “AS IS” WITHOUT WARRANTY OF ANY KIND, INCLUDING
WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
OR NONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS
OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS DOCUMENTATION, INCLUDING WITHOUT
LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY
ADVISED OF SUCH LOSS OR DAMAGE.
The use of any product referenced in the Documentation is governed by the end user’s applicable license
agreement.
Provided with “Restricted Rights.” Use, duplication or disclosure by the United States Government is subject to the
restrictions set forth in FAR Sections 12.212, 52.227-14, and 52.227-19(c)(1) - (2) and DFARS Section 252.227-
7014(b)(3), as applicable, or their successors.
All trademarks, trade names, service marks, and logos referenced herein belong to their respective companies.
For your convenience, CA provides one site where you can access the
information you need for your Home Office, Small Business, and Enterprise CA
products. At http://ca.com/support, you can access the following:
Provide Feedback
Chapter 1: Overview
Purpose ...................................................................................... 1-1
Related Information .......................................................................... 1-1
iSeries Guides ............................................................................ 1-1
General IBM Guides ....................................................................... 1-2
Conventions .................................................................................. 1-2
Terms Used in This Manual .................................................................... 1-2
Introduction to iSeries Programming and Documentation Standards ............................. 1-3
Importance of Standards .................................................................. 1-4
iSeries Standards ......................................................................... 1-4
Enforcing Standards ...................................................................... 1-6
Contents v
HLLs Other Than RPG III ................................................................. 2-19
Mnemonics ................................................................................. 2-20
CA 2E Mnemonic System ................................................................ 2-20
Formulate New Mnemonics ............................................................... 2-20
CA 2E and Mnemonics ................................................................... 2-21
CA 2E Naming Convention Exceptions .................................................... 2-21
Advantages of CA 2E Naming Convention ..................................................... 2-21
Enforcing A Naming Convention .............................................................. 2-22
vi Standards Guide
Tools for Creating Menus ................................................................. 3-28
Design Standards for Help Text ............................................................... 3-29
Help Text Design Considerations .......................................................... 3-29
Designing Help Text ...................................................................... 3-29
Panel Help Text .......................................................................... 3-30
Command Help Text ..................................................................... 3-30
Menu Help Text .......................................................................... 3-31
Search Indexes .......................................................................... 3-31
Design Standards for Commands ............................................................. 3-31
Why Use Commands? .................................................................... 3-32
Naming Conventions ..................................................................... 3-33
Design Standards ........................................................................ 3-34
Required Parameters for Commands ...................................................... 3-42
Design Standards for Database Files .......................................................... 3-43
Design Goals ............................................................................ 3-43
The Database of iSeries .................................................................. 3-43
Considerations for Database File Design ................................................... 3-47
Design Standards for Programs ............................................................... 3-53
Design Goals ............................................................................ 3-53
Program Types .......................................................................... 3-53
Choosing Standard Programs ............................................................. 3-54
Organizing Programs into Modules ........................................................ 3-55
Program Modularization .................................................................. 3-57
Error Recovery .......................................................................... 3-58
Error Handling ........................................................................... 3-58
Record Locking .......................................................................... 3-59
Subfile Processing ....................................................................... 3-60
Journaling for Audit Trail Purposes ........................................................ 3-61
Design Standards for Internationalization ..................................................... 3-64
General Principles ........................................................................ 3-64
MRI Translation .......................................................................... 3-65
Considerations for MRI (text) Translation .................................................. 3-69
Using System Values ..................................................................... 3-73
Writing Text for Translation ............................................................... 3-75
Ideographic Support ..................................................................... 3-76
Contents vii
Common Source File Coding Standards ........................................................ 4-4
Standard Banners in Source............................................................... 4-4
Copyright Notice in Source ................................................................ 4-5
Maintenance Comments in Source ......................................................... 4-6
Formatting Source Code .................................................................. 4-6
DDS Coding Standards for Files ............................................................... 4-7
HLL Coding Standards for Programs ........................................................... 4-8
Program Layout .......................................................................... 4-8
Coding for iSeries ....................................................................... 4-14
Contents ix
User Profiles ............................................................................. 6-7
Implementation of Security .................................................................. 6-13
Operational Rights....................................................................... 6-13
Generic Implementation of Security ...................................................... 6-14
Using Libraries .............................................................................. 6-17
Organizing a Development Environment .................................................. 6-18
Operational Flow for Objects and Source .................................................. 6-19
Naming Convention for Libraries.......................................................... 6-20
Use of Libraries ......................................................................... 6-23
Version Control ............................................................................. 6-26
Object Versions ......................................................................... 6-27
Upward Compatibility .................................................................... 6-27
Version Numbers ........................................................................ 6-28
Version Installation Procedures ........................................................... 6-28
Backup and Recovery ....................................................................... 6-29
Data Security ........................................................................... 6-30
Recovering from Non-Catastrophic Failure ................................................ 6-31
Recovering from Catastrophic Failure ..................................................... 6-31
Backing-Up ................................................................................. 6-32
Organizing Objects for Backup ........................................................... 6-33
Backing Up Live Application Systems ..................................................... 6-33
Backing Up Development Systems ........................................................ 6-34
Backup Methods ......................................................................... 6-34
x Standards Guide
Appendix B: EJB Option Runtime Example
Nouns, Adjectives, and Verbs.................................................................. B-1
Index
Contents xi
Chapter 1: Overview
Purpose
This manual describes CA 2E design, documentation, and programming
standards for IBM iSeries. It also details techniques and tools to support and
facilitate the use of the standards, including CA 2E Toolkit and CA 2E products.
This manual covers both expected minimum standards and good practice in
applying programming standards for iSeries. Where possible, the reason for
the use of a standard is given as well as the standard itself. This manual does
not advocate adopting any particular standard. It emphasizes the need for
standards and their usefulness and provides considerations for choosing
standards appropriate to IBM iSeries. In many cases, the rationale for the
suggested standards rests on software engineering principles.
Related Information
Information that is available from either IBM manuals or CA 2E product guides
is not repeated in this manual.
iSeries Guides
Documentation you may want to refer to in the context of using this manual is
listed below. Relevant iSeries guides include the following:
Conventions
This manual uses the following conventions:
Data entry text appears in caps for emphasis; however, you can enter the
data in lower case.
All terms (commands, access paths, files, and fields) refer to CA 2E unless
otherwise indicated, such as OS/400 Save Library (SAVLIB) command.
The first reference to features that have abbreviated names includes both
the full and abbreviated name; for example, the Edit File (EDTFIL) function
or National Language Support (NLS). Subsequently, only the abbreviated
name identifies the feature.
Although there is now more technology to cover, there are also some welcome
developments that simplify the task. Both the industry in general and, IBM in
particular, now give greater attention to common standards; for example,
IBM’s System Application Architecture (SAA). IBM’s Common User Access
(CUA) standard for user interface design has been rapidly and universally
adopted within the IBM world. The need for and value of software tools is
becoming better understood. Other helpful developments include the
widespread understanding and adoption of object-oriented techniques and the
realization that objects are of use not just in full object-oriented programming
environments but also in a more limited role for design.
Importance of Standards
Standards can also improve the quality of your software. Good standards
should embody established techniques for approaching commonly encountered
development problems.
iSeries Standards
IBM’s midrange architecture provides many features and productivity aids that
make using the computer easier for both the developer and the end user: the
computer can assist with its own use.
- Object-oriented design
- Use of commands
- Use of messages
- File independence
Development aids
- Testing techniques
- Naming conventions
- Use of messages
High-level languages
- Coding standards
- Use of APIs
Integral security
Enforcing Standards
Educate staff in the reason for using standards. Ensure that they realize
that standards help make their work understandable to each other.
Provide a clear statement of what the standards are and give examples.
Monitor that the standards are followed. Quality control can be assisted by
the use of development tools such as the CA 2E Toolkit utilities that will
cross-reference and summarize systems to a level at which inspections can
be made.
When adopting a new HLL or other tool, allocate time to identify and
establish appropriate standards for its use.
Naming Conventions
Naming conventions assume a particular importance on iSeries for a number
of reasons. The Single Level Object Addressing of the OS/400 architecture
means that the fundamental software entities exist within a flat hierarchy of
only two levels⎯library and object. While this has many benefits, it also
means that name conflicts are more likely, and that the context in which an
object is found does not necessarily give information about its purpose or
nature.
The maximum lengths allowed for the names of most types of OS/400 entities
are relatively short; ten characters is standard. This means that where there
are large populations of an entity, you need to plan to avoid conflicts.
Natural Language
You do not use names to only provide unique identifiers; you also use names
to classify the identified objects in order to recognize them. This is the basis of
an OS/400 naming convention.
Objects
The OS/400 operating system is object-based; this means the fundamental
software entities on the iSeries can be understood and manipulated as objects
existing within a uniform, simple conceptual framework. All OS/400 objects
have certain common properties; for example, a name, a creation date, an
owner; and can be subjected to certain common methods, such as saving,
moving, and deleting.
Objects ensure better integrity and better modularization. The OS/400 objects
also provide a simple intuitive way of understanding system software. The
statements of OS/400’s CL command language have highly uniform
verb/object syntax; for example Create Data area (CRTDTAARA), Delete data
area (DLTDTAARA), Display data area (DSPDTAARA). You may consider this as
being similar to the imperative tense used for simple English commands such
as “Read this” or “Stop that.” The distinction between objects and the methods
that operate on them corresponds to the noun/verb distinction found in natural
languages.
In the first list, the names are meaningless. You must already know about
object ABC0001 to know what it is and its capabilities. Although you might be
able to make use of rules like “objects with a range of 001 to 100 are
programs” to glean additional information, the rules are as arbitrary as the
names. In the second list, you can tell the type of the object from the name
(PGM or FIL), but little else. In the third list, you can make an educated guess
as to what each of object is, provided that you are aware of normal OS/400
conventions.
In doing so, you are employing naturalistic mechanisms: the use of a limited
vocabulary of “words” which always have a similar meaning, (DSP-Display,
DTA-Data), and the use of a simple syntax. The essence of the syntax is to
use a simple imperative verb word (DSP) followed by an object word (CUS) to
indicate a procedural verb object (DSPCUS), as opposed to an adjective (CUS)
and a noun (DTA) to indicate a passive noun object (CUSDTA). A third point to
note is that the OS/400 convention for systematically deriving mnemonics
from significant consonants is naturalistic as consonants are generally more
easily remembered.
Object-Oriented Approach
There is no reason why an object-oriented design approach should be limited
to the entities of the OS/400 shipped system. You can introduce your own
entities and design applications in terms of operations performed upon them.
For instance, if you decide that ‘Customers’ and ‘Orders’ are design entities,
you could provide the following functions:
Not all of your design objects will necessarily result in a separate OS/400
object, but the same object-oriented design principles can still be used when
naming sub-entities such as fields and members. Because of the strictures of
some of the OS/400 HLLs such as RPG III, you may need to use additional
compression rules; for example, reducing the standard three-letter mnemonics
to two.
use the same name for an entity wherever it is used. For example, it
should not be necessary to explicitly rename fields to overcome the
limitations of a particular HLL, such as with RPG III.
There are three separate interfaces in the OS/400 architecture with which you
should be consistent:
The following example gives two different schemes for naming programs and
files.
CFG *CFGL
The following table shows all of the OS/400 entities (both OS/400 objects and
component elements) that need to be named. The table also indicates whether
each entity is common or scarce, and whether an end user might need to refer
to the entity by name, both of which may affect how the item needs to be
named.
Other Entities
Other Entities
Items, such as database files and fields, are seen by end users if they are
permitted to crate query reports.
Job, reader, and writer names should be the same as the device
descriptions.
OS/400
OS/400 simple names may have a maximum of ten alphabetic characters: the
first character must be alphabetic or a special character such as ‘@’, ‘$’, or ‘#’.
Embedded blanks are not allowed. This restriction applies to object names,
member names, format names, and field names in CL, command source, and
DDS. The names of OS/400 objects, folder, and document names may also
contain an embedded period; for example ‘FRED.DOC’.
The user profile names used in networks should be eight characters or less, as
some other architectures only support eight-character names.
RPG III
File names in RPG III Calculation specifications may have a maximum of eight
characters. This is also true in File specifications, although a database override
can be used to associate this eight-character name with an actual file
possessing a longer name.
A program call statement is executed more efficiently in RPG III if the name of
the program being called can be coded as a literal. This requires that program
names are restricted to eight characters maximum.
Within an RPG III program, field names are global: they cannot be local to a
particular subroutine, nor may they be qualified by the name of the file or
format with which they are associated. This means they need to be unique
within the program. In order to avoid having to rename fields, and also to be
able to relate fields to formats, you may want to provide an indication of the
format in the field name.
COBOL
Characters other than the letters of the alphabet, digits, and the hyphen, for
example &, #, @), are not allowed.
UIM
If, on the other hand, it could also be made of any other combination of
abbreviations, guessing is more difficult:
The most efficient (giving maximum recognizability for minimal size) form of
mnemonic is three characters long, as in most CL mnemonics.
For example:
with: wh . t d . . s th. s s . y?
It is easier to carry out pattern matching on items that are strictly comparable.
A column of names is easier to scan if the names are aligned as shown in the
following example.
File types: PHY LGL DDM DSP MXD BSC CMN PRT DKT TAP CRD SAV
It is also useful if message identifiers are unique, because once a message has
been sent, there is generally no indication of the message file from which it
was obtained.
The OS/400 object hierarchy also has a bearing on the significance of names
for making distinctions, both as to the nature of the distinction, and as to the
number of distinctions.
Nature of Distinctions
Number of Distinctions
Application Objects
Libraries 1 - 10
Menus 10 - 100
Commands 10 - 100
Data queues 0 - 10
Dictionaries 0 - 20
Folders 10 - 500
Documents 50 - 1000
Receivers 0 - 10
Save files 0 - 30
Virtual disks 0 - 30
Lines 0 - 20
Devices 20 - 50
Sessions 0 - 10
Subsystems 5 - 20
Classes 5 - 20
Job descriptions 5 - 50
Job queues 5 - 20
Output queues 5 - 50
Note: The largest populations are for device formats and fields: usually it isn’t
worthwhile to give them unique names.
Object-action Naming
those items that are operated upon by a process; for example, database
files or data areas. (Objects)
This distinction can be seen in OS/400. Things upon which you operate
(QPRINT, QBATCH, QINTER), are named differently from the things you use to
perform the operation, which are named after the operation itself; for instance
DSP (DSPSBS, DSPOUTQ), or CRT (CRTSBSD, CRTOUTQ).
Name all objects needed to implement a process after the process (programs
and device files); and all objects that are operated on by processes (subjects
of actions) by what they represent.
This allows you to identify all the objects needed to run a given command or a
HLL program, apart from application-wide objects, which is assumed to be
generally needed.
Why not name programs and device files the same name as the command that
invokes them, since OS/400 object names only need to be unique within
object type? For example:
This is unviable, as the relationship between the object types is often not one-
to-one. A single command may cause many programs to be invoked or a
single program may be called by several commands. It is, however, a useful
approach to take when naming work management objects, which are related
on a one-to-one basis. For example, job description QBATCH may submit jobs
to job queue QBATCH that attaches to subsystem QBATCH that has a default
class of QBATCH. In such a case, using common names for related objects of
different types indicates any horizontal linkage across the OS/400 entity
hierarchy.
Recommendations
Use a variation of OS/400 and convention for those object types that are
scarce, or that are referred to directly by the end user.
- Use OS/400 type mnemonics to name such objects and use a single
letter prefix to identify the application.
IBM has adopted a similar approach for the system software of iSeries, as may
be seen from the names of the objects in the system library, QSYS, or other
shipped libraries such as QGPL, QRPG, QIDU. Internal objects, such as
programs, are named, using systematic prefixes.
CA 2E Naming Convention
The convention is explained in more detail for each entity level: object,
format, and field, in the following sections. Refer to the appendix, "Naming
Convention Examples," in this guide for more examples.
Because of the severe length restrictions imposed upon names by RPG III, and
to a lesser extent by OS/400, CA 2E has adopted a positional coding structure;
information is encoded by position as well as value.
For example:
A possible variation on the preceding illustration is to put the object type code
into the second position, rather than the seventh. This gives a greater
emphasis on object type, rather than functional group as a distinguishing
attribute. For example, ‘Y R M DS MN’.
For Objects
Only one letter is used since there will be relatively few application
systems, and the objects that compose the systems are in any case likely
to be separated into different libraries. For example:
Type (SAMMMM O X): O, a single letter indicating both the OS/400 object
type and the attribute. It can be any one of the following:
H Panel group
L Logical file
M DDM file
P Physical file
Q Query program
T Tape file
For Formats
When used to name OS/400 database and device file formats, the components
of the naming convention are:
The format identifier for a physical file format should be unique to that file
throughout the application, and preferably, the system.
Device files should use a format identifier of #n for display devices and $n for
printer devices. The identifier #Q is reserved for message subfiles. The format
identifier need not be shown on the actual format names of device files, since
you may want to use names that emphasize the role of the formats within a
standard program type. Such formats will be few in number and should be
named using the OS/400 naming principles, but the names should still begin
with a character to indicate the format type. For example:
Give the format identifiers of database files letter combinations that do not
usually occur in English; for instance JX, QP, ZW, as it is then easier to scan
for a field with SEU’s scan facilities and be certain of a unique match.
For Fields
When naming OS/400 database and device file fields, the components are:
Field mnemonic (PP NNNN): NNNN is a mnemonic that identifies the field
If your application system is developed in a language other than RPG III, such
as COBOL, C or PL/1, and there is no requirement to support RPG III
programs, use a systematic naming convention that provides more meaningful
names. This mainly amounts to being able to use three-character mnemonics
as shown in the following example:
The explanations of subcodes are the same as for the RPG III systematic
convention given earlier.
Note: It is still useful to indicate the file type (database, display, printer) on
the format. A common variation is to place the object type in either second
position or last.
Mnemonics
A mnemonic is a symbolic abbreviation designed to be as memorable as
possible; for instance DSP for Display, CHG for change.
CA 2E Mnemonic System
Due to the space limitations of RPG III, the CA 2E convention uses a standard
mnemonic of only two letters, rather than the three characters of CL
mnemonics.
Certain mnemonics are reserved; for instance CD for code and TX for text. See
the appendix, "EJB Option Runtime Example," in this guide, for a list of
reserved mnemonics.
CA 2E and Mnemonics
- User profiles: User profile names should reflect the user’s role. If
there are many users, a common prefix to indicate department and/or
location may be useful. Reserve the prefix ‘Q’ for IBM profiles.
- Both object type and attribute are encoded in object names. This helps
you to identify objects simply from their names.
Define all database fields in a field reference file. Designate one person
who is well versed in your standards to be responsible for issuing field
names in a field reference file.
Consider providing an exit program for the programmer’s menu using the
EXITPGM keyword on the OS/400 Display Programmer menu
(DSPPGMMNU) command. This will check that the names given to source
and object members satisfy your naming convention.
The following techniques ensure that appropriate names have been used; use
the OS/400 Display library (DSPLIB) and Display object description (DSPOBJD)
commands to obtain summary lists of object names.
Design Methods
When you start to design your system, apply the following basic principles:
- You can use the computer to index and organize the design.
Present designs to the end user and reach agreement before programming
starts. This is because:
- You must understand what the user wants; the only way you can
verify user requirements is to restate your interpretation for
verification.
- It is cost effective to incorporate changes before programming has
begun.
- improve quality
Contents of a Specification
A description of the data model, in particular the database files and what
they represent. This may include entity relation, dataflow, and other
diagrams.
Design Tools
You should have tools to design your database, menus, panels, and reports;
for example, the CA 2E application generator and/or the CA 2E Toolkit utility
design aids.
The CA 2E Toolkit utility design aids include interactive aids for specifying
panel and report layouts, and for creating menus.
For more information on using the CA 2E Toolkit utilities, refer to the Toolkit
Reference Guide. For more information on an overview of the CA 2E Toolkit
utilities, refer to the Toolkit Concepts Guide.
For more information, refer to the Prototyping section in the Toolkit Concepts
Guide.
IBM’s Common User Access (CUA) sets out detailed rules for the appearance
and behavior of user interfaces both for programmable and non-programmable
terminals (NPT). The following sections summarize some of the design
principles behind CUA, as well as some specific rules for applying the principles
to NPTs on iSeries.
Ease of Use
Choose objects that are intuitive to the user. This requires that you base
the design on conceptual entities, which are familiar to the user.
Choose operations on the objects that are intuitive. For example, use
create, change, delete, and work with. Use simple standard metaphors
wherever possible.
Allow backing out. It should be possible for the user to explore the system
without serious consequences.
Avoid modes.
Interface Consistency
Note: Software productivity tools can play an important part in the successful
implementation of consistent interface standards by suggesting, supplying,
and even requiring, standardized design defaults.
The CUA elements of IBM’s SAA includes standards for the following aspects of
interface behavior. You should strive for consistency with these:
panel management
activity management
keyboard layout and usage
panel (display) interaction
selection action
Transfer of Learning
Try to choose operations that have intuitive metaphors. Most operations can
be presented in terms of a relatively small number of primitive operations, for
example, creating, changing, deleting, moving, merging, and splitting, which
are intuitive to a user.
Modal Behavior
Users often need to switch between tasks. You should try to avoid constraining
what a user can do next at any point. In particular, avoid ‘modes’. A program
exhibits modal behavior if it restricts the user to a limited range of responses
determined by what has taken place previously. A mode requires the user to
carry out particular actions in steps to exit from the mode. Although it is
almost impossible to avoid modes on the iSeries because of the hierarchical
call-invocation model, you should still try to minimize their effect. Use flat
hierarchies, enable the command line, and allow backing out.
The easiest way to learn how a system works is to take the options and see
what happens: exploring is a far more natural learning mechanism than
abstract conceptualizing, (for example, reading the instructions first). To allow
the user to explore safely:
In general, all update processing should take place immediately after the point
of confirmation. There should not be intermediate displays from which the only
exit route is one that requires further updating of the database, as this
constitutes modal behavior. The commitment control facilities of OS/400 can
be useful when designing to allow backing out, as multiple updates can be
grouped to take place on an all or nothing basis. For example:
It is easier to recognize information than to recall it. For example, even though
you may not necessarily be able to recall a name on demand, you can still
recognize the name among related names. Wherever there is a choice of
values to be entered, you should provide inquiry functions to display a list of
the available options. The CL command prompter provides an example of a
program that includes an inquiry facility. Typically, F4 is used to provide an
inquiry capability.
The requirements of a frequent end user who uses a system are significantly
different from those of a first-time end user or of an occasional end user. The
expert will retain much more knowledge about how to use the system and will
want highly efficient paths through normal tasks. The new end user will
require more support. Therefore, you need to try to design systems to have
both a ‘fast path’ and a ‘slow path’. The slow path, typically involving menus
and inquiry facilities, should allow the end user to make use of inquiry facilities
to reassure himself that he is doing the right thing. The fast path system
should allow for as fast of a transition as possible, both through and between
transactions.
Contextual Information
It is difficult to keep your attention focused for long periods of time. When
using a complex system, end users may lose track of where they are,
especially if they suffer interruptions. You should provide information to
remind users where they are and what they are doing.
This should be standardized and in the same place (for example, titles and
instruction areas on a panel) so that it can be ignored unless needed. The
most useful information to establish a context for is generally information
about any immediately related entities; for instance, the customer for whom
an order is raised or the department to which an employee belongs. The
presence of such information makes it possible for the user to establish what
he is doing at a glance—especially when returning after an interruption.
Connections between panels should follow the structure of the data so as to
facilitate this.
Shipped Systems
Most people do not learn by studying abstract principles. Rather, they build up
their knowledge gradually. The idea of a shipped system can be used to make
learning to use a system easier. A shipped system provides a workable
environment and sensible defaults for control values, so that a new user can
immediately do useful work. OS/400 themselves provide good examples of
this—the shipped system contains subsystems and output queues, which are
ready for immediate use, but which may be subsequently modified if desired.
User interfaces for the native iSeries are made up of the following
components:
Display files—Display files are used to define the panels the user sees.
They should be specified as external files using DDS. When defining
display files, it is important to use a consistent layout, give standard
weightings to the display field attributes, and handle error reporting in a
consistent manner. On iSeries, control features of the programs driving
the display, such as command key usage, cursor movement, and
prompting for confirmation, should also be standardized to follow the SAA
CUA guidelines.
Help text—Help text is written using UIM help. Examples of how to do this
are given in the IBM publication, The Guide to Programming Application
Panel and Help Displays.
Print files—Print files should be specified as external files using DDS. The
important considerations are to use a consistent layout and to provide
reference information to indicate how, when, and by whom the report was
produced.
On iSeries, the standards set out by the IBM SAA Common User Interface
should be followed. These are described in the Guide to Programming
Application and Help Displays and are exemplified by the OS/400 system
displays.
You should regard panels as being composed, not of the low level elements
with which you define them (literal characters, fields, indicators), but rather of
higher-level logical components such as a title, a command key explanation
line, a subfile selector, and various fields, each with an accompanying piece of
text. This makes it possible to establish equivalence, and hence consistency,
between different panel types and even different types of workstation; for
example, between intelligent workstation products and dumb terminals.
The generalized SAA CUA standard for panel layout for both NPT and IWS
panels is as follows:
Key:
(1) On non-IWS, there is no border area.
(2) On non-IWS, the action bar corresponds to selection values.
(3) On non-IWS, the vertical Scroll Bar is implemented via +.
(S) = On IWS, this area displays the System Menu.
(M) = On IWS, this area is to maximize control.
(N) = On IWS, this area is to minimize control.
The panel body is made up of instruction areas, explaining how to use the
panel or data and fields. Each field may have a label and if appropriate, an
explanation of the allowed values.
The CUA panel layout standard can be interpreted either strictly, leaving off all
ancillary data such as date, time, or operator identification, or more leniently,
keeping the CUA components in the standard places, while adding in the extra
information.
The following shows the standard display features for iSeries Basic:
The following shows the standard display features for iSeries Extended:
Panel titles should use phrases of the form VERB/OBJECT whenever possible;
for instance, Edit Customer, Add Order, Deplete Stock.
Use a standard layout for the panel header and footer areas (lines 1, 2 and
23). The CA 2E Toolkit Edit Panel Design (YEDTPNL) command and the CA 2E
Edit Screen facility can automatically provide a standard default layout.
Use a standard flow of information and a standard layout for similar types of
panel.
Place dot leaders to connect field text with fields. On iSeries, these should be
double spaced and only end in a colon if the field is protected. Leave as much
space as possible to allow for expansion in translation. Align fields by using a
standard text length. For example:
For input fields, provide right-hand side text to explain the allowed values.
This should have the form, “general domain, valuen=explanation”. Indicate if a
selection is available. Place the default value first as shown in the following
image:
Use an indent of two spaces for subsidiary fields as shown in the following:
If the panel relates to other output, for example, a printed report, try and
design so that the layouts are the same or very similar. This gives the user the
effect of “what you see is what you get.”
For example:
You may also use F11 to condition the introduction of extra detail fields.
Help Help
When specifying selection options, you should consider several things. If there
is a selection option column, include a summary definition of the selection
values, on the line above the subfile column headings. Precede each
explanation with n=. Double-space the explanations without punctuation. If
there are more key explanations than will fit on the available space, use F24 to
display the extra values. Also, include a line above the definition line,
containing the prompt text, which is usually Type options, press Enter.
For example:
Select 1 X
Change 2 E
Copy, Hold 3 C
Delete 4 D
Display details 5 Z
Print, Release 6 P
Rename 7 R
Display attributes 8 Z
Change text 13 Z
Note: There are some inconsistencies in the way that line selection values are
used on iSeries. Where possible, use the values used by the nearest equivalent
system command.
Subfile Design
On subfiles, any column for selection values should be on the left hand
side of the display.
The CUA standard prescribes a limited number of types of basic panel design
for non-programmable terminals, and each one is appropriate for a particular
purpose.
Entry
List
Menu
Help
You should base all your panel designs on these SAA CUA Types. In certain
cases, SAA panel types can be combined to make a composite panel.
In practice on iSeries, the fundamental CUA panel types are commonly used in
a number of specific variants:
Single object
- ADDOBJ: Entry panel, allowing the identifier and data for a single item
to be added.
Repeated item
Menus
Single Object
ADDOBJ (Add object). Used to add details for a new object. The details may
run over several pages, with the rollup keys being used to scroll between
them. The following example illustrates an Add Object panel.
DSPOBJ (Display object). Used to display details for a given item. The details
may run over several pages, with the rollup keys being used to scroll between
them. The following example illustrates a Display Object panel.
CHGOBJ (Change object). Used to changed details for a given existing item.
The details may run over several pages, with the rollup keys being used to
scroll between them. The following example illustrates a Change Object panel.
WRKOBJ (Work with). Used to work with items of a given type. Usually Change
(Opt=2, shows a CHGOBJ) and Delete (Opt=4) are allowed as options. F6 can
be used to add (shows an ADDOBJ for the item type). Rename (Opt=7, Shows
the RNMOBJ panel) may also be enabled. The following example illustrates a
Work with panel.
WRKOBJTOP (Work with Object, top entry allowed). Allows you to work with
items of a given type. New items may be added using an entry line at the top
of the column (using Opt=1). Change (Opt=2, shows a CHGOBJ) and Delete
(Opt=4) are allowed as options. Rename (Opt=7) will usually be enabled. The
following example illustrates a Work with Top panel.
Use a standard flow of information and a standard layout for similar types
of reports.
Group related fields together. For instance, place Customer code with
Customer name and Customer commencement date.
Where descriptive text and field are on the same line, use a dot trailer and
place a colon between the text and the field that it describes. Leave
adequate space for translation. For example:
Design to minimize the number of print lines and carriage returns, but
avoid “two up” reports if possible, as they require extra programming. For
example:
It may be useful to show the name of the main file and library used to produce
the report—the name of the library in particular can be useful during testing. If
it is a multi-member file, the member name may also be useful. The names
can be obtained from the file information data structure.
For example:
A large application system will allow the user to perform many different
functions. The user must choose from a large number of options. It is
important to use the computer to organize and arrange the objects of the
application system so that they are easy to find and to understand. Menus
provide a convenient means of doing so.
Provides a syntax free route for users who are not familiar with command
languages.
Note: Even tasks that are not normally menu-driven may be grouped into a
menu, for one or more of the above reasons.
Appearance of Menus
Your application menus should follow the OS/400 user interface standards for
menus, as seen on the OS/400 system displays.
Task menus. These menus show the tasks relating to a single subject; for
example configuration. A command line is optional.
Arranging Menus
The OS/400 and the CA 2E system menus provide examples of alternate menu
arrangements.
Menus should not contain additional input-capable fields apart from the option
input or command line.
Order of options
On task menus, options should be placed on menus in the order in which they
are likely to be used. In particular, place options to manipulate an entity in a
sequence that follows the life cycle of the entity. For example, of the following
two possible arrangements, the second is better than the first:
Menu Names
Menu names are likely to be used by the end user, so they should be designed
to be as meaningful as possible. You need to ensure however, that the names
do not coincide with those of OS/400 system menus, so we recommend that
you use a single-level prefix.
Names for command group menus should have the form: application prefix +
CMD + mnemonic; for example, YCMDDSP for a menu of all display (DSP)
commands.
Menus can be created with the CA 2E Toolkit Work with Menu (YWRKMNU)
utility. The menu utilities provide a standard layout.
It is important to provide Help text for all panels, menus, and commands of an
application in order to make the applications easy to use.
Use a standardized structure that can be related to the panel that it explains.
Follow the OS/400 standards.
Use simple language. Avoid jargon, and explain what the panel and its fields
are for, rather than how the program internals work. Make sure that
terminology on panels matches with that in the Help text.
Use boldface type for headings and allowed values. Use underline for default
values and for hypertext links (automatic) extended headings. UIM will do this
automatically if you use the correct tags. Do not make an excessive use of
emphasis, as it is distracting to the reader.
Help text should be created and edited, using the UIM help manager. As well
as being consistent with OS/400 System panels, UIM allows windowing,
hypertext links, a layered interface, search indexes, and is also fast.
OS/400 UIS conventions for Help text should be followed. These are specified
in the OS/400 Guide to Programming Application and Help Displays. As well as
overall rules, there are specific additional conventions for commands, menus,
and interactive panels.
Help text should have different entry points—panel level, area level and field
level. It should be possible to navigate between different entries regardless of
entry point. The UIM help manager will provide this function automatically.
1. Function: A synopsis of the purpose the program; for example, what the
program does for the user, or for the application system. This may contain
hypertext links to related objects.
Help text should be provided for each command. The help text should follow
the UIS standards used on system panels and should contain:
1. Function: A synopsis of the purpose the command; for example, what the
program does for the user, or for the application system. This may contain
hypertext links to related objects.
Help text should be provided for each menu. The Help text should follow the
UIS standards used on system menus and should contain:
2. How to use the menu: A standard paragraph on how to use a menu should
be provided
Search Indexes
Help panels assist users who already know how and why to start a command
or program. Search indexes provide users with a way of finding out how to do
something in the first place. You should provide a search index for your
application, which should include
an entry on how to use the search index itself. You can reference the help
group of the system menu
Most user application systems will be menu driven. However, you should
consider providing commands to invoke the main programs in a system, for
example those programs that are called as menu options. There are several
reasons for this:
Using commands can simplify and standardize design, and also reduce the
amount of HLL programming required. The command definition language
should be regarded as a specialized HLL in its own right that is specially
suited to both validating input data and translating external values into
internal values.
– It is unambiguous.
– Help text, prompt overrides, Prompt control, and dynamic choice text
can provide further guidance.
Commands, being the entry points to using the particular functions, are
convenient objects on which to implement security, for example to grant
or revoke object authorities.
Commands can be used to set the product library, for example to find the
appropriate National languages version.
Note: The standards that should be applied to the design of commands are
described below.
Naming Conventions
For example:
Object Internal
CRT ADD
DLT RMV
CHG EDT
DUP CPY
Design Standards
Choosing Parameters
Use existing OS/400 syntax order whenever possible. For example, — LIB/FILE
MBR
JOBNBR/USER/JOB
Place the parameters that are needed to identify the object or entity operated
on by the command before any other parameters. For example, - EDTSRC
FILE(X) OPTION(3).
Place the parameters that are most likely to be changed before the parameters
that are unlikely to be changed; optimize for frequency of use. On iSeries, you
should use the PMTCTL(*PMTCTL) keyword to hide ancillary parameters from
the initial prompt displays—such additional parameters will automatically
appear after the main parameters, if displayed by pressing F10. For example:
Place any required, for example, mandatory (MIN(0)) parameters, before any
non-required parameters. Do not use the reordering facility of the command
definition language to place required parameters after non-required
parameters.
Special values for command parameters should always begin with an asterisk,
for instance *ALL, *LIST, *NONE, *YES, *NO. A special value indicates a
function or default action. Explicit values should not begin with an asterisk, for
instance the default name of a file that is to be used, such as QTXTSRC.
If a special value other than *ALL is used for the first element of a qualified
name representing a library/object reference, then it should be a single value.
For example, REFOBJ(*PGM), not PGM(*LIBL/*PGM).
Specify the most important values first so that they appear first in the CHOICE
text that appears on the right-hand side of iSeries commands. Specify the
default value first.
Do not use *N as a special value, as it is reserved as the Null value for the CL
command parser.
Where two values are opposites appearing in a list, use *NO as a prefix for the
antonym. For example, *SRC/*NOSRC, *SECLVL/ *NOSECLVL.
FILE(file-name) MBR(*FILE)
JOBD(job-description-name) OUTQ(*JOBD)
If the values allowed for a parameter are conditional on the value entered for
another parameter, you should use the CL ‘Dependent Definition’ (DEP)
statement to cross-check the values. On iSeries, you can use the PMTCTL
keyword to direct the prompting of the second parameter.
Prompt text for iSeries command titles should be in lower case but with initial
letters capitalized.
Prompt text for iSeries command parameters should use lower case and not
end with a colon (the compiler will automatically add trailing dots). The initial
letter should be capitalized.
The prompts for objects should not have the word ‘name’ appended. For
example, it would appear as ‘Program’, not ‘Program name’.
Commands that are to be run in batch should not have optional parameters
that will invoke functions requiring interactive intervention; if a command can
be used in batch, it should be usable in all circumstances.
This section provides some guidelines for designing databases for iSeries,
including recommendations for data modeling and normalization.
Design Goals
Efficient: The access times to retrieve or process data should meet the
business requirements. Some consideration of the processes that will
operate upon the database is necessary to check that this aim is satisfied.
For instance:
The join facilities of the OS/400 database are limited—they are read only,
and limited to an equi-join. If fields from the secondary join file are used
as keys (for instance with the OS/400 Open query file (OPNQRYF))
command, then true concurrency is not maintained.
In the native interface, there are only limited facilities for manipulating
sets of data within the database, and these are not presented explicitly in
terms of the operations of the relational calculus (Union, Intersection,
Subtraction, Addition, Select, Project, and Join) acting upon sets.
A join can be specified in DDS (but is early binding). Fields from the secondary
join file may not be used as key fields. The HLL read equal statement (for
instance RPG III ‘READE’,) gives what is in essence access to a set of data.
Set level operations are of significance in that they provide a greater level of
economy in specifying programs—in relational languages such as SQL, a single
statement may often serve to specify what would be in most HLL’s be a ‘Do
loop’ containing many lines of code.
There is not a full capability for field level security. It is possible however,
to build logical views containing only a subset of the fields in the file and to
restrict authority differently to different views.
There are only limited capabilities for specifying rules for preserving the
integrity of the database. Any further rules have to be incorporated
explicitly in HLL code. For instance:
– to test that foreign keys (that is, non-key fields on a file which are
themselves the keys of other files) match prime key values
There is not proper support for a null value. This is significant because in a
truly relational database, primary keys must not be null (“Entity integrity
must be preserved”).
In device file DDS, a blank value cannot be distinguished from a null value.
Data Modeling
Note: A full discussion of how to turn a business model into a data model, or a
data model into a database design, is beyond the scope of these standards.
There are, however, various points about the database of iSeries that analysts
new to the machine may find useful, and also a few guidelines that
programmers new to analysis may find helpful.
The following are usually critical questions to decide when data modeling is
important:
How is this item identified on the computer? What is the prime key of the
database file that represents the item? In particular:
– Is it unique?
Every file should be regarded as having at least one set of unique keys. For
reference or master files (for instance a ‘Customer’ file, a ‘Product’ file), the
unique key will usually be obvious. For transaction detail files (for example,
Invoice details) it may not be strictly necessary to have a unique transaction
key. It may be sufficient to have the records kept in arrival sequence, within
major keys (for example, Invoice number). However, if you do this, it is more
difficult to access a detail line by itself.
Normalization
There are in fact several different normal forms, each representing a stage of
increasing rigor. Each successive stage encompasses the previous stage, thus
‘Third normal form’ includes ‘Second normal form’, which in turn, includes
‘First normal form’.
– mutually independent of the other non-key fields (it can, for instance,
be updated independently of the other non-key fields)
Even if you do not have a data modeling tool, it is beneficial to use data
modeling techniques, and in particular, to design in terms of a logical schema
that represents the overall structure of your organization’s data. The logical
schema can then be translated into a physical schema that gives an efficient
implementation.
You will usually find that the user has a very good intuitive feel for the
data that he handles. Ask for a critique of a non-technical presentation of
your data model.
Never allow programming to proceed until you are entirely satisfied with
your data model. The accuracy of the data model in its relation to the
business is by far the most important feature of a design.
Design strictly in terms of externally defined files; field offsets must not be
conditional. Do not specify that a field is to represent one data item in some
circumstances and a totally different data item in other circumstances.
Instead, introduce a separate field.
Avoid repeating groups of items within a record. For instance, ‘Order quantity
1’, ‘Order quantity 2’ ‘Order quantity 3’. In a database of fixed length records
like that of iSeries, unnormalized data of any repeating group imposes a
limitation on the number of groups allowed. It also requires more complicated
programming.
Do not concern yourself with design detail, in particular, field attributes such
as lengths, edit codes, and allowed values, until you have established what the
contents of your data model should be. Then, create a field reference file (FRF)
entry for each field description, and refer every occurrence of the field to the
FRF entry. For example, the FRF will contain a definition for Customer number,
to which Customer numbers in the Sales order, Sales ledger, and Sales
analysis files will refer. Every different type of date should have its own FRF
entry: Date of birth, Expiry date, Order date. One of them may one day need
to be changed to a different format. Define total and accumulator fields as
having the base field length + n digits.
Place key fields before other fields in the file. Place major keys (for example,
keys fields which are also the keys of other files) before minor keys.
Place other fields on the file in the order in which they generally appear on
input and output displays. This makes the use of software tools that create
device file layouts directly from the database file (such as Query) easier.
Even if all the values for a code will be numeric, define the code field as being
character rather than numeric. It will then be possible to introduce character
codes at a later date if the numeric code values have all been employed. It will
be also easier to program an enquiry function to display the allowed values for
the field because a ‘?’ may be entered directly into the code field—OS/400
does not permit the entry of a ‘?’ into numeric fields.
Avoid the use of zoned numeric fields. The native storage format for numeric
fields on iSeries is packed, so it is more efficient to pack numeric fields.
Packed fields should be defined with an odd number of digits, even if this
makes the field a digit larger than is actually required. This is because:
Note: Blank or zero values should not generally be allowed for prime keys,
since they represent a null value. If they are required, try to assign some
other value to represent a null value. For instance ‘-99999’ for a numeric field,
‘*NONE’ for an alphanumeric field.
Reference data files contain system reference tables and codes, for example, a
customer file, VAT code file, or address file. The files are relatively small; their
contents are relatively constant over time (they are “non-volatile”), and many
programs usually refer to the files in the system.
Do not mix reference and transaction summary data in the same file. The two
types of data have different activity levels. Except when actually being
maintained, usage of reference files should be “read only”.
Transaction files contain the main system data. They are generally large, and
have a high turnover. They may well require frequent archiving.
Certain reference data will attach to each transaction. Consider whether the
historic or the current view, or both, is relevant in subsequent interrogation.
For example, does the sales manager need sales reported by the customer’s
representative at the time of the sale, or by the customer’s current
representative? In the former case, the representative must attach to the
transaction; in the latter case, it should not.
Consider the latency of the data. A sales invoice record is current only so long
as it is outstanding, however, the same data may be required for sales
analysis over a much wider time span. The same data thus services two
different information needs.
Try to design summary files so that they can be rebuilt from the transaction
files in the event of an error or a crash.
Archive Files
Archive files are used to hold obsolete data, usually from the transaction files,
but sometimes from the reference files as well.
Wherever possible, archive files should use the same format as current
transaction files. Interrogation programs may then use either.
Work Files
Decide whether the work file will be required just for the job in hand (for
example, for a print program), or whether it must exist from job to job (for
example, a batch entry work file). In the first case, it will probably be best to
create a copy of the file in QTEMP, while in the latter case, it would be better
to use a work member within a permanent file.
Consider the recovery and cleanup implications. Can the work file be thrown
away or not?
Work files can be useful for reducing the number of database accesses
required to interrogate the database, especially where data is to be selected
on one access key but ordered on another. The method is not so much to use
them as sort files, but rather to provide project and/or join operations that
simplify programming. Records can be extracted from the database using the
most efficient existing logical view (the OS/400 Copy file (CPYF) command is
often sufficient to make the extraction). A logical file may then be built upon
the extracted data, and the data presented, using a simple report program.
Access Paths
For example, if you have a stock code field made up of three parts,
prefix/stem/suffix (ZXXXYYYY), and you know that you will require the
enquiries of all items with a given prefix, or suffix range, define the field as
three parts.
Do not add unnecessary key fields to the logical view, as the number of
key fields determines the size of the logical view.
Numeric sub-fields that are to be concatenated back into a single key field
(for example, possibly YY, MM, DD), should be defined as zoned.
For a given file, the number of useful ways of selecting or omitting the data is
usually far greater than the number of useful ways of ordering the data. For
this reason, it is often a good idea to leave the selection to the programs that
read the file, or to use a ‘dynamic’ access path—rather than building it into the
access path permanently (‘static’ selection). This is particularly true when the
‘cardinality’ of each key set (for example, number of records with the same
key, or partial key, that have to be read), is small.
OS/400 will automatically share the access paths of files which have the
same keys. If you are specifying select or omit criteria using the database
facilities, consider using ‘dynamic’ rather than ‘static’ selection, so as to
allow sharing of access paths.
Design Goals
You should try to design your programs so that they satisfy the following
overall design goals.
Program Types
You should try to design your application using standard types, in as ‘pure’ or
unmodified of a form as possible.
The data structures upon which standard programs on iSeries are most
commonly based are either those of iSeries database from which the programs
obtain data, or of the CUA panel types which the programs use to present the
data to the user. In many cases, both are relevant. In the commonly required
cases, the data structure is either a record, a repeating group of records, or a
combination of the two.
Modularization should serve to hide most of the internals of the module. The
interface to each module should explicitly reference all the information
required to use the module, and be the only way of invoking the module.
Coupling
Degrees of Coupling
Cohesion
Degrees of Coupling
Program Modularization
Do not attempt too much in one program. A rule of thumb for RPG III
programs is that programs start becoming unwieldy at 1,200 lines, are
quite large enough at 1,500, and are getting unmanageable at 1,700 lines.
At 2,000 lines, they are epic. (Ideally RPG III programs should be less
than 700 lines).
Remember that RPG III and COBOL programs cannot be called recursively; for
example, twice in the same invocation stack for a job. This puts limitations on
how programs can be linked together. For example, if a maintenance program
ca CAll an inquiry program, and the inquiry program ca CAll the maintenance
program, the situation might arise whereby a recursive call is attempted.
Error Recovery
When designing an application, you should consider what would happen when
an error occurs, both normally (data validation error), and abnormally (system
crash).
The following are some principles that can be applied when designing for error
recovery. Refer to the section on ‘System Recovery’ for a general discussion of
recovery considerations.
In the event of a crash, programs should always collapse to a safe point that is
one where no special corrective intervention will be required to synchronize
the database. Commit control can be used to ensure that this happens, even
on transactions involving many updates to the database.
Decide what the recovery unit will be should a crash occur. A critical
consideration is usually whether the whole file can be regarded as recoverable
as a single unit or not; this is normally equivalent to considering whether
many users will be using the file at the same time.
If the file may be regarded as a single recovery unit; for example, during its
use for update by a batch process, the whole file may be restored from a
backup copy, taken at the start of the process.
If the whole file cannot be restored, say because of locks likely to be held by
other users, (for instance as when one of several interactive programs using a
file fails), the recovery unit cannot be the whole file. Journaling can be used to
select a recovery unit within a file—recovery units can range from the whole
job down to an individual access to the database. Commit control can be used
to group individual database accesses into functionally useful recovery units
(for example, a whole batch of transactions).
Make programs restartable. Programs should be written so that when they are
rerun after a crash, they pick up where they left off, and resume processing.
Error Handling
Good error handling design should serve to contain the damage from errors.
Errors should be brought to the operator’s attention, but the system should
retain its integrity, and, if possible, continue.
In general, you should aim for defense in depth. Assume things will go wrong
at every level.
Application generated (for example, “record not found”), since you create
the messages you are handling them by definition.
One of the main differences between the design requirements of batch and
interactive programs lies in the error handling.
For batch programs, error handling is more complicated. You must allow for
errors of varying levels of severity, ranging from terminal errors, which require
immediate and complete abortion of the process, to warning errors, which
require the program to take default action in order to be able to continue
unattended. In any case, the operator needs to be alerted as to the potential
problems. You should also consider whether, if a fatal error occurs, subsequent
jobs should be allowed to continue.
OS/400 error handling imposes a certain overhead. You should code so that
exception handling is invoked on the least used path. For example, say that
you are adding/updating records on a file. If the record will not normally
already exist on file, you should attempt to add the record, and monitor for an
exception, in which case, you will chain and update the record, rather than
vice versa.
Record Locking
Always make allowance for the possibility of records being inaccessible due to
locks by another job. In RPG III, this should normally consist of testing the
result indicator (col 56-57) on file access operations. The appropriate action to
take will depend upon the context.
For multiple record updates in interactive programs, and all batch updates,
you will either need to rollback and report a ‘record in use’ error message, or
carry out whatever partial update is still feasible. In the latter case, you must
be able to report back what has, and what has not, been updated.
Note that file design may be used to reduce multiple record updates to what
are effectively single record updates. Potential lock situations can usually be
designed out of an application. For instance, if an invoice maintenance
program requires a lock on the invoice header before it will allow editing of
invoice details, it will probably not be necessary to check for locks on the
invoice detail records.
There are two basic strategies that can be adopted with regard to the locking
of data records:
Subfile Processing
Subfiles should not load more records than they need, as to do so is slow and
consumes storage. Use program controlled roll up. Each consecutive page of
the subfile should only be loaded when the ROLLUP key is pressed (this
requires allocation of an indicator to the subfile rollup key). An exception to
this rule may occur when control totals for the subfile contents need to be
calculated or checked, so all the records must be read in any case.
For more information, refer to the section, Design Standards for Display Files.
1. To load the subfile, use an input-only logical view of the database file to
read the records in the desired order, a subfile page full at a time.
2. Store the relative record numbers of the database records as hidden fields
on each subfile record.
The journal will contain a record of every update made to every file being
journaled. This record is an ideal source for any sort of audit trail report, for
instance file maintenance reports. Such reports can be run retrospectively for
any span of time, provided that the journal receivers are on-line. Any of the
selection criteria of the OS/400 Display Journal (DSPJRN) command, such as
user or job name, starting dates or ending dates, can be used to specify which
entries or range of entries are to be listed.
The journal can be used to trace the cause of anomalies in the database. Most
notably, the updates made to the database by a particular program can be
examined in detail, or the program responsible for a particular update can be
discovered.
Choice of Language
Productivity: This will depend upon the ease of use and the power of the
language, and the familiarity of the developer with the language.
Reliability: The ease of use of a language will affect the quality and
correctness of the implementation.
Apart from the availability of staff with the appropriate language skills, there
are several criteria for assessing an HLL:
For example, RPG, because of its fixed format and limited data types, is
particularly poor.
RPG is strong; COBOL and PL/1 are almost as good. C is at present particularly
weak because of the additional overhead of the runtime environment. REXX,
an alternative to C, is interpreted and so also quite slow.
CL—CL is the best OS/400 language for simple access to system facilities,
such as authority checking and message handling. CL cannot handle database
updates or complex display file handling. It has poor control structures (no
subroutines, no DO WHILE construct) and limited data types—binary is not
supported. It can be used recursively and has good string handling.
RPG III—RPG III is compact, efficiently implemented, and good for batch
processing and display file handling because it has good I/O facilities. It has
poor structural capabilities. It is difficult to write well modularized RPG III
programs because there is no ‘privacy’; all variables are global, and subroutine
variables are not explicit. The variable naming capabilities are very restrictive.
The fixed format reduces expressiveness. Recursion is not allowed and the
data structures (for example, arrays) supported are limited.
COBOL—COBOL ‘85 has more modern control structures than COBOL ‘74, but
there are still some significant shortcomings on the iSeries implementation. It
is free format and therefore, quite expressive. It has reasonable I/O facilities.
It is not extendable and has poor exception handling. There is no recursion, no
ADTs, and limited typing.
PL/1—Of the iSeries languages, PL/1 has the widest range of cated
capabilities. It allows a block structure, recursion, and is rich in its data types.
It has good I/O, including some special features, good string handling, and
good expressiveness. It is also extendable through functions and has good
exception handling—though access to system data is not always as good as
RPG III. It has limited typing and is complex.
C—Of the iSeries languages, C has the most powerful low-level capabilities.
System/C can be used to access system function not available in other
languages. Like PL/1, it allows a block structure, recursion, and is rich in its
data types. It tends to be cryptic. It is also extendable through functions and
has good exception handling.
For more information on guidelines for using national language versions, refer
to the IBM National Language Information and Design Guide, Volume 1.
For information on specific advice for iSeries efer to the iSeries (AS/400)
National Language Support Planning Guide, Volume 2.
General Principles
Ideally, you should be able to use just one set of HLL source, in conjunction
with different sets of national language-specific text objects, to build different
national language versions of the software.
IBM uses the term enabled to describe an application product that has been
designed with translation in mind, even though it may not initially be
translated. An enabled product (for example, OS/400) can then be
implemented in any particular language easily, usually without a coding
change. An application that is not enabled will require a retrofit in order to
obtain a national language version.
MRI Translation
Translate End User Text: Only the text visible to the end user is
translated— device file output, messages, and Help text. This is the
normal requirement. If, however, the user will be using interrogation tools
such as Query, you should also translate the field text on database files.
Total translation: You translate all the descriptive text for entities along
with source comments and system documentation. It is seldom
commercially attractive to do this.
Translation Levels
There are three levels at which you need to consider the implications of a
national language—the physical, the syntactic and the semantic.
Physical
At the Physical level are the purely mechanical factors needed to support
specific languages—different character sets, multilingual keyboards, and
storage codes. Generally, iSeries applications are insulated from direct
consideration of these factors by the capabilities of the hardware and the
operating system. For instance, device configuration takes care of the
keyboard mapping, and various extended character sets are available for the
different national alphabets.
It may simplify design if the restrictions of different keyboards are taken into
account. For instance, avoid the use of characters which are present in English
but which are not common to all character sets (‘ ‘, @, # ), because on some
keyboards, they can only be keyed as hexadecimal values. There are also
considerations to be taken into account if you need to input or display data
input in one character set at a device that uses another national character set,
and if you collate extended character sets.
For more information, see the discussion of the CHRID and ALTSEQ keywords
in the OS/400 manuals.
Syntactic
At the Syntactic level, you have all the cosmetic aspects of an application that
require conversion for a different NLS version. This includes the main task of
translation—providing appropriate versions of text literals in the target NLS.
Text can be classified as syntactic rather than semantic as it is not
‘meaningful’. From the point of view of application design, a literal is simply a
label, albeit one which must follow the rules for its given language.
On iSeries, there are a number of specific software facilities that make the
translation of text easier, such as externally-described messages. It addition
to the mechanisms to facilitate text translation, there is also operating system
support for variable properties such as currency symbols, decimal point
characters, and date formats. You should design your applications to use these
facilities wherever appropriate. You should also design to parameterize those
cosmetic aspects not covered by the standard mechanisms. For instance, the
values a user enters to indicate ‘Yes’ or ‘No’ tend to be language dependent.
One of the many reasons for following the SAA CUA standards for application
user interfaces is that the standards are to some extent language
independent; for instance, they advocate the use of numbers to select items
(4= Delete), and have been devised with the possibility of a translation
requirement in mind.
Semantic
At the Semantic level, you have those aspects of application design that
contain cultural or linguistic dependency which varies by language; you must
either parameterize these, or compartmentalize them into replaceable
language-specific modules.
Any form of string processing tends to have cultural assumptions in it; for
instance, extracting a zip code from an address line (and zip codes
themselves). Implicit assumptions are also often made in the use of different
units of measurement and conversion factors, currencies in particular—not just
in the symbols, but also in the precision of the units. For example, useful
amounts of lira and yen have too many zeros for a 15-digit RPG III numeric
field, and they may need to be stored in a truncated format. Calculations
dependent on human law rather than natural law, for instance tax, are also
highly specific to particular countries. Certain applications tend to be so culture
specific, for example payroll tax or accounting rules, that it is almost
impossible to “internationalize” them without coding entirely separate
modules.
There are also national differences in the rounding method used; in the
convention for showing a negative amount (‘-’, ‘CR’), and in the symbol used
for a percentage (‘%’ or ‘pct’).
National languages can be classified into three main groups according to the
type of representation needed to store the characters on a computer.
These are languages that can be represented with a simple, single byte
character set (SBCS). For example, the letter ‘A’ can be stored as hex ‘C1’; ‘B’
can be stored as hex ‘C2’. The group can be subdivided into those languages
which use a Latin alphabet or an extension of it (for example, English, French,
German, Italian, Swedish) and those languages which use a non-Latin
character set (for example, Greek, Russian, Thai) but which still use a small
alphabet in a straightforward way. In both cases, characters are always
processed Left to Right (LTR) and there are no significant differences from
English in how characters are processed in general. When you translate into
these languages, you need only the alternative character sets that the
hardware provides.
These are languages which can also be represented with a simple SBCS but for
which the general direction of text is right to left, for example, Hebrew or
Arabic. Numbers and Latin character phrases are still written from left to right
in such languages, so rather than being simply Right to Left, the languages are
bidirectional. Designing for bidirectional languages introduces some additional
considerations that will be discussed later. Incidentally, many of the Arabic
languages have a further complication still—different forms of the letter are
used according to the relative position of the letter in a word. As a concept,
this is just like the use of ‘f’ for ‘s’ in certain circumstances in old-fashioned
English usage.
Ideographic languages:
When designing displays and designs, you should leave as much space as
possible to allow for translated versions of text, which may be longer than the
English versions.
But rather:
Pad out column heading literals to take up all the available space.
Pad out panel and report titles with blanks up to a standard length.
But rather:
Place the base language version of the literal in the source as a TEXT.
The fundamental principle for handling MRI is that all text literals should be
isolated from the HLL code for the application, whether for a program (RPG III,
CL, COBOL, PL/1, C) or a device file (DSPF, PRTF) or a command (CMD). Some
specific programming requirements are given later on. There are several sorts
of text that may need translating:
Device file constant text. The DDS MSGCON and MSGID keywords allow
the use of external message descriptions. In effect, MSGCOn is early
binding; MSGID is late binding. MSGID is preferred for panels as it gives
greater flexibility, but is not supported for print device files. (You may
emulate MSGID for print files by defining fields and using a CL program
with the OS/400 Retrieve message description (RTVMSGD) command—or
the V2R2 OS/400 QMHRTVM API—to retrieve the text within the program).
Execution message text. This text will vary at runtime, and so should be
“late binding”. All such messages should be placed in a message file and
retrieved as required by a standard CL message-sending program, or from
V2R2, an OS/400 message handling API QMHSNDPM.
– Text in database file fields. Certain text items will probably be held in
the form of database field values in database files, for instance code
descriptions. If such items need translation, conversion utilities will be
needed to retain translations through version upgrades.
Help text. UIM Help text is compiled. Separate source is required for each
national language. You should use message descriptions with the text for
headings and standard terms to ensure consistency and fast translation.
Since help text is created automatically for programs generated with the CA 2E
application generator, translating the application model and skeleton help text
and regenerating is sufficient to translate end-user help text.
Menu text. On iSeries, menus are normally display files and can be treated
as normal device files for the purposes of translation.
a message file containing prompt text used for compiling device files and
commands
a set of device printer files, compiled with the appropriate prompt message
file
a set of Help panel group objects compiled with the appropriate prompt
message file
OS/400 has several system values available, which can be used to help with
internationalization. Store date fields on file in YMD format and convert them
to local display format at execution, using the OS/400 QDATFMT and the
QDATSEP system values.
For more information on date handling, see the chapter, “General Coding
Standards.”
You should normally use the system edit codes to edit monetary amounts so
that the currency symbol shown is that specified by the OS/400 QCURSYM
system value. If you carry out your own editing (for instance, to cater for
variable decimal place fields), then you should retrieve the currency symbol
from the QCURSYM system value.
Use the system edit codes to edit numeric fields so that the decimal point
symbol shown is that specified by the OS/400 QDECFMT system value. If you
carry out your own editing (for instance, to cater for variable decimal place
fields), you should retrieve the decimal point symbol from the QDECFMT
system value.
Use the QIGC system value to condition any special processing required if
ideographic support is present. Equally, it can be used to condition special
processing only available if ideographic support is not present. For example,
there is no support for the DUP key on ideographic workstations.
Note: For more information, refer to the information on the QCHRID OS/400
system value for further details.
Tables can be especially effective when used in conjunction with the system
supplied QDCXLATE program, which can be used to translate any character
string, using a specified table.
Do not use compile time arrays to hold messages. If for performance reasons
you need to hold messages in core storage (for example, because you send
them many thousands of times in the course of a typical run), then you should
load the messages from an external source at the beginning of the run.
There are considerable variations in the standard paper sizes used in different
countries. Never hard code the forms length or overflow attributes of a printer
file in RPG III programs. Instead, use the values stored as the print file
attributes. If necessary, these can be retrieved at runtime from a file
information data structure.
For example:
Avoid abbreviations. For example, do not use Cust nm for customer name.
Abbreviations generally do not appear in a dictionary and are hard for a
non-native speaker to decipher. Avoid telegraphic style as it is hard to
understand.
Avoid compound phrases. It can be very difficult to tell when the adjective
stops and the verb starts, especially for a non-native speaker. For
example, does Record error mean an error has occurred on a record (for
example, adjective+verb) or does it mean Log the error somewhere? (for
example, verb+noun). Likewise, would Program definition mean a
definition of a program or definition by a program? It is better to be as
explicit as possible even if it takes slightly more space.
Avoid negative questions. It is often not clear what the answer means or
even what the question is; for example, ‘Do you not want to delete QSYS?’
Avoid slang, jargon, idiom and humor. It may be hard for the translator to
find the terms in a dictionary, and the humor may be culture-specific.
Ideographic Support
For more information refer to the iSeries (AS/400) DDS Reference Guide.
It may be useful to know that the Japanese language has two separate
phonetic alphabets, the Katakana and the Hiragana, as well as a system of
ideographic characters, the Kanji. The Katakana alphabet is used for foreign
loan words, such as computer terms. Thus, XX (obu-je-to) is object, YY (jo-bu)
is job, etc. Hiragana is used for Japanese words; it is possible to spell out
every Kanji character in a Hiragana equivalent.
The system program QDCXLATE can be used in conjunction with the system-
supplied translation tables (QSYSTRNTBL for the basic set, QCASE256 for the
extended character set) to convert characters to their upper case equivalents.
There are some CA 2E utilities to assist with this, in particular a tool to convert
a database file data to upper case. The tool examines the database file object
definition to find out which fields are alphanumeric. It also reads through the
file, converting all such fields in all records to upper case (QCASE256 can be
used). The same utility can be used to convert source members.
DBCS Support
For example, normally a string of the four hexadecimal codes 93, FA, 96, and
7B would code for four separate characters l, v, o, and #, respectively.
Enclosed within the shift characters, they would be treated as two ideographic
characters:
An implication for your application design is that space must be left on device
files for the shift characters (one byte each), which must always be used in
pairs. Furthermore, not only do DBCS characters take more space to store, but
they are also physically larger on display; twice the size. However, since each
character represents a whole word, fewer of them are needed.
Although you may use DBCS characters within message text, you may not
directly add the message descriptions from the command entry program. The
commands to add or change the message text should be placed in a CL
member and compiled into a program. SEU provides support for IGC
characters.
Data areas containing ideographic data cannot be displayed using the OS/400
Display Data area (DSPDTAARA) command.
Ideographic Shifts
It is not possible to edit or compile DDS with IGC shifts (E, J, O) or IGC
keywords (for example, IGCCNV) on a non-IGC machine. However, a special
keyboard shift is available on non-IGC machines - ‘W’ - which is equivalent to
the ‘O’ shift, i.e. it specifies that on an IGC machine, both alphanumeric and
Kanji input will be allowed for the field. Certain DDS keywords cannot be used
in conjunction with ideographic fields, notably COLOR and LOWER.
On non-IGC machines, you should use the ‘W’ shift for fields for which
ideographic characters will be allowed if the application is run on an IGC
machine.
The DUP key is not available for IGC shift fields or on Japanese keyboards.
Ideographic Conversion
Make this facility available on your displays by using the IGCCNV DDS file level
keyword. The command key used to produce the input-capable field should be
F18 on iSeries.
For example, the following DDS source would compile on a non-IGC machine,
but is marked up so that simply by flagging and unflagging the comments, it
would be appropriate for an IGC machine.
Those languages which are read generally right to left, such as Hebrew,
present some special problems that make it difficult to make one set of source
and one set of program objects suffice for all languages.
Use the DDS CHECK(RL) keyword to make the cursor move right to left within
a field. It also defaults the keyboard shift to the alternative (for example,
Hebrew) alphabet. Literals should appear on the right of the fields that they
describe. For a full conversion, you should reverse the whole display layout
and the overall cursor movement should be right to left and top to bottom—
the DDS file level keyword CHECK(RLTB) specifies this. You will also need to
position the cursor explicitly at the top right hand field of the panel when you
first display it.
Reversing the fields like this requires an alternative set of DDS source and
recompiling all programs which use the revised display files.
There are three different techniques you can use to overcome this:
1. Hold a second copy of the field on the record with the characters reversed
(requiring a modification to the database and all programs that change the
field’s values).
3. Store the field in proper RTL order, and use the DDS substring (SST)
keyword to reverse the order in the logical file.
Coding Principles
Source code should contain all the information necessary to re-create the
object. This should include information about compile time overrides and
object attributes.
Use the machine to find syntax errors and basic mistakes. The editors and
compilers of the iSeries give excellent diagnostics, and can be used to find
low-level syntax errors.
Keep in mind:
You can use the CA 2E Toolkit create source physical files (YCRTSRCPF)
command to create a set all of these files in a specified library, including
descriptive text.
The name of each source file member should always be the same as the
corresponding compiled object name. Thus, if a program’s name is FRED, the
source for the program should be in a member called FRED. This makes it easy
to find source and check to ensure the source has a matching object. If the
object is a copy of another object, for instance, a work file that is a duplicate
of a permanent database file, create a dummy source member with the
appropriate name that contains the instructions for creating the duplicate
object from the original object.
The CA 2E Toolkit Compile pre-processor will update member and object text
automatically from ‘Title’ source directives (T*) entered as comments in the
source. For more information, see the Toolkit Concepts Guide.
The text for database files should provide information about the access path.
An index of the available access paths can then be effectively obtained directly
from a listing of the object descriptions (using the OS/400 Display object
description (DSPOBJD) or Display library (DSPLIB) commands), from a listing
of the names of source members (made with the OS/400 Display file
descriptions (DSPFD) command with an option of TYPE (*MBRLIST), or using
the select facilities of SEU (EDTSRC/STRSEU)).
The text for execution objects, for example, programs and device files, should
contain the object name of the command by which the objects are invoked, if
any.
The standard banner MUST be used in all source types. The purpose of the
banner is to indicate the author and original development date of the source,
and the system to which it belongs. The banner, which should be entered as
comment lines flagged as Header (*H) source directives, can be automatically
extracted by the CA 2E Toolkit Document Program (YDOCPGM) command to
form part of the system documentation.
Standard banner for fixed format types (RPG III, DDS, COBOL):
All source should contain a copyright notice in the banner with the form (C)
COPYRIGHT 20xx ‘Company name’.
You can use the following techniques to ensure that a copyright notice is
present in the binary code of an object:
Do not leave obsolete source lines ‘commented out’; delete them. Where
you must leave an obsolete source line, use several asterisks to help
highlight the fact that it is a comment line: it is easy to fail to notice that
an executable source line has been made into a comment. For example, it
is easy not to notice that the Z-ADD statement in the following line has
been commented out:
Use section divider comments to mark off sections of source (see below).
A field reference file should be used, with all database field definitions
based on it.
If specified, the DDS REFFLD keyword should be on the same line as the
field name:
The text specified for the DDS COLHDG keyword should be in lower case, as it
is the origin of the field text seen on most documentation, and should
furthermore be broken up into component words, if possible.
There are a number of general principles to which HLL code should adhere,
regardless of the HLL used. Good code should be:
Clear: It should be obvious from the code what the code does.
Robust: You should avoid coding in limits (for instance array size). You
should anticipate possible errors and code for a graceful collapse.
The following general standards apply to coding source for all program types,
such as RPG III, CL, PL/I, and CBL.
Program Layout
1. Title
2. Banner
4. Mainline
5. Subroutines
6. Standard subroutines
The overall effect should be such that reading the comments should give an
overview of the program: structured English or pseudocode conventions may
be useful.
Code and document your programs so that they can be read top to bottom.
For instance, consider the following two ways of coding the same control
structure:
The second way of coding the structure should be easier to follow because the
test condition is at the beginning. This is especially true if there is a significant
amount of intervening code within the loop.
If a program is called from many different places, its entry parameters should
be documented within the program source by means of a dummy call. The
correct code needed to invoke the program can then be included in the source
of a calling program by means of the “browse-copy” facilities of SEU.
Specify the names of called programs with literals. This will give better
documentation. For example,
CALL PGM(‘XXUSX’)
and not:
CALL PGM(&PGM)
In RPG III:
In CL:
Note: Keep subroutines small (two to three pages at most). Avoid heavy
nesting (four or five layers at most). This can be done by introducing routines,
and/or using CASE constructs rather than nested IF THEN ELSES. Use spaces
to make code readable.
But rather:
3. Ensure that the database’s normal access path facilities can be used to
retrieve records containing date fields in historical order.
All dates should be stored on file in YMD format. In particular, the format
CYYMMDD is recommended, where C = zero for 20th century and one for
the 21st century. This may be held in packed format (P7.0) (or as YY +
MM + DD if read equal on year or month is required). Note that IBM use
the convention (where C is not specified) that when YY has a value
between 40 and 99, the year is between 1940 and 1999, while for YY
between 00 and 39, the year is between 2000 and 2039.
DDS—Do not qualify names that appear in DDS, for instance with the DDS
REF, PRINT, or MSGCON keywords. Do not even use *LIBL as the qualifier
value.
RPG III—There are no significant constraints on coding RPG III so that it can
be run on either machine. If you need to execute request strings dynamically,
use QCAEXEC (which is present on both machines) rather than QCMDEXC, the
iSeries native program.
Coding CL—You may use the presence or absence of the data area Q5728SS1
in QSYS to determine whether or not you are on iSeries (it only exists on
iSeries). The result can be used to condition subsequent processing.
Note: Each application system should have a single field reference file,
containing definitions for all the fields in all the database files.
The function of the data dictionary may be achieved effectively on the IBM i by
having a special physical file containing no data. Such a file is generally known
as a field reference file.
If you are using the CA 2E systematic convention, always call the file
ssFDRFP, where ss is the System prefix and contains a single format called
@FDRF$$.
The file should be structured into two parts: primary fields and secondary
fields. Refer to the appendix, "Programming and Coding Examples," for
examples.
Files of all types, device and database, should reference the field reference file
directly, not via another file. Logical files are an exception to this rule: they
always reference a physical file. This means that you can resolve all inquiries
about a field by looking directly in one place. It also simplifies the order in
which you need to recompile objects.
CA 2E Standard Method:
From the point of view of expressing design dependencies, the second method
is preferable. The first method is the recommended CA 2E standard for purely
pragmatic reasons.
A standard method should be used for organizing the field reference file for a
hand-coded application. The method provides a central dictionary of all fields
with as little effort as possible. The method suggests that you divide the field
reference file into two sections: a short primary section containing definitions
of field types (standard domains), followed by a larger secondary section,
which constitutes the main field dictionary. Both sections should be in
alphabetical order to facilitate inquiries and maintenance.
The primary reference field section should contain definitions for standard data
types used in the system; for example, dates, names, indicators, and standard
amount sizes.
Primary fields should not be referenced, except by secondary fields in the field
reference file; for example, system files should not refer to them directly.
The format identifier used for all primary fields should be ‘@@’.
Include a field for each of the dimensions used for system quantities; for
example, pounds sterling, tonnes weight, meters, and square meters.
The secondary field section should contain definitions of all fields in the system
database files.
When the field is of a standard type, for example, already defined as a primary
field, the field should be defined by reference to its primary field—that is to
say using REFFLD(*SRC). In such cases, only the column headings need to be
redefined.
Fields should only be defined with reference to a type field when there is a
genuine dependence. A simple test of this is to ask the question: If I were to
change the definition of the based-on field, would I want the definition of the
dependent field to change as well?
When appropriate (for example, for total fields) use relative lengths (+-)n to
increase or decrease field lengths with respect to the based-on field.
Each field should be fully defined with edit codes/words, text, ranges, values,
display attributes, etc. Use the DDS COLHDG keyword rather than the TEXT
keyword as it provides neater documentation.
The format identifier for all secondary reference fields should be ‘$$’. (This
may be controlled in CA 2E generated databases by the YFRFPFX model
value.)
Use level checking on files in order to detect errors arising from changes to the
database definition—for example, specify LVLCHK(*YES) on the OS/400 CRTPF
and CRTLF commands.
Create files that will continue to grow with SIZE(*NOMAX). Use the CA 2E
Toolkit Compile preprocessor to do this automatically every time you
recompile.
Format Level
The names of formats in logical files should be the same as for the format in
the underlying physical file, with the number of the particular logical view
appended, if necessary.
Field Level
Use the DDS COLHDG keyword to define the descriptions for all fields. Make
use of lower case. The descriptions you place on the field will be used in many
places; for example, DFUs, queries, and documentation, so it is worth making
them as “cosmetic” as possible.
Pack all numeric fields. The IBM midrange HLLs handle packed numeric fields
more efficiently than zoned numeric fields. Note, however, that you cannot use
the sub string function on packed numeric fields.
Make fields that hold text descriptions an even length, and specify a W shift.
This ensures they can be used for ideographic translations without the
truncation of ideographic shifts.
WW - Week # - Number
MM - Month KG - Kilograms
Day - DD M - Meters
Arrays
DDS does not provide support for arrays (for instance an OCCURS facility)
because the relational model upon which it is based does not allow arrays.
Even if you group fields into arrays within HLL programs, you should still
always define each element as a discrete database field, otherwise it cannot be
changed with DFU, or listed with Query. In other words, do not define an array
as a single field in the database and redefine it in a program.
Array fields should be given numbered names, for example PR01, PR02, PR03.
In the field dictionary, the definition of all elements should be based on that of
the first element by using the DDS REFFLD keyword.
You can generate standardized DDS for panels directly from an CA 2E Toolkit
utility panel design by using the CA 2E Toolkit OS/400 Create DDS from Panel
Designs (YCRTPNLDDS) command. CA 2E generates standardized DDS for
display files automatically.
File Level
Use the DDS CHGINPDFT keyword as a file level standard to set the
display default attributes.
Use the DDS INDTXT keyword to document special indicators. You should also
specify text for each command key and each DDS SETOF statement.
The alternative roll keys should be enabled so that scrolling can be done on
workstations with roll keys.
Enable the HELP key so that UIM help operates. You should also enable
ALTHELP. Declare a search index—use the system one if you do not have one
for your application.
Sub file sizes can be kept to a minimum by sizing them to be self- extending;
for example, SFLSIZ = SFLPAG + 1.
A subfile should stay positioned to the page last displayed by the user, unless
a validation error occurs, in which case it should be positioned to the first page
containing an error.
Make use of SFLNXTCHG with READC facility to reduce the number of records
that must be re-read to validate a subfile.
Format Level
The following standards apply to coding Display file DDS at a format level:
Use the DDS BLINK keyword as a record level standard—this makes the
cursor more visible.
Use the DDS KEEP keyword on the last panel displayed by the program—
this prevents blank panels appearing between programs.
Make F03 a command action key (CA03, rather than a command function
key (CF03). This saves the user from having to enter values into fields to
satisfy DDS validation checks, as specified by the VALUES and CHECK
keywords, when ‘backing out’.
For example, with the following code, the user would have to enter a value of
‘Z’ or ‘X’ into field ##XX, even if he wished to merely press F03 to exit:
Use the standard subfile names to relate subfile control records with their
subfile records. Use related names for the two additional formats needed
to show function key explanations and to show a ‘No items found
message’.
Record:Control Description
Note: For CA 2E, these values are provided from the Device data table.
Help Text
The following standards apply to coding Display file DDS help specifications at
a format level:
Use the DDS HLPARA with *NONE to provide an overall default area.
Use the format name plus the following special names for standard
elements.
Otherwise, use the format and field name as the label of help groups. Replace
any illegal characters (for example #), with a ‘Z’.
Field Level
The following standards apply to coding Display file DDS at a field level:
Define fields by reference to the field dictionary, using the DDS REFFLD
keyword.
Use relative positioning for device file field positioning; for example, ‘+n’,
rather than absolute positioning (row n, column m).
Use DDS field editing and validation where possible. This is more efficient
than program editing.
Make fields that hold text descriptions an even length, and specify a W shift.
This ensures they can be used for ideographic translations without truncation
of ideographic shifts.
We recommend that you use MSGID for all your text literals. The following
particular standards apply:
Always make MSGID and MSGCON fields an even length. This ensures
there will not be truncation of ideographic shifts.
Hard code the last colon or dot, if you are using MSGID or MSGCON for
your literals. This allows you to reuse messages, and ensure that
translators do not introduce errors.
Note: If you are using MSGID for your literals, use the message description
as the field name. The field name does not appear in your program. You may
need to append a letter to ensure that field names are unique.
For the panel title, column headings and other text elements, which occur on
most panels, use standard names to identify them.
The following are standard field names for text elements. (Ten characters are
used so that they do not clash with RPG program names).
Allow padding space for translation. Make instruction and column heading lines
the full length of the line.
Use the same message descriptions for help text headings as you use for field
prompts.
The use of emphasis (underline, high intensity, and color) should correspond
to standard meanings. For the IBM i, the display at tributes should follow the
recommendations of SAA CUA.
IBM i (CUA)
Title Y WHT
Top BLU
instruction
Label GRN
Data - GRN
Output only
Column Y WHT
heading
Note: Both standards place maximum emphasis on error fields and minimum
emphasis on the least important fields; for example, constants.
Wherever possible, reset error indicators from the panel using the DDS
SETOF(xx) keyword.
All panel text and column headings should normally use both upper and lower
case. Field labels that appear on the same line as the field they describe
should have a trailer and end with a colon.
Suppress signs on numeric fields where they are irrelevant; for example,
on numeric codes, by means of the appropriate edit code or edit word.
Edit dates, using the DDS edit word facility EDTWRD(‘ / / 0’). This
ensures that input capable fields, which are dates, are blank when zero.
Edit time fields with EDTWRD(‘ : : 0’). This ensures that input-capable
fields, which represent times, are blank when zero.
– Right adjust with blank fill for numeric input fields; the DDS keyword
CHECK(RB) should be used.
If a list of allowed values is specified for an input-capable field using the DDS
VALUES keyword, set the MDT tag when first displaying the field, so as to
ensure that the field is checked (DDS validation is only applied if a field is
changed).
General Considerations
They provide support for translation into other national languages (for
example, by use of the MSGCON keyword).
complex overflow processing is required and the RPG cycle is being used
File Level
The following standards apply to coding printer file DDS at a file level:
Printed reports should end by printing ‘** END OF REPORT **’ as the last
line in the report. This enables the user to be confident of having all the
pages of a report.
Format Level
The following standards apply to coding Printer file DDS at a format level:
Use space before (SPACEB) in preference to space after (SPACEA), so that
spacing only occurs if a format is actually printed.
Use the standard names for device formats when possible. They are as
follows:
For CA 2E, these values are provided from the Device data table.
Use the same indicator to detect overflow in all printer file programs.
Field Level
The following standards apply to coding Printer file DDS at a field level:
Define fields by reference to the field dictionary using the DDS REFFLD
keyword:
Where printer file field names need to be different from the names of
database or display device fields from which they are derived, use a ‘$ for
the first character, instead of the system prefix.
Use relative positioning for device file field positioning, that is, ‘+n’ rather
than absolute positioning: this makes changing code easier.
Use MSGCON for all text literals. The following particular standards apply:
Always make MSGCON fields an even length. This ensures there will not be
truncation of ideographic shifts.
If you are using MSGCON for your literals, hard code the last colon of field
labels. This allows you to reuse messages, and ensure that translators do
not introduce errors.
Allow padding space for translation. Make instruction and column heading
lines the full length of the line.
Edit dates using the DDS edit word facility, thus: EDTWRD(‘ / / 0’). This
ensures that input-capable fields that are dates, are blank when zero.
Edit time fields with EDTWRD(‘ : : 0’). This ensures that input capable
fields, which represent times, are blank when zero.
The program coding standards should not only make programs as readable as
possible at a workstation, but also achieve a high degree of consistency in the
way in which programs are structured and the style in which they are laid out.
This makes it much easier for different programmers to examine and maintain
each other's work. It also makes it easier to copy sections of code from one
place to another.
General Principles
There are a number of general principles to use when coding, regardless of the
HLL used. Good code should be:
Clear—It should be obvious from the code what the code does.
All programs should use ‘H*:‘ source directives to document the main
processing stages. These will then automatically appear in the summary
documentation and provide a program synopsis.
Declare entry parameters before all other parameters, and in the order that
they appear in the PGM statement. Include a text description of the variable
against each DCL statement. Where a field is a data structure, show
declarations of sub-fields, indented, below that of the major field. If the
parameter is an aggregate data structure, for instance a list parameter passed
by a command, document the structure as part of the comment:
Place general error handling at the end of the program. The standard error
handling should trap and resend any exception message.
V2R2 of OS/400 has new message APIs that allow you to handle messages
more efficiently. You should use them once they are available. The following
code carries out the same standard exception handling as shown above.
Parameters passed between programs should, where possible, have the same
name in the calling and the called programs.
Command source:
Command source:
These guidelines focus on designing programs that are easy to follow. The
discussion is grouped under the following headings:
Program Layout
All programs should follow the standard layout. Use continuous lines to break
the program up into its logical sections. Three characters are assigned
standard meanings:
Each file must be followed by a comment statement, which states its contents.
For logical files, the access path will preferably be indicated. (Text should be
the title line for the file). The comment should be after rather than before the
statement, as that gives a better effect on compilation listings:
Except where there is a good reason for using the RPG cycle, programs should
be fully procedural. Procedural programs are generally easier to follow, as well
as to debug. In addition, if you are using the RPG cycle, the input primary file
of an RPG III program, which updates the file, is allocated to the program with
an exclusive update lock. This is not recommended as it can prevent other
users from accessing records on the file.
Avoid explicit branching altogether, that is, the use of the RPG III GOTO, CAB,
and TAG operations. If you do use explicit branching, restrict it so that you
only employ structured programming constructs, NEXT and PREVIOUS; that is,
branch only to the beginning or end of the current loop, never to an arbitrary
point. The only legitimate use of the GOTO or CAB statements should be to
achieve an ‘ITERATE’ or a ‘QUIT’.
Use of GOTO
Only use a GOTO statement to branch to a point within the same subroutine.
Never use a GOTO statement to branch from a subroutine to a point in the
mainline code.
Avoid testing compound negative conditions when possible because they are
harder to understand.
F3 (IBM i) should result in the user exiting completely from a program. Where
a program calls several levels of subprogram, each subprogram may need to
test for the exit condition.
The RPG III statements used to code the reading of a group of records from a
file should be highly standardized.
1. It stresses the device independence of the data. The file name, which is all
that differs between different instances of the loop, appears at the
beginning of the code.
Use the RPG III EXFMT operation code in preference to a separate WRITE and
READ statements for display files because it is more efficient.
System-wide subroutines should have names beginning with the letter ‘Z’. You
may use the RPG III /COPY statement to include the subroutines if you wish.
The following are two common examples:
File access operations, such as READ, CHAIN, and READ, should use the
format name, rather than the file name.
Program field names should follow the rules laid out in the naming convention.
The names of fields should, wherever possible, be the same as those in the file
from which they are obtained. This helps to standardize the naming of fields,
and also makes clearer the mapping of fields between files. If necessary, a
different prefix can be used to indicate that the field is a work field or a device
field: for example, JJCUCD could give P1CUCD, #1CUCD, and WWCUCD.
Note: Format identifier: ‘II’ is either the format identifier from a database or a
device file or work prefix.
For the names of fields which act as accumulators, use an appropriate prefix +
the mnemonic of the field being accumulated. This helps to make mapping a
field from format to format, clear.
Arrays—The names of arrays should begin with the character ‘@’, and
otherwise consists of one, two or three letters, for example @X, @LN,
@PRC. This leaves space for an index.
Given that RPG III source code is edited on-line using a small (24 x 80) panel,
it is important to make an effective use of subroutine and label names. The
subroutine and label naming conventions for RPG III described below are
intended to do two things:
1. Help distinguish between the major and minor sections of the code.
Subroutine names and label names should take the following forms:
Hierarchy prefix—‘XX’ is a hierarchy level prefix, which is the same for all
labels in a given subroutine, and is:
The following diagram illustrates the use of different subroutine and label
prefixes at different levels.
The names of parameter lists should relate to the program they call. The
names of key lists should generally relate to the file with which they are
associated.
The following naming convention should be used for key lists and parameter
lists:
Suffix (Q): A suffix used to distinguish between lists for the same
format/program.
The *ENTRY PLIST should be labeled to indicate each field’s contents, and
whether it is an input or output parameter, or both.
The RPG III indicators (such as, 01-99) should be used as little as possible, as
they are difficult to reconcile with structured programming. The number of
indicators available is in any case fixed, so it is best to reserve their use for
the places where you are obliged to use them. Ideally, indicators should only
be used to:
Where you need to use a logical indicator, for example, because a test is too
complicated to repeat easily, it is often better to define your own variable and
give it a meaningful name, rather than use one of the RPG III numeric
indicators.
Try to give the same meaning to indicator usage throughout a system. This
makes it easier to understand programs. Use specific indicators for functions
that are common to many programs, such as command keys, and use a
different range of indicators for functions that are specific to a particular
program, or part of a program. Indicator usage should follow the following
convention:
Note: The usage of certain indicators has been revised since the previous
edition of these standards. The old values are shown in brackets.
Document the use of non-volatile indicators (for example, those which have a
global scope rather than a local use). For example, ‘*IN87 = Company is
insolvent’.
Remember that dates obtained from use of the RPG III TIME operation are in
the format specified by the OS/400 QDATFMT system parameter, while the
format of the RPG III UDATE field depends upon the H specification of each
individual RPG III program.
The program header specification should have a Y in column 39, to ensure that
UDATE is present in YYMMDD format, regardless of system date format.
The user profile name and job name should appear on panels and reports.
Use the program status data structure, defined with an ‘S’ in column 18, to
retrieve information about the operator, for example, user profile name, job
name, and job number. Never ‘hard code’ the user profile name or program
name as a literal.
The file information data structure can also be used to obtain the current line
number, so that subfiles can be re-displayed, while still positioned at the same
place.
An externally described file may also define the file data structure.
Calculation Checks
Always test that a divisor is not equal to zero before dividing with it.
Unless specifically told not to, always half-adjust when adding together
two fields of different precision levels.
All examples presented use COBOL ‘85 syntax, unless otherwise stated.
Note: For more information on the standards for COBOL programs, refer to
the appendix, "Programming and Coding Examples."
Language Standards
Program Layout
Although not all sections are mandatory, incorporating them into a default
program skeleton together with additional standard sections (such as exit
program and display messages), provides a basis from which to continue
coding.
Use continuous lines of comments to break the program up into its logical
sections. Use the following convention:
Examples of dividers:
Make use of the THEN and CONTINUE noise words to emphasize the structure.
For COBOL ‘85, use an inline PERFORM statement if more than one statement
lies within the THEN group, and use explicit scope terminators (such as END-IF
and END-PERFORM) on all multi-statement constructs.
Use of GO
The COBOL statements used to code the reading of a group of records from a
file should be highly standardized.
It stresses the ‘device independence’ of the data. The file name, which is
all that differs between different instances of the loop, appears at the
beginning of the code.
V2R2 of OS/400 has a message sending API QMHSNDPM you should use
instead.
Wherever possible, the names of fields should be the same as those in the
externally described file from which they are obtained. This helps to
standardize the naming of fields, and also makes the mapping of fields
between files, clearer. If necessary, use a different prefix to indicate that the
field is a work field or a device field. For example, JJCUCD could give P1CUCD,
Z1CUCD, and WWCUCD.
For the names of fields which act as accumulators, use an appropriate prefix +
the mnemonic of the field being accumulated. This helps to make the mapping
of a field from format to format, clear. For example:
Special cases:
Program control variables. Fields which do not appear in any externally
described file should be given meaningful names prefixed by a ‘C-’; for
example, C-CHANGE-MODE. Use a hyphen between words.
Arrays. Indicate that a variable is an array by a suffix ‘-A’; for example XF-
A.
Array indices. The names of array indices should, if possible, relate to the
names of the arrays they index; they should contain the same letters
without the suffix. For example, XF might be the name of the index for
array XF-A, giving XF-A(XF) as an occurrence.
Standard fields. Fields that serve the same common role in many different
programs may use a single three-character mnemonic to indicate that they
are standard fields; for instance, xxRTN - the return code. The CA 2E
application generator uses this technique.
For instance:
Given that COBOL source code is edited online using a small (24 x 80 or 24 x
132) panel, it is important to make an effective use of subroutine and label
names. The subroutine and label naming conventions for COBOL described
below are intended to:
help distinguish between the major and minor sections of the code
indicate whether you need to scroll forwards or backwards to find a section
of code
Subroutine names and label names should take the following forms:
Labels should be named to stress the construct type according to the following
convention.
Note: This section primarily applies to COBOL ‘74, which lacks consistency in
its ability to handle the most commonly used structured constructs. It is
recommended that pseudo-constructs, with structured GOs, be used instead.
The following naming convention should be used for naming data structures
that represent key lists in order to make the association between the data
structure and the file that it reads, clear:
In standard programs, it may be more appropriate to name key lists after the
role they perform; for example, KRST and KPOS when using restrictor and
positioner keys.
Use the FILE-STATUS indicators to communicate with files. For each FILE-
STATUS value, declare a Level 88 item with a meaningful name. For example,
declare level 88 items for use in testing indicators, for example:
One method you can use to do this is to declare those most commonly used
indicators individually, with those remaining being manipulated, using the
above method.
Thus, try to give the same meaning to indicator usage throughout a system.
This makes it easier to understand programs. Use specific indicators for
functions that are common to many programs, such as function keys, and use
a different range of indicators for functions that are specific to a particular
program, or part of a program.
For more information about data handling, refer to the chapter, "General
Coding Standards."
The user profile name and job name should appear on panels and reports. You
should never ‘hard code’ the user profile name as a literal—always get it from
the data structure.
Since this information is readily available from the PGMDS of an RPG III
program, one technique is to call a standard RPG III subprogram to obtain
information about the operator—user profile name, job name, job number.
You should place the program name in a variable. This facilitates renaming or
copying the program.
The program data structure may be defined using an externally described file.
This helps to standardize its use.
Calculation Checks
When carrying out calculations, always test that a divisor is not zero before
dividing with it.
Unless specifically told not to, always half-adjust when adding together
two fields of different precision levels.
Program Layout
Place the program name in a variable at the beginning of the program. This
variable should have the same name for every program, for example,
@PGMID. Use this variable wherever the program name is needed (for
example, on message sending). This makes it easy to rename the program, or
to copy code.
Use only one PL/1 statement per line. Use continuous lines to break the
program up into its logical sections.
Declaration of Variables
Not:
But rather:
For structured variables, use level numbers, such as 1, 5, 10, and 15. This
allows for subsequent insertion of new levels.
It is essential to have the same file usage throughout all programs that will
form a single run unit. If file usages conflict, an execution time error is almost
inevitable. For example, not as follows:
Copy Books
Indicators
Open feedback areas
File information feedback areas
Sub file control variables
The PL/1 statements used to code the reading of a group of records from a file
should be highly standardized. A standard loop:
stresses the ‘device independence’ of the data. The file name, which is all
that differs between different instances of the loop, appears at the
beginning of the code.
Standard Procedures
message sending
string handling
System-wide procedures should have names beginning with the letter ‘Z’.
Naming Standards
For display file formats, use ‘I’ as a suffix to indicate an input format, and ‘O’
as a suffix to indicate an output format, because the contents of the two
formats may be different.
Program field names should follow the rules laid out in the naming convention.
The names of fields should, wherever possible, be the same as those in the file
from which they are obtained. This helps to standardize the field naming, and
also makes the mapping of fields between files clearer. Any reference to a field
should normally be qualified by the name of the structure to which it belongs,
wherever possible (for example, if not subject to the restrictions of other
HLLs).
ALWDLT
FIL
CUSCDE
VNM
CHR
PTR
Name control variables based on files and data structures by the based-on
structure name and a suffix:
For the names of fields that act as accumulators, use an appropriate prefix or
suffix appended to the name of the field being accumulated. This helps to
make the mapping of a field from format to format, clear. For example:
Arrays—It may be useful to give the names of arrays a suffix ‘_ARR’, such
as ‘stkqty_arr’.
Given that PL/1 source code is edited online using a small (24 x 80 or 24 x
132) panel, it is important to make an effective use of procedure and label
names. The procedure and label naming conventions for PL/1 described below
are intended to:
help distinguish between the major and minor sections of the code
indicate whether you need to scroll forward or backward to find a section
of code
3rd level subroutines should have a three letter prefix, such as ‘ABA_’,
‘BBC_’.
The indicators, such as 01-99, should be used as little as possible, as they are
difficult to reconcile with structured programming. The number of indicators
available is fixed, so it is best to reserve their use for the places where you
have to use them. Ideally, indicators should only be used to communicate with
external files.
Try to give the same meaning to indicator usage throughout a system and
across all HLLs. This makes it easier to understand programs. Use specific
indicators for functions that are common to many programs, such as command
keys, and use a different range of indicators for functions, which are specific to
a particular program, or part of a program. Indicator usage should adhere to
the following convention:
Order of Parameters
Always place required parameters before the other parameters. Do not use
numeric reordering of prompting if the parameter has a value other than
MIN(0), as allowed for the PROMPT keyword on command definition
statements. Doing so gives undesirable results when using the command
prompter with positionally specified parameters.
Place the parameters, whose values are most likely to be changed by the user,
before the other parameters.
Compiler Overrides
the name of any help panel group. (keywords HLPPNLGRP and HLPID)
Cross-reference Data
You should ensure that your CPPs handle processing and messages in a
manner that is consistent with standard CL command usage. In particular:
Processing to check for the presence of all required objects and the
authorization to use those objects should be carried out before any
processing which changes any data or objects starts. This helps to ensure
that the command runs cleanly: either it functions completely, or not at
all. The CL Check Object (CHKOBJ) command is a relatively fast operation.
For example:
If used at all, validity checking programs should only carry out limited
validation; for instance, any cross-checking of parameters that cannot be
achieved with the CL ‘Dependency definition’ (DEP) command definition
statement. This should only be necessary when checking the components of
lists and qualified names.
Validity checkers should not check for the existence of objects or other
entities, nor should they be used to invoke selection functions. This is because
the validity checker is invoked whenever the OS/400 command prompter or
syntax checker is invoked for the command, even if the command is not
executed.
Prompt override programs (POP) should be provided for those commands that
allow the changing of the attributes of existing objects, in particular for ‘CHG’
commands. The object to be changed should be used as the keyword object. If
a ‘retrieve’ (RTV) command exists for the object type, it should be used to
obtain the object details.
Note: If a command string contains text parameters, the POP must double up
any apostrophes in the text or else they will cause errors.
Prompt Messages
Prompt messages are used to enable translation of the text into other National
Languages and also to ensure consistency in the use of a given term. In
particular you will want to ensure that the prompt used in panels and in help
text corresponds exactly.
Prompt Types
There are a number of different types of text element that make up UIS
conformant panels. You should ensure that each type follows the correct UIS
standards for its type. See the sections on design and coding for each object
type for further information on the rules.
Commands
Panel elements
– Panel options. This should follow UIS layout standards (for example
4=Delete). Do not attempt to reuse messages but instead, provide a
separate message for each display. Use a single message for the whole
line—this makes it easier for translators to abbreviate.
– Field labels. Use an initial capital and pad any trailing blanks with
periods. Do not use a ‘:’ Hard code it in the DDS.
There are a number of frequently occurring items (for example “Name, F4 for
list”), which should be set up centrally and reused when possible.
– Function key instructions. This should follow UIS layout standards (for
example, F3=Exit). Do not attempt to reuse messages but instead,
provide a separate message for each display. Use a single message for
the whole line.
Help text
– Panel titles. Use the panel title with “- Help” appended. (Use the UIM
&msg facility to define (“Help”) as a reusable message.
– Extended headings. Use the field labels prompts for the headings that
appear in extended help display (UIM ‘:XH3’ tag).
– Panel options. Use standard messages for each function key label
(“Delete”, “Change”, “Rename”, etc.).
– Field value names. Use lower case with hyphens, for example, library-
name. Use apostrophes to indicate a quoted string for example ‘text-
description’.
– Function keys. Use standard messages for each function key label
(“Home”, “Print”, “Exit”, etc.).
Execution Messages
All program messages should be externally defined, and retrieved at run time
from the system application message file. Using external messages gives you:
standardization of messages
easy correction of messages
If you need the diagnostic messages to appear as well on the calling programs
queue, you can use the V2R2 QMHMOVPM API.
Add message:
Use in program:
&1 Objects moved: &2 added, &3 replaced. &4 not moved.
Long running jobs should send status messages to report the job’s progress.
For instance, ‘Records being copied to file QTXTSRC’, ‘Work space is being
loaded’, ‘Entire system is being backed up’. This can be done as follows:
Retrieving Messages
The V2R1 API QMHRTVM can be used to retrieve message text directly into an
HLL.
If the default user message file ‘QUSRMSG’ is not used, then the execution
and prompt message files should be called xmmmMSG, and xyyyPMT
respectively, where x is the system prefix, and ‘mmm’ the application
mnemonic.
Message prefix (MMm) is the same for all messages in the application
system. The following are reserved values:
The following additional convention may be used for the third letter of the
message prefix, to indicate the message type. This makes it easier to identify
messages for which you may monitor.
Avoid using message identifiers that end in zeroes for escape, notify, and
status messages.
Use prefixes to allow for generic monitoring, for example, prefixes, which
have similar numeric groups. For example:
You may use dummy messages to provide section headings within the
message file.
Message Severity
First Level
The first level text of a message should give a concise statement of what is
wrong or what has happened. A substitution variable can be used to relate the
message to a particular entered value. For example:
On IBM i, messages should be given in the form “A in B”; for example, “Object
&1 not found in library &2".
Second Level
The second level text of error messages (escape, diagnostic, or notify) should
give a more detailed explanation of the cause of the error, suggest possible
methods of recovery, and if appropriate, any additional sources of information.
The key words ‘Cause’, and ‘Recovery’ should be used to indicate the start of
the respective sections. Messages should be formatted using the &N and &B
facilities to indent or start text on a new line.
OS/400 includes a command that enables you to edit the text and other
attributes of an existing message. See the IBM i Change Message Description
(CHGMSGD). The OS/400 Merge Message File (MRGMSGF) command can be
used to carry out a limited copying of messages. There is also a CA 2E Toolkit
command to copy a message description, Copy Message Description
(YCPYMSGD).
Since HLL programs cannot send messages to their own message queues, the
above technique requires the use of standard CL subprograms to:
send the messages. The program will need to be called once for each
message that is to be sent.
clear old messages. Before validating the input, any old messages will
need to be cleared from the queue—the message-clearing program will
need to be called once every time the display file is read.
Note: For V2R2 onwards, you should use the QMHSNDPM API.
From V2R2 onwards, you should use the QMHRMVPM API instead.
If multiple validation errors are detected, only the error message for the first
field in error on the panel should be output, but all fields in error should be
highlighted in reverse image. This is because sending an error message incurs
a certain overhead; and in any case, an initial error often has a knock on
effect on subsequent fields.
Associate an error indicator with each input capable field on the display. If an
error is detected, this indicator should be set on and an error message sent.
Batch jobs should use messages both to record errors and to log processing
stages.
Batch jobs in which a termination level error occurs should send an escape
message—this causes OS/400 to give an indication of abnormal job
termination.
V2R2 of OS/400 includes new message handling APIs for sending, receiving,
and retrieving messages directly from HLL programs (previously, CL had to be
used for most operations). You should use the APIs in preference to CL
subprograms not only for performance reasons, but because the APIs allow
you to identify the destination program message queues by a relative
invocation number. This makes it possible to send messages without
knowledge of the program name of the destination message queue. (CL only
allows you to identify the program previous to the current or a named
program, so cannot it cope with recursion). Such a facility is important when
writing reusable code routines.
QMHSNDPM call
General Considerations
Minimize the work required to translate help text. Modularize your help
groups and use message descriptions.
You will want to structure your help text modules both to achieve maximum
reuse of existing help groups and to minimize the effect of any possible
changes. However, avoid over-complex interdependencies that make it difficult
to build or debug a system. For database field dictionaries, a controlled ‘one-
way’ system of reference is recommended. The following are some
recommendations for structuring your help text:
Place common text definitions in one or two standard modules and all
other modules reference them. Place standard text fragments in one
module, including any references to OS/400 help groups.
Place help text for related commands in a separate panel group. For
example, help text for the commands to create, change, delete, and edit a
given object might all be placed in the same panel group.
Restrict the use of UIM index (:ISCH) tags to a few source members so as
to simplify the building and rebuilding of search indexes.
Under the above scheme, a search index can be built simply as follows:
CRTPNLGRP PNLGRP(xSCHIDX)
CRTPNLGRP PNLGRP(xxmmENH)
CRTSCHIDX SCHIDX(xSCHIDX)
All UIM panel source should follow the standard layout. Place help groups in
the order in which they appear in panels and commands. Place reusable text
fragments at the end.
Use comment lines to make the start of each help group clear.
Use uppercase for UIM tags so that they stand out. Use lower case for
labels, but use uppercase for the labels of standard text fragments.
Provide :XH3 entries so that there are headings in the extended help
listing—that is, when F2 is pressed.
The command prompt message definition is used for the command overview
help text definition.
Note: The command parameter prompt message definition is used for the
parameter help text definition.
* For commands
For example:
For example:
Make use of OS/400 system help group modules where possible. References to
system modules should be placed in the standard definition panel group
member so they can be changed, if necessary.
Keep your own standard definitions in a ‘dictionary’ and reuse them wherever
possible. This ensures consistency and reduces the work required to translate
a system. The dictionary should be the default import declaration. Avoid
excessive use of hypertext tags at it makes the help text hard to read. A list of
‘related topics’ after the introductory text is the most concise.
For each command, provide a help group, which gathers together all the
parameters of the command. This help group can be referenced by a search
index and hypertext links.
For each parameter, state the keyword and prompt, and list the allowed
values. The default value should be shown first, (for example, *NONE), then
other special values, (for example, *ALL), then the domain name (for example
library-name, member-name, ‘text’).
Provide an introductory section for each panel, beginning with the panel’s
name, for example, ‘The Display Library List (wchgliblst) panel’. This will be
used as the default text for the panel. The name of this help group should
have the form ‘Format name/PNL/INTRO’.
For each input capable field, state the prompt and list the allowed values. The
default value should be shown first, (for example, *NONE), then other special
values, (for example, *ALL). The name of the help group should have the form
‘Format/field name’.
If there is a selection column with options, provide a list of all allowed values.
This should have a name of the form ‘format/PNL/TOPINS’.
Provide explanations of the function keys. This should have the form
‘format/PNL/CMDINS’. In most cases, you will be able to reuse standard
definitions.
Provide an introductory section for each menu, beginning with the menu’s
name; for example “The Library List command menu’. This will be used as the
default text for the menu. The name of this help group should be the same as
the menu name.
Help panels assist users who already know how and why to start a command
or program. Search indexes provide users with a way of finding out how to do
something in the first place. You should provide a help index for your
application.
Provide search index entries for the keywords that a user may use. Provide
entries for common synonyms; for example create, make, and build
Do not distribute UIM :ISCH tags throughout the source of your panel groups.
Restrict them to the source of the search index itself, and to the member or
members containing standard entity definitions and hypertext tags. This
means that you can recreate the search index without having to remove or
add back all the other panel groups as entries.
The search index itself will need to contain help groups with outward
references to any commands it needs to reference. Use dummy names with
underscores for these help groups.
Introduction
OS/400 Work Management allows you to control submitting, queuing and
executing jobs, and spooling their output. Most of the aspects of jobs that you
want to control, such as job priority, job queue, and output queue, are
parameterized, and may be changed interactively. The CA 2E Toolkit utilities
extend the flexibility of Work Management by allowing stored library lists,
menus, and additional user profile parameters.
General Principles
As general principles:
Such a program should includes changes to OS/400 system values made with
the OS/400 Change System value (CHGSYSVAL) command, although such
changes are preserved when a new release of the operating system is
installed. These include:
system user library list (QUSRLIBL), which should normally include QTEMP,
QGPL, and the CA 2E Toolkit utility library
tuning parameters like Base pool size (QBASPOOL) and activity level
(QBASACTLVL)
All files in the system library QSYS and other utility libraries should be given
the default forms size for your installation. For example:
The files used for compilation listings should be held (set to HOLD(*YES)), so
that listings can be examined online, using the browse scan facility of the
OS/400 Start SEU (STRSEU) command. They should not normally need
printing:
Job logs and program dumps should be directed to a separate queue. They can
then be found easily, but will not normally be printed.
For example:
You might also wish to include in your program changes to subsystems which
you have made—for instance to have auto-start entries, routing entries, and
additional job queues, and changes to job descriptions, job queues, output
queues and classes.
In particular, you might wish to revoke public rights to use certain commands,
or to add objects to any of the libraries in the system library list.
Note: If you have specified that certain messages are to be logged in the
system log, you should record this fact.
For instance, if you needed to produce two copies of a report in a program you
could either:
Likewise, if you have a program that submits a job, do not hard code the job
attributes (such as the job priority) on the ‘submit job’ statement. Instead,
create a job description that has the desired attributes, and submit the job
using the job description. The job attributes for new jobs may then be changed
at any time, simply by altering the job description.
Another technique that can be used is to store a command that may need to
be changed as a message on a message file, and to retrieve it at execution
time for execution with the OS/400 execution program QCMDEXC. The
message description can then be modified at any time using the OS/400
Change message description (CHGMSGD) command. This technique is used to
implement the CA 2E EXCMSG function.
Job Descriptions
Job descriptions provide a convenient mechanism for controlling the execution
attributes of a submitted job, including the job queue to be used, and the
execution priority.
Note: For job description names, the names QBATCH and QPGMR should be
used where possible, and object identification controlled by library list.
Queues
Job and Print Queue Names—The default Work Management names
QPRINT, QBATCH and QPGMR should be used where possible, and object
identification controlled by library list. Consider introducing a different output
queue for each forms type used.
Message queues can be particularly useful for providing log functions. For each
application system, consider introducing three message queues (xxxSYSOPR,
xxxHSTLOG, and xxxCHGLOG), each with a particular role:
The print file attribute—Print files have an attribute (OUTQ) that specifies a
default output queue to be used when the file is used, and which can be
changed using the OS/400 Change print file (CHGPRTF) command. The
attribute either explicitly names a particular queue, or has a value of *JOB,
which causes the output queue to be defaulted at the time of printing to the
output queue for the job that has created the spooled output. On AS/40,0 a
value of *DEV may be used—it specifies that the printer device associated with
the job should be used. The output queue used for a particular spool file may
be temporarily overridden for part or the entire job, using the OS/400
Override print file (OVRPRTF) command.
The output queue for the job—The output queue for a job is set by the job
description used to start the job. It may be overridden by the Submit job
(SBMJOB) command used to start the job, or from within the job using the
Change job (CHGJOB) command.
The output queue for the user profile—A default output queue can be
specified for each user profile. The output queue for a job is set by the job
description used to start the job. It may be overridden by the OS/400 ‘Submit
job’ (SBMJOB) command used to start the job, or from within the job using the
OS/400 Change job (CHGJOB) command. This is summarized in the following
diagram.
to print it always at the system printer (as in the case of large reports), or
at a particular printer (as in the case of reports on special forms, or with
special font requirements)
If a batch job produces several different reports and you wish them all to be
printed together, you should use the SCHEDULE(*JOBEND) parameter to
ensure this happens.
User Profiles
OS/400 user profiles allow you to achieve a precise modulation of who can do
what on the machine. The standards described below apply to the use of user
profiles.
A user profile should be set up for each user—even if the user will have the
same initial menu as other users. It is important that OS/400 user profiles are
used because:
Individual OS/400 user profiles are a necessity for the correct use of many
OS/400 functions, including authorization, audit trails, and accounting. It
is important that use can be resolved down to as fine of a level as
possible, for example, the individual user. In other words, a user profile
not only controls what a user may do, but it is also used to trace what the
user has done.
The above approach requires at least one profile per user. Additional profiles
can be used to aggregate users into groups, and therefore to simplify the
granting of authorizations: we may classify profiles into two main classes:
Some special personal profiles representing standard roles are shipped in the
system—for instance ‘QSYSOPR’ (System operator), ‘QSECOFR’ (Security
officer). If the duties of a shipped profile are the responsibility of a single user,
then they can be used as shipped. If more than one person carries out the
duties sub-profiles should be introduced to maintain accountability.
Group Profiles
The user profile name will appear on reports, dumps, and logs. For this
reason, it is helpful for both operations and problem shooting if, as well as
uniquely identifying the individual user, it can indicate what the user’s role is,
i.e. some operational grouping. For end users the most significant grouping
tends to be by department, or for developers by the project on which they are
working. A two-part convention is therefore recommended for user profile
names:
Identifiers representing roles, for instance the group security officer, can
be named using standard three character CL mnemonics.
Examples:
ACC—Accounts department
ACC_ES—Accounts - Ernest Saunders
ACC_RC—Accounts - R.Calvi
ACC_IB—Accounts - Ivan Boesky
ACCUSRPRF—Accounts - Profile to copy for new users
ACCSECOFR—Accounts - Security officer/administrator
YBOTHER—Panacea product
If you run multi-machine networks, it is helpful if you can give the same
profile the same name across all machines (IBM midrange). To this end, the
following considerations should be kept in mind:
User profile names that are to be used in networks should not be more
than eight characters long.
Certain characters (for instance underscore ‘_’) may not be used in user
profile names on some other architectures machines with which you wish
to communicate.
There should be a separate profile for each end user. It is good practice to set
up a group profile for each department and make each end user profile belong
to a group profile. General authorizations can then be granted to the group
profile. The group profile may also own the application objects.
For each group profile, it is worth considering having two special individual
profiles:
A ‘template’ profile that can be copied to create a new user profile. This
profile should have a password of *NONE.
Development Profiles
A group profile should be set up for each project. All objects for a system
should belong to this profile while under development.
Live objects should not generally belong to either an end user profile or the
development profiles, but rather, should be owned by a separate shipment
profile. The profile may only be used by an administrator who is responsible
for taking tested objects from the developers and implementing them into a
live system. The shipment profile is not used either for development, or to run
the application.
Before installing, ensure that prior to saving and shipping, all objects are
owned by the shipment profile. For example, you would enter the following
command for the profile UDFTOWN.
To install:
1. Sign on as QSECOFR.
4. Sign on to a profile with restore rights and restore the objects. The objects
will, therefore, be given to the shipment profile UDFTOWN.
The security officer should regularly change the QSECOFR password. In order
to ensure that it is always possible to obtain access to the machine as a
security officer, you can use the following technique:
Implementation of Security
In a live system you will need to decide:
who owns the data objects, such as database files, data areas, and data
queues
who owns the execution objects, such as programs, device files, and
message files
who has rights to control jobs and to examine spooled print output
Operational Rights
The operational rights to all other objects can be left in the public domain (the
default).
Note: In the shipped system, the commands do not have public operational
authorization. Consider granting public rights to the commands.
On IBM i, you can create an authorization list and attach it to each command.
By adding a user profile name to the authorization list, that user profile is
immediately authorized to all the commands. Alternatively, the programs that
invoke the commands can borrow the rights of the program owner, rather than
the user. This is achieved by specifying USRPRF(*OWNER) when creating the
program.
Object ownership should be retained by the project group profile. The project
development sub-profiles should have management and existence rights. This
can be achieved automatically if the profiles are created with the correct
attributes (OWNER(*GRPPRF)).
Text files: Users will need management rights in order to add or remove
members.
Work files: Users will need management rights in order to add or remove
work members.
Checking Authorization
Instead, you should introduce an ‘authority holding’ object, such a data area,
to which you may grant rights to one or many users at any time without
modifying the code. You may then test the user’s authorization to the object:
Security Exposure
Most of the likely points of security exposure are covered in the chapter on
security in the IBM i (AS/400) CL Programmer’s Guide.
Allowed Signons. Set the OS/400 system value that controls the number
of allowed signon attempts, QMAXSIGN to a low value, for example, three.
Workstations left signed on. Use the OS/400 QINACTITV system value to
force a time out after a specified number of seconds.
– Make sure that debug capability is removed from programs that call
the OS/400 QCMDEXC program.
– Restrict the adoption of rights to the minimum duration. That is, place
the statements for which rights must be adopted in a small, separate
subprogram.
Note: Avoid creating programs that adopt the rights of profiles with QSECOFR
rights.
Input and media. Make sure that you apply adequate security measures to
your offline backup media (tapes and diskettes) and to printout.
Use of PRTTXT. Use the PRTTXT keyword to ensure that all printouts have
originating text on it, for example ‘IBM RESTRICTED’.
Audit Trails
Use a journal. Use a journal for an audit trail. Copies of sensitive requests
can be written to the journal as user-defined entries. Individual journal
entries cannot be deleted. You should secure the journal and its receiver:
User systems should be menu driven, with Help text available for each
interactive option.
For more information on the YINLPGM command, refer to the Toolkit Concepts
Guide.
Using Libraries
The following principles should be applied for the use of libraries under OS/400
and the organization of a development environment on IBM i:
For a given application, separate the live data files, the application objects,
and the source files into different libraries. The national language
dependent objects, such as commands and panel groups, may also need
to be separated from the other application objects.
For each application, use a separate set of libraries; very large libraries are
inefficient to use.
Keep development separate from the live systems. Separate user profiles,
using object ownership and authorization to enforce this.
It is very important that you organize your development environment and your
working methods systematically. Doing so can:
make it possible for more developers to work on the same project because
the dependencies are clearer.
Development Phases
The following diagram shows a system for using libraries for development:
Note: The contents of each of the libraries shown in the diagram are explained
below.
Strict rules should be applied to how source and objects may be moved
between libraries:
Objects, together with their source, should only be moved along the routes
shown by arrows.
Configuration Management
Check out components into the development environment and record that
they are in use.
Test pack suffix—nn - Suffix used to distinguish different sets of test data.
Library Types
The following are examples of the library lists required to use the system
described above.
Use of Libraries
For instance:
If this rule is not obeyed, the library list cannot be used to find objects. It will
require a programming change to use a different set of data, or a different
version of a program. Apart from losing one of the most powerful capabilities
of OS/400, it will be very difficult to establish a test environment that is as
close as possible to the live environment.
Where you need to specify a library, for example on a create command, use
the current library *CURLIB as a default.
The CA 2E Toolkit utilities include library list manipulation facilities that can
help avoid the explicit coding of library names.
For more information on user access aids, refer to the Toolkit Concepts Guide.
For the CA 2E Toolkit IBM i Change Library List (YCHGLIBL) and Change Job
Description Library List (YCHGJOBD) commands, refer to the Toolkit Reference
Guide.
Use the PRDLIB facility on menus and commands to set the library list to
include any necessary application execution objects, such as programs and
device files. Only set the PRDLIB on the live version of objects.
Use the CURLIB facility to set the library needed to find application data
objects, such as database files and data areas.
Using QTEMP
the work objects will automatically be cleared up when the job terminates,
even if the job crashes
the work objects will not conflict with the work objects of other similar jobs
Work objects should be duplicated into QTEMP by use of the OS/400 Create
Duplicate Object (CRTDUPOBJ) command, working on a model object kept in
the system execution object library. Note that the CRTDUPOBJ command
requires that the name of the library containing the model object be
specified—the name of the originating library should not be ‘hard coded’ as a
literal, but retrieved, as above.
It may not be desirable to give the user rights to use the CRTDUPOBJ
command, in which case a special ‘duplication program’ may be created with
USER(*OWNER), which will adopt the rights of a user profile that has the
necessary authorities.
You should allow for the possibility of the work object already existing in
QTEMP. You do not need to delete the work object explicitly when you finish.
The following code would create a work file UUWKFLP in QTEMP from a model
library, by calling a program UUCRDPC, which in turn, calls a program
UULBNMR.
Using QGPL
Version Control
Objects and source should only be moved between libraries in a strictly
controlled manner, so that if there are successive changes outstanding, they
are implemented serially.
Every source line has a change date on it. When copying source to the
development library in order to make changes, take care not to reset the
source change dates; that is, do not copy a member by adding a new member
and using the SEU browse/copy function to include the old version.
Object Versions
Upward Compatibility
– the change is to add new parameters to the end of the parameter list
and the parameter use is optional. For example:
Version Numbers
Execution objects, for example, items that do not contain data, such as
programs, device files and message files, may generally be restored on top of
the existing versions. (N.B. device files cannot be in use while this is done.)
Data objects, for example, items that contain data, such as database files and
data areas, cannot generally be restored directly without losing the user’s
existing data. They must, therefore, either be installed under a different name
and be renamed after data conversion, or be installed to a different library and
moved after data conversion.
It may also be necessary to rebuild any logical views that are based upon
physical files that have been changed. In either case, a conversion program
will need to be run to copy and or convert data from the existing files. It
should be possible to run any data conversion procedures in one of two ways:
The following is the change mechanism used for IBM’s own products such as
RPG III (QRPG):
1. All changed objects are given a name based on a serial number for
shipment.
2. The numbered objects are restored on site with the OS/400 Load PTF
(LODPTF) command, which checks that no fixes have been omitted. The
LODPTF command also restores a log of changes, which includes
information about dependencies.
Catastrophic failure (for example fire or a disk head crash), where the
online storage medium is likely to be physically damaged. Catastrophic
failure is likely to be rare, and to involve a considerable delay while new
hardware is obtained. The main concern for recovery is avoiding excessive
loss of data. Recovery from catastrophic failure will invariably involve
restoring from offline copies. It is essential to keep off site copies of
software to guard against catastrophic failure.
In planning for the above, you should take into account both the relative
probabilities and the cost of failure (“Risk = Probability x Cost of failure”), and
choose a cost-effective plan. This means understanding what is the largest
acceptable unit of loss: is it one day, one hour, or one transaction?
Data Security
It is not just data loss that you need to be concerned about, but rather, the
wider concept of data security. The two goals of data security are:
1. Design the database update processes so that whether or not the update
is deemed to occur depends on a single transaction. For example, add a
status flag to a control or header record and update this last. Transactions
that have an incorrect status flag are ignored.
2. For batch procedures only, the entire database could be saved before
running the procedure, so that the start position can be restored in the
event of a failure. Backup could be online; either to a save file or using the
OS/400 Copy File (CPYF) command.
If some of your applications are more essential for the continued operation of
your organization than others, consider separating critical and non-critical
systems into separate libraries so that the critical systems can be restored
ahead of the others.
Backing-Up
How often something needs backing up depends upon how often it changes.
Broadly speaking, IBM i objects can be grouped into four levels of volatility:
Very low volatility. QSYS (the OS/400 system library), and other shipped
program product libraries such as QIDU, QRPG, QTXT, QOFC.
Low volatility. QGPL (user work management objects) and live application
execution objects.
Live application data objects (database files, data areas, data queues)
probably change every day, as do the objects in development libraries.
Therefore, they should be backed up regularly.
If journaling is used, then the data in the journal receivers of live applications
will probably change the whole time—from moment to moment, as data is
entered and processed. In high volume or data critical applications, journals
should be saved throughout the day or even be transferred continuously to a
backup machine or machines.
Place dependent objects in the same library. This simplifies the restore
process. Place logical files in the same library as the based-on physical
files. Place journal receivers in the same library as the journal to which
they attach.
Use a naming convention for objects so that they can be identified and
manipulated by type, if necessary.
Execution objects and source for live application systems should be kept in
separate libraries that need be backed up only when a change is made to
them.
The strategy adopted for backing up live application data objects, in particular,
the choice of whether journaling, Save Change Objects (SAVCHGOBJ) or Save
Objects/Libraries (SAVOBJ) is used, will depend on the following
considerations:
Batch/Interactive job mix. Journaling is less suitable for high volume batch
applications.
Ancillary libraries, for example, test data or development tools, may only
require an occasional backup.
Backup Methods
For each backup unit (library or generic library name, object or generic object
name), it should be possible to specify a save frequency (such as hourly, daily,
weekly, monthly), a save method (SAVOBJ, SAVCHGOBJ, or SAVLIB), and
whether the save is offline or online (save to save file).
The system should guide the operator in loading the appropriate media and
should record which libraries have actually been saved on which days, and to
which media.
Using Media
Rotate the media versions. This both provides better protection, but also
spreads the mechanical wear of the media more evenly.
A cycle of at least two week’s versions should be used for offline media copies:
When making saves, set the expiry date on the media (EXPDATE parameter on
CL Save commands (SAVLIB, SAVOBJ, SAVCHGOBJ, SAVSAVFDTA)) to be the
expected date of reuse. This will cause an exception message to be sent to the
operator if he tries to use the media earlier than the scheduled date.
Media (diskettes or tape) should always be clearly labeled. The label should
include:
Types of Testing
Implementation testing can be divided into two stages:
program testing
system testing
Program Testing
The usual unit for program testing is a single menu option—this will often
correspond to a command.
Most testing methodologies distinguish between black box and white box
approaches to testing.
System Testing
to check that each program has the correct effect upon the data it
handles, that is, that the database is updated correctly and that all
calculations are correct
to test for arising conditions due to large volumes of data, including level
breaks, page overflow, and exceeded commit maxima
Test Sheets
Test Techniques
To test a whole system successfully, you will need to “divide and conquer”;
that is, split the system into modules that can be tested independently. Do not
try to test the whole until the parts are working.
a given test will be needed not only for initial development, but also later
on to retest components after maintenance changes
test harnesses and ‘scaffold’ programs to run individual programs that are
normally run as part of a larger process
There are several PC-based testing tools. They allow you to carry out
regression testing. This is the rerunning of a test case or battery of test cases
after a change has been made, in order to verify that no inadvertent side
effects have been introduced.
The CA 2E Toolkit utilities include a number of tools that may be useful. When
testing to display or change data in database files or data areas, use the
following CA 2E Toolkit commands:
To enter debug for predefined sessions, or at any point, use the following CA
2E Toolkit commands:
To reset initial test conditions, use the CA 2E Toolkit Copy Files (YCPYF)
command.
For programs that change the database or carry out calculations in a nontrivial
way, test plans of predicted results should be prepared. Test plans should
combine as many test conditions as possible in as small of a volume of data as
possible.
Test packs of data (for example, files and data areas) each corresponding to a
set of test conditions, should be kept so that tests can be rerun.
Prepare a test pack of the data representing the initial state prior to running
the test. Ideally, a test pack is a self-contained library of files and data areas,
or a set of physical files.
Take a ‘snapshot’ of the test pack as it is prior to running the test. This may be
done in two ways:
using the CA 2E Toolkit Copy Files (YCPYF) utility. The Copy file utility
saves a list of database files.
Run the test and examine the output data. If an error is found, correct it,
restore from the ‘snapshot’, and rerun the test. You may restore the snapshot
either by using the OS/400 restore commands (RSTLIB, RSTOBJ) to restore
from your save file, or using the CA 2E Toolkit YCPYF command to restore
from your set of physical files.
You should have a means of looking at any database file that you are likely
to change. The CA 2E Toolkit Work with Files (YWRKF) command can be
useful in this respect.
You should have a means of listing the data from the main database files
before and after each test is run.
The Test Cycle—When testing, you will be going through an iterative cycle of
testing and error correction.
There are several techniques you can use to resume a test run, despite the
occurrence of errors:
Use the CA 2E Toolkit Work with Files (YWRKF) command to correct any
database fields that are preventing the completion of a test.
Error Reporting—In a live system, locating the cause of a bug is often more
difficult than actually fixing the bug. This is partly because the sort of bugs
that elude system testing tend to be obscure, and may only occur under
certain combinations of conditions, but also because they are often reported
by the end user, who quite naturally may not be adept at providing the
information that helps to characterize a bug. It is important, therefore, to have
an error reporting procedure that helps to capture as much information about
bugs as possible. The user should be trained in basic recording techniques.
Automatic techniques may also be used.
iSeries has a number of facilities that can be used to assist with problem
resolution. For example, the Question and Answer database may be used as a
basis for a computerized problem reporting system.
Include circumstantial information, such as what the user was doing at the
time.
Preserve the job log until the problem is resolved. A print of the log may
be obtained either by pressing the PRINT key while displaying the second
level messages, or by taking the OS/400 Sign Off command (SIGNOFF)
with LOGOFF(*LIST).
If you are operating on more than one machine, the Operating System version
levels, including Program Temporary Fix (PTF) levels, should be recorded. The
OS/400 Display Program Temporary Fix (DSPPTF) command can be used to
examine the applied fixes.
Parameters:
_______________ _________________________________
________________ _________________________________
________________ __________________________________
Errors:
________________ __________________________________
________________ __________________________________
________________ __________________________________
________________ __________________________________
Notes:
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
Considerations
Prescriptive and Descriptive Documentation—It is useful to
distinguish between prescriptive and descriptive documentation.
Documenting Commands
– Notes: Notes about any special considerations for using the command,
and information about any prerequisite or subsequent processing
steps.
2. With a Concepts Guide that discusses each area of the application system
and names the individual commands that are relevant to that area. The
concepts section provides an alternative access path for understanding the
purpose of individual commands in terms of the whole application system.
Messages
The first level text of diagnostic messages should state what the problem is.
The second level text should contain an explanation of the cause of the
problem and possible solutions.
Preparing Text
Use word processing and/or desktop publishing tools to write the additional
text needed to support an application. Ideally, you should have capabilities to
do the following:
Structuring Documentation
Using Sub-documents
Not: “Adding a new client and his address is a multi-step process in which
first the client is added using the new client display (unless the client was
already a supplier, in which case you use the conversion display); and
then add the address using the address display, although in the latter case
the final step is not necessary."
But rather: “This program lets you add new customers to the system”.
Not: “Before you can do this, you must first add a record, before you add
a record you must yourself be enrolled as a user, before which you must
decide who has enrollment rights.”
But rather: “To be able to do this you must first decide who has
enrollment rights, secondly get him to enroll you, and thirdly, add a
record.”
But rather: “When you press the HELP key the instructions for the
current panel will be displayed. If there is more than one page of
instructions, they may be displayed by pressing the ROLL key. Any data
that you have already entered will still be there when you return from the
Help Text display.
Where specialist terms are introduced, use the same term consistently.
Elegant variation is not required in computer manuals.
But rather: “Both the Edit source and the Edit text command may be
used to create or change Help text”.
Do not repeat what is already apparent from the context, nor that which
could be more efficiently described centrally (such as instructions on how
to use a workstation, how to display second level message text).
Not:
Ask yourself, ‘What are the questions which would be crossing the mind of
someone reading this?’
Terminology
Presentation Conventions
ALWCMDENT(*NO)
For example:
References to parameter keywords should be in upper case and bold type; for
example, LVLCHK(*NO), MAXMBRS(*NOMAX), SFLEND, and MSGID.
References to command keys should be in upper case and bold type, for
example, HELP, ROLLUP, ENTER, F3.
In text, spell out numbers under ten; for instance, nine turtle doves not 9
turtledoves; 13 characters not thirteen characters.
command diagrams
Punctuation
The abbreviations e.g. and i.e. should be avoided. If you do use them for
parenthetical information, use periods between the letters. Do not write
them as ie and eg. Terms such as for example and that is are preferred.
When the word not is being used as a contrast, use boldface type. For
instance:
— command diagrams
Examples
System letter:
Y: CA 2E
Functional letter:
M: Menu
O: Order entry subsystem
Mnemonic:
MB: member
DS: display
MN: menu
SF: subfile
CD: code
Objects:
YMMNDAP: Physical file
YMMNDAL1: Logical file view 1 on YMMNDAP
<%-2>YMMNDAL2: Logical file view 2 on YMMNDAP
Formats:
@@MNDAYQ: DBF format for YMMNDAP
#MNCD##: Panel format for an RPG program
Fields:
&SRCFILE: CLP Variable name used in a command
Library LIB LB
File F FL
Member MBR MB
Program PGM PG
System SYS SY
Data DTA DA
Month, monthly MM
Year, yearly YY
Date DTE DT
Code CDE CD
Number NBR NO
Time TME TM
Recommended Verbs
Add ADD AD
Allocate ALC AL
Analyse ANZ AZ
Answer ANS AW
Apply APP AP
Ask ASK AK
Build BLD BL
Call CALL CA
Cancel CN CN
Change CHG CH
Check CHK CK
Close/clear CLO/CLR CL
Compare CMP CM
Convert CVT CV
Copy CPY CP
Create/credit CRT CR
Deallocate DLC DA
Delay DLY\ DY
Delete DLT DL
Display DSP DS
Do DO DO
Document/declare DOC/DCL DC
Dump DMP DM
Duplicate DUP DP
Edit EDT ED
Eject EJC EJ
Encipher ENC
End END EN
Execute EXC EX
Recommended Verbs
Flag FLG FG
Format FMT FM
Generate GEN GN
Go GO GO
Grant GRT GR
Hold HLD HD
Initialize INZ IZ
Load LOD LD
Merge MRG MG
Monitor MON MN
Move MOV MV
Open OPN OP
Override OVR OV
Print PRT PR
Position POS Ps
Reclaim/receive RCL/RCV RC
Remove RMV RM
Rename RNM RN
Reorganize RGZ RZ
Replace RPL RP
Reroute RRT RR
Restore/resume RST/RSM RS
Retrieve/return RTV/RTN RT
Revoke RVK RV
Run RUN RU
Save SAV SV
Select SEL SL
Send SND SN
Recommended Verbs
Start/set STR/SET ST
Submit SBM SB
Trace TRC ST
Transfer TFR TF
Update UPD UP
Vary VRY VR
Verify VFY VF
Wait WAI WT
Work WRK WK
Authorization AUT AU
Batch BT
History HS
Job JOB JB
Journal JRN JR
Member list ML
Object OL
Program PGM PG
Panel PNL PN
Password PWD PW
Shop SH
Source SRC SR
Space SPCC SP
Stock SK
Transaction TRN TR
A ‘(DDMMYY)’ )
A $$DTFL R REFFLD(@@DTFL)
A COLHDG(‘File ‘ ‘date’ +
A ‘(YYMMDD)’ )
A $$DTYY R REFFLD(@@DTYY)
A COLHDG(‘Year’ ‘(YY)’)
I*
* FD - Field
A $$FD R REFFLD($$) COLHDG(‘Field’)
A $$FDDP 2 0 COLHDG(‘Decimal’ ‘places’)
A $$FDLN 5 0 COLHDG(‘Field’ ‘length’)
A $$FDRF 10 COLHDG(‘Referenced’ ‘field’)
A $$FDTP 1 COLHDG(‘Field’ ‘type’)
A $$FDVN 10 COLHDG(‘Field’ ‘name’)
*
I* FL - File
A $$FL R REFFLD($$) COLHDG(‘File’)
A $$FLVN R REFFLD(@@CDVN)
A COLHDG(‘File’ ‘name’ ‘(VN)’)
*
I* JB - Job
A $$JB R REFFLD($$) COLHDG(‘Job’)
A $$JBVN R REFFLD(@@CDVN)
A COLHDG(‘Job’ ‘code’ ‘(VN)’)
A $$JBDT R S REFFLD(@@DTDS)
A COLHDG(‘Job’ ‘date’)
A EDTWRD(‘ / / ‘)
A $$JBNO 6S 0 COLHDG(‘Job’ ‘number’ ‘(#)’)
A $$JBTM R S REFFLD(@@TMHS)
A COLHDG(‘Job time’ +
A ‘(HHMMSS)’)
A EDTWRD(‘ : : ‘)
A $$JBUS R REFFLD(@@CDVN)
A COLHDG(‘Job’ ‘user’ ‘(VN)’)
*
I* JD - Job description
A $$JD R REFFLD($$) COLHDG(‘Job +
A description’)
A $$JDVN R REFFLD(@@CDVN)
A COLHDG(‘Job’ ‘description’ +
A ‘(VN)’)
A $$JDLB R REFFLD(@@CDVN)
A COLHDG(‘Job’ ‘description’ +
A ‘library (VN)’)
*
I * JR - Journal
A $$JR R REFFLD($$) COLHDG(‘Journal’)
A $$JRCD 1 COLHDG(‘Journal’ ‘entry’ +
A ‘code’)
* Birth date
A K YQBTDT
* Gender code
A K YQSXCD
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
A 84 SFLNXTCHG
A #1SFSL 1 B 10 3VALUES(‘P’ ‘E’ ‘C’‘R’)
A CHECK(AB)
A #1SCSQ R B +2REFFLD($$SCSQ)
A CHANGE(46 ‘Prt Seq
Changed’)
A 31 DSPATR(RI PC)
A N31 DSPATR(UL HI)
A #1SCTL 50W B +2LOWER
A CHANGE(47 ‘Title
changed’)
A 32 DSPATR(RI PC)
A N32 DSPATR(UL HI)
A SASCVN R +2REFFLD($$SCVN)
DSPATR(HI)
*
A SASCSQ R H REFFLD($$SCSQ)
A* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
A R #SFCT#1 TEXT(‘Screen
selection’)
A BLINK OVERLAY
A SFLCTL(#SFRC#1)
A SFLPAG(09) SFLSIZ(11)
A INDTXT(80‘Clear
subfile)
A INDTXT(81 ‘Display SFL Rcd’)
A INDTXT(82 ‘Condition SLFEND)
A 80 SFLCLR
A N80 SFLDSPCTL
A N80 81 SFLDSP
A N80 81 82 SFLEND
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A N82 ROLLUP(27 ‘ROLL UP’)
A HOME(30 ‘HOME key.’)
*. . SETOFS . . . . . . . . . . . . . . . . . . . . . . . . . .
A SETOF(99 ‘Error - general’)
A SETOF(31 ‘Error on #1SCSQ’)
A SETOF(32 ‘Error on #1SCTL’)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* HELP TEXT
A HLPTITLE(‘Select screen’)
A H HLPARA(*NONE)
A HLPPNLGRP(‘ZSFCTZ1/PNL/INTRO
A YYEDSCH)
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Header fields
A H HLPARA(03 02 03 80)
A HLPPNLGRP(‘ZSFCTZ1/Z1SFSL’)
A YYEDSCH)
A H HLPARA(05 02 05 80)
A HLPPNLGRP(‘ZSFCTZ1/SASCVN’)
A YYEDSCH)
A H HLPARA(07 02 08 80)
A HLPPNLGRP(‘ZSFCTZ1/SASCSQ’)
A YYEDSCH)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Subfile columns
A H HLPARA(10 03 19 06)
A HLPPNLGRP(‘ZSFCTZ1/Z1SFSL’)
A YYEDSCH)
A H HLPARA(10 04 19 14)
A HLPPNLGRP(‘ZSFCTZ1/Z1SCVN’)
A YYEDSCH)
A H HLPARA(10 15 19 80)
A HLPPNLGRP(‘ZSFCTZ1/Z1SCSQ’)
A YYEDSCH)
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A #1SFRN 3 0H SFLRCDNBR(CURSOR)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A O 1 2 ‘YSELPNL’ COLOR(BLU)
A PNLTTL 050 1 12 DSPATR(HI)
A ##USVN R 1 62 REFFL($$USVN)DSPATR(HI)
A +1DATE EDTCDE(Y)DSPATR(HI)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Positioning value
A USR0020 30 3 3MSGID(USR0020 USRPMT)
* +1’.’
A ##SCVN R B +3REFFLD($$SCVN)
A CHANGE(41 ‘Seln screen’)
A UIS0005 20 +3MSGID(UIS0003 USRPMT)
* Subsetting value
A USR0022 30 4 3MSGID(USR0022 USRPMT)
* +1’.’
A ##SBVN R B +3REFFLD($$SCSQ)
A CHANGE(40 ‘Start seq’)
A UIS0010 20 +3MSGID(UIS0003 USRPMT)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Top instruction
A PNLTX1MSID 078 6 2MSGID(UIS0008 USRPMT)
A TEXT(‘TYPE OPTION,PRESS E’)
A COLOR(BLU)
A PNLTX2MSID 078 7 2MSGID(WUT2110 USRPMT)
A TEXT(‘1=Select’)
A COLOR(BLU)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Column Headings
A COLHD1MSID 078 9 2MSGID(WUT2111 USRPMT)
A DSPATR(HI)
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
A R #CMTX##1
A TEXT(‘Command key line’)
A OVERLAY
A HLPTITLE(‘Function keys’)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Command key explanations
A H HLPARA(22 01 23 80)
A HLPPNLGRP(‘ZCMTXZ1/BOTINS’)
A YYEDSCH)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A 83N88 MOREMSID 10 28 70MSGID(UIS0016 USRPMT)
A TEXT(‘more’)
A DSPATR(HI)
A 83 88 BOTTOMMSID 10 22 70MSGID(UIS0017 USRPMT)
A TEXT(‘BOTTOM’)
A DSPATR(HI)
A CMDTX1MSI 078 23 2MSGID(WLL2191 WPMTMSG)
A TEXT(‘F3=Exit’)
A COLOR(BLU)
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
A R #NODA##1 TEXT(‘NO DATA’)
A OVERLAY
A NODATAMSI 078 13 2MSGID(WUT2131 wPMTMSG)
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Type
A 1MSGCON(032 UIS0011 UPMTMSG)
A TEXT(‘Type’)
A +1’:’
A 40 +3’*PHY’
A 41 36’*LGL’
A 42 36’*DDSPF’
A 43 36’*PRTF’
A 44 36’*TAPF’
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A 1MSGCON(032 UIS0012 UPMTMSG)
A TEXT(‘Created’)
A +1’:’
A $$FCDT 6 0 +3EDTWRD(‘ / / 0’)
A $$FCTM 6 0 +1EDTWRD(‘0 : : ‘)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Column headings
A 1MSGCON(080 UIS0072 UPMTMSG)
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
A R $FDDA TEXT(‘Field details.’)
A SPACEA(1)
A INDTXT(91 ‘DETAIL(*FULL)’)
A 1’|’
A WHFDNM 10 2
A 12’|’
A WHFLDT 1 15
A 17’|’
A $$DCLN 3 1 20EDTCDE(4)
A 25’|’
A WHFDDB 5 0 26EDTCDE(Z)
A 32’|’
A 91 WHFDTX 50 33
A 91 83’|’
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
A R $ENDA TEXT(‘End of data.’)
A SPACEA(1)
A INDTXT(91 ‘DETAIL(*FULL)’)
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A 1MSGCON(070 UIS0055 UPMTMSG)
A TEXT(‘ENDOF REPORT’)
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* Entry variables */
DCL &FL *CHAR 20 /* MENU FILE/LIB */
DCL &FILE *CHAR 10 /* MENU FILE NAME */
DCL &FLIB *CHAR 10 /* LIBRARY NAME */
DCL &MBR *CHAR 10 /* MENU FILE/MBR */
/* Work variables */
DCL &KEYVAR *CHAR 4 /* MESSAGE KEY */
DCL &ERRCDE *CHAR 4 X’00000000’
F @SCDASA KRENAME@SCDASAI
* SA: SCREEN FILE (0|SCSQ|SCVN)
*
FYDSCDAP UF E K DISK
F @SCDASA KRENAME@SCDASAU
* SA: SCREEN FILE (0|SCSQ|SCVN)
*
/EJECT
C DO *HIVAL
* DISPLAY SCREEN
C EXSR CAEXFM
*
* PROCESS RESPONSE FROM SCREEN
* CA01: CANCEL & EXIT
C 01 CAS KAEXKY CAS
* CF05: COPY SCREEN
C 05 CAS EGINSC
* SCREEN NAME ENTERED
C 41 CAS DASCVN
/EJECT
CSR BAIZSF BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* CLEAR SUBFILE, POSITION FILE
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* CLEAR SUBFILE
C SETON 80
C WRITE#SFCT#1
C SETOF 80
* RESET NO OF RECS IN SUBFILE & CURRENT POSITION
C Z-ADD*ZERO #1RR 50 81 SETOF 81
C Z-ADD*ZERO #1RRMX 50 SETOF 81
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
* POSITION FILE
C ##NXSQ SETLL@SCDASAI 81 *
C 81 MOVE *BLANK SASCVN
* LOAD PAGE.
C EXSR BBLDSF
*
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CSR BAEXIT ENDSR
/EJECT
CSR BBLDSF BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* LOAD SUBFILE WITH ONE MORE PAGE OF #1PGSZ RECORDS.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* START AT PREVIOUS LAST RECORD
C Z-ADD#1RRMX #1RR
C SETOF 67*
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
* READ UP TO A SF PAGE AT A TIME
C 1 DO #1PGSZ DO
C READ @SCDASAI 81 CODE ORDER
* FOR EACH RECORD READ :
C N81 DO DO
* CANCEL ROLLUP AS SUCCESSFULLY ACTIONED.
C SETOF 27*
* OUTPUT TO SUBFILE
C MOVE *BLANK #1XX
C Z-ADDSASCSQ ##SCSQ
C MOVELSASCDA ##SCTL
C ADD 1 #1RR 81 81=DSPSFLREC
C SETON 67
C WRITE#SFRC#1
C END OD : *N81
*
C N81 END OD 1 - #1PGSZ
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
* DISPLAY ERROR MESSAGE IF NO RECORDS FOUND,
C 81 #1RR IFEQ *ZERO IF
C MOVE ‘YYY7104’ MSGID NO RECORDS
C EXSR ZASNMS
C ELSE XFI #1RR = 0
* DISPLAY MESSAGE IF ROLL UP & NO MORE TO ROLL-UP
C 27 SETON 55
C END FI #1RR = 0
*
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
SAVE POSITION SO LOAD CAN CONTINUE AT END POINT
C 67 DO
C #1RRMX ADD 1 #1SFRN *
C Z-ADD#1RR #1RRMX
C END OD 67
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CSR BBEXIT ENDSR
/EJECT
CSR CAEXFM BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* DISPLAY SCREEN
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
C DO *HIVAL
* DISPLAY MESSAGES & COMMAND KEY LINE
C WRITE#SFCT#Q MESSAGES
* DISPLAY SCREEN.
C EXFMT#SFCT#1 SFL CTL
*
* CLEAR MESSAGES PROM PROGRAM MESSAGE QUEUE
C EXSR ZBCLMS
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/EJECT
CSR DASCVN BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* SPECIFIED SCREEN NAME ENTERD.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
C ##SCVN CABEQ*BLANK DAEXIT
C MOVE ##SCVN SASCVN
C MOVE ‘X’ #1XX
* EXIT PROGRAM WITH SELECTED SCREEN NAME.
C EXSR EBSLLN
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*
* RE-LOAD SFL IF ORDER CHANGED.
C WWRLSF IFEQ ‘Y’ IF
* COPY COMP MESSAGES TO *PRV
C EXSR ZECMMS
* REDISLAY SUBFILE (DUE TO CHANGED CONTENTS).
C Z-ADD*ZERO ##NXSQ
C EXSR BAIZSF * RELOAD
C END FI WWRFSF=’Y’
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CSR EAEXIT ENDSR
/EJECT
CSR EBSLLN BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* SELECT LINE & RETURN.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* EXIT WITH SELECTED SCREEN
C MOVE SASCVN $$SCVN
C SETON LR*
C RETRN
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
C KFLD SASCSQ
C MOVE ‘1’ WKSCTP
C KSCDAP CHAIN@SCDASAU 60
C Z-ADD##SCSQ SASCSQ
C MOVEL##SCTL SASCDA
C UPDAT@SCDASAU
C 46 MOVE ‘Y’ WWRLSF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CSR EDEXIT ENDSR
/EJECT
CSR EGINSC BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* INCLUDE SCREEN
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* YCPYSCR COMMAND STRING MESSAGE.
* THIS STRING CONTAINS COMMAND PROMPTING INFO.
C MOVE ‘YSD0015’ MSGID
C MOVE *BLANK SASCVN
* EXECUTE OPTION.
C EXSR FAEXOP
C N60 DO DO
* COPY COMP MESSAGES TO *PRV
C EXSR ZECMMS
* REDISLAY SUBFILE (DUE TO CHANGED CONTENTS).
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CSR ZCEXIT ENDSR
/EJECT
CSR ZECMMS BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* COPY COMP MESSAGES TO *PRV CPP.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
C CALL ‘YYCMMSC’
C PARM ‘YDSCEDC@’W10X 10 I: PGM Q NAME
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CSR ZEEXIT ENDSR
/EJECT
CSR ZZINIT BEGSR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* INITIALISATION
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
C MOVE *BLANK $RTCD
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
* SETUP MESSAGE SUBSTITUTION DATA.
C
C MOVE $$LBVN WMLBVN
C MOVE $$MBVN WMMBVN
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
* GET COMPANY NAME.
C *NAMVAR DEFN YYCOTXA YYCOTX
C IN *NAMVAR
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
* SUBFILE PAGE SIZE
C Z-ADD15 #1PGSZ 30 !!
* SUBFILE INITIAL RECORD AT
C Z-ADD1 #1SFRN SFL POSN
C Z-ADD*ZERO #1RRMX MAX RECNO
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*
*
SELECT UUAIREL1
ASSIGN TO DATABASE-UUAIREL1
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS EXTERNALLY-DESCRIBED-KEY
01 WKIND0-A.
03 WKIND0 PIC 1(1) OCCURS 3.
01 WKIND1-A.
03 WKIND1 PIC 1(1) OCCURS 3.
01 ZZRROK PIC S9(5) COMP-3.
01 CAIN89 PIC 1(1).
01 CAIN81 PIC 1(1).
01 ZAPGM PIC X(10).
01 ZAPGRL PIC X(5).
01 ZAFSMS PIC X(1).
01 WKIPIN PIC X(1).
01 W0DCF PIC X(1).
01 W0NLR PIC X(1).
01 WN30-A.
03 WN30 PIC 1(1) OCCURS 30.
01 IND-COUNT PIC S9(5) COMP-3.
01 ZADFMF PIC X(10).
01 DATA-AREA-NAME PIC X(10).
01 ZZSFPG PIC S9(3).
01 W0PMD PIC X(3).
88 C-ADD-MODE VALUE ‘ADD’.
88 C-CHANGE-MODE VALUE ‘CHG’.
88 C-SELECT-MODE VALUE ‘SEL’.
01 ZAMSID PIC X(7).
01 ZAMSGF PIC X(10).
01 ZAMSDA PIC X(132).
01 ZAMSTP PIC X(7).
01 ZZRR PIC 9(5) COMP-3.
01 UUB7EFK-I-O-DSPF.
COPY DDS-ALL-FORMATS OF Y2IDSPFIO.
* Subfile I/O feedback area
*
01 MAJOR-MINOR-CODE.
COPY DDS-ALL-FORMATS OF Y2IMAJMIN.
* Display major/minor code for timeouts
*
01 UUAIREL1-OPEN.
COPY DDS-ALL-FORMATS OF Y2IOPEN.
* Open feedback area
*
01 UUAIREL0-OPEN.
COPY DDS-ALL-FORMATS OF Y2IOPEN.
* Open feedback area
*
01 UUB7EFK-WS-O.
03 ZSFLRCD-WS-O.
COPY DDS-ZSFLRCD-O OF UUB7EFK.
06 FILLER PIC X.
03 ZSFLCTL-WS-O.
COPY DDS-ZSFLCTL-O OF UUB7EFK.
06 FILLER PIC X.
03 ZCMDTXT1-WS-O.
COPY DDS-ZCMDTXT1-O OF UUB7EFK.
06 FILLER PIC X.
03 ZMSGCTL-WS-O.
COPY DDS-ZMSGCTL-O OF UUB7EFK.
06 FILLER PIC X.
03 ZCONFIRM-WS-O.
COPY DDS-ZCONFIRM-O OF UUB7EFK.
06 FILLER PIC X.
01 UUB7EFK-WS-I.
03 ZSFLRCD-WS-I.
COPY DDS-ZSFLRCD-I OF UUB7EFK.
06 FILLER PIC X.
03 ZSFLCTL-WS-I.
COPY DDS-ZSFLCTL-I OF UUB7EFK.
06 FILLER PIC X.
03 ZCMDTXT1-WS-I.
COPY DDS-ZCMDTXT1-I OF UUB7EFK.
06 FILLER PIC X.
03 ZMSGCTL-WS-I.
COPY DDS-ZMSGCTL-I OF UUB7EFK.
06 FILLER PIC X.
03 ZCONFIRM-WS-I.
COPY DDS-ZCONFIRM-I OF UUB7EFK.
06 FILLER PIC X.
01 W0OPN PIC X(1).
* Indicators
01 INDICS.
03 IND PIC 1(1) OCCURS 990INDICATOR 1.
88 C-INDICATOR-ON VALUE B’1’.
88 C-INDICATOR-OFF VALUE B’0’.
*
/EJECT
** * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LINKAGE SECTION.
* Return code
01 P0RTN PIC X(7).
** * * * * * * * ** * * * * * * * * * * * * * * * * * * * *
PROCEDURE DIVISION USING
P0RTN.
** * * * * * * * * * * * * * * * * * * * * * * * * * ** * *
MAINLINE SECTION.
* Initialise
PERFORM ZZINIT
*
* Initialisation
MOVE ZZPGM OF JOB-CONTEXT TO ZZPGM OF ZMSGCTL-WS-O
* Main loop
PERFORM ZXEXPG
* HOME: Request subfile reload
ELSE IF (C-INDICATOR-ON(30)) THEN
PERFORM FBRQRL
* Display next sfl page
ELSE IF (C-INDICATOR-ON(27)) THEN
PERFORM BBLDSF
ELSE
* Process screen input
PERFORM DAPRZZ
*
END-IF END-IF END-IF
END-PERFORM
*
END-PERFORM
.
MAINLINE-EXIT.
EXIT.
** * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/EJECT
BAIZSF SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Initialise & Load subfile page
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Clear subfile
SET C-INDICATOR-ON(80) TO TRUE
WRITE UUB7EFK-F FROM ZSFLCTL-WS-O
FORMAT IS ‘ZSFLCTL’ INDICATORS ARE INDICS
END-WRITE
* Reset count of no of records in SFL
MOVE ZERO TO ZZRRMX
SET C-INDICATOR-OFF(81) TO TRUE
* If CHANGE mode, then position file:
IF (NOT C-ADD-MODE) THEN
* customer code
IF (C-IO-ERR) THEN
STOP RUN
END-IF
IF (C-EOF) THEN
SET C-INDICATOR-ON(82) TO TRUE
ELSE
SET C-INDICATOR-OFF(82) TO TRUE
SET C-INDICATOR-OFF(91) TO TRUE
READ UUAIREL1 NEXT
FORMAT IS ‘FAIREA4’
END-READ
IF (C-EOF) THEN
SET C-INDICATOR-ON(82) TO TRUE
ELSE
IF (C-IO-ERR) THEN
SET C-INDICATOR-ON(91) TO TRUE
END-IF
END-IF
IF (C-IO-OK) THEN
MOVE CORRESPONDING
FAIREA4 OF UUAIREL1 TO
FAIREA3 OF Y1DBRC
END-IF
END-IF
ELSE
SET C-INDICATOR-OFF(82) TO TRUE
END-IF
* Load subfile page
PERFORM BBLDSF
*. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* If no records found, display error message
IF (C-INDICATOR-ON(82) AND
BBLDSF SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Load subfile page (write empty page if add mode).
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
SET C-INDICATOR-OFF(84) TO TRUE
* No SFLNXTCHG
* Re-establish fields in read-ahead record
IF (C-INDICATOR-ON(27)) THEN
IF (C-INDICATOR-OFF(82) AND
NOT C-ADD-MODE) THEN
SET C-INDICATOR-OFF(90) TO TRUE
READ UUAIREL1 PRIOR
FORMAT IS ‘FAIREA4’
END-READ
IF (C-EOF) THEN
SET C-INDICATOR-ON(90) TO TRUE
ELSE
IF (C-IO-ERR) THEN
STOP RUN
END-IF
END-IF
SET C-INDICATOR-OFF(90) TO TRUE
READ UUAIREL1 NEXT
FORMAT IS ‘FAIREA4’
END-READ
IF (C-EOF) THEN
SET C-INDICATOR-ON(90) TO TRUE
ELSE
IF (C-IO-ERR) THEN
STOP RUN
END-IF
END-IF
MOVE CORRESPONDING
FAIREA4 OF UUAIREL1 TO
FAIREA3 OF Y1DBRC
END-IF
END-IF
* Setof record error indicators
MOVE ALL B’0’ TO WKIND1-A
MOVE ALL B’1’ TO WKIND1-A
* Start at previous highest SFL record reached
MOVE ZZRRMX TO ZZRR
MOVE ZERO TO ZZRROK
*. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Load next page of SFL:
PERFORM UNTIL NOT (C-INDICATOR-OFF(82) AND
ZZRROK ZZSFPG)
MOVE WKIND0(1) TO IND(32)
MOVE WKIND0(2) TO IND(33)
MOVE WKIND0(3) TO IND(34)
SET C-INDICATOR-OFF(87) TO TRUE
* Clear SFL fields
PERFORM MAIZZ1
* If change mode, load SFL fields
IF (NOT C-ADD-MODE) THEN
PERFORM MBFLZ1
END-IF
* Output to subfile
ADD 1 TO ZZRR
IF (ZZRR ZERO) THEN
SET C-INDICATOR-ON(81) TO TRUE
ELSE
SET C-INDICATOR-OFF(81) TO TRUE
END-IF
ADD 1 TO ZZRROK
* Set screen conditioning indicators
PERFORM GADSA1
WRITE SUBFILE UUB7EFK-F FROM ZSFLRCD-WS-O
FORMAT IS ‘ZSFLRCD’ INDICATORS ARE INDICS
END-WRITE
IF (NOT C-ADD-MODE) THEN
SET C-INDICATOR-OFF(82) TO TRUE
READ UUAIREL1 NEXT
FORMAT IS ‘FAIREA4’
END-READ
IF (C-EOF) THEN
SET C-INDICATOR-ON(82) TO TRUE
ELSE
IF (C-IO-ERR) THEN
STOP RUN
END-IF
END-IF
MOVE CORRESPONDING
FAIREA4 OF UUAIREL1 TO
FAIREA3 OF Y1DBRC
END-IF
END-PERFORM
*. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
* Save highest SFL rec, so load can continue at end point
IF (ZZRR ZZRRMX) THEN
ADD 1, ZZRRMX GIVING ZZSFRC OF ZSFLCTL-WS-O
MOVE ZZRR TO ZZRRMX
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
BBEXIT.
EXIT.
/EJECT
CAEXFM SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Display screen
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Set screen conditioning indicators
PERFORM GBDSA2
* Update screen time
ACCEPT ZZTIME FROM TIME
MOVE ZZHNS TO ZZTME OF ZSFLCTL-WS-O
* PUTOVR unless conditioned fields change
SET C-INDICATOR-ON(86) TO TRUE
ZSFLCTL-O OF ZSFLCTL-WS-O
* Update job time
ACCEPT ZZTIME FROM TIME
MOVE ZZHNS TO ZZJTM
* Clear messages from program message queue
MOVE ZZPGM OF JOB-CONTEXT TO ZAPGM
MOVE ‘*SAME’ TO ZAPGRL
CALL ‘Y2CLMSC’ USING
ZAPGM
ZAPGRL
END-CALL
* Reset first message only flag
MOVE ‘Y’ TO ZAFSMS
SET C-INDICATOR-OFF(99) TO TRUE
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
CAEXIT.
EXIT.
/EJECT
DAPRZZ SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Process screen input
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Maintain subfile position where possible
ACCEPT UUB7EFK-I-O-DSPF FROM I-O-FEEDBACK-AREA
FOR UUB7EFK
IF (ZZSFRC OF UUB7EFK-I-O-DSPF ZERO) THEN
MOVE ZZSFRC OF UUB7EFK-I-O-DSPF TO ZZSFRC OF
ZSFLCTL-WS-O
END-IF
IF (NOT C-ADD-MODE) THEN
DAEXIT.
EXIT.
/EJECT
DBPRSF SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Process modified subfile records
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
READ SUBFILE UUB7EFK NEXT MODIFIED INTO ZSFLRCD-WS-I
FORMAT IS ‘ZSFLRCD’ INDICATORS ARE INDICS
END-READ
IF (C-NO-MOD-SFLRCDS) THEN
SET C-INDICATOR-ON(92) TO TRUE
ELSE
SET C-INDICATOR-OFF(92) TO TRUE
MOVE CORRESPONDING
ZSFLRCD-I OF ZSFLRCD-WS-I TO
ZSFLRCD-O OF ZSFLRCD-WS-O
END-IF
PERFORM UNTIL NOT (C-INDICATOR-OFF(92))
PERFORM DCPRSR
SET C-INDICATOR-OFF(87) TO TRUE
* Set screen conditioning indicators
PERFORM GADSA1
REWRITE SUBFILE UUB7EFK-F FROM ZSFLRCD-WS-O
FORMAT IS ‘ZSFLRCD’ INDICATORS ARE INDICS
END-REWRITE
READ SUBFILE UUB7EFK NEXT MODIFIED INTO ZSFLRCD-WS-I
FORMAT IS ‘ZSFLRCD’ INDICATORS ARE INDICS
END-READ
MOVE CORRESPONDING
ZSFLRCD-I OF ZSFLRCD-WS-I TO
ZSFLRCD-O OF ZSFLRCD-WS-O
IF (C-NO-MOD-SFLRCDS) THEN
SET C-INDICATOR-ON(92) TO TRUE
ELSE
SET C-INDICATOR-OFF(92) TO TRUE
END-IF
END-PERFORM
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
DBEXIT.
EXIT.
/EJECT
DCPRSR SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Process subfile record
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Setoff error indicators
MOVE WKIND0(1) TO IND(32)
MOVE WKIND0(2) TO IND(33)
MOVE WKIND0(3) TO IND(34)
* SFLRCD error
SET C-INDICATOR-OFF(98) TO TRUE
* NO SFLNXTCHG
SET C-INDICATOR-OFF(84) TO TRUE
IF (C-ADD-MODE) THEN
* Check for null record
PERFORM DDNLRC
IF (W0NLR = ‘Y’) THEN
GO DCEXIT
END-IF
* If not null record, continue
END-IF
* Data entered
MOVE ‘Y’ TO WKIPIN
* 84 SFLNXTCHG
SET C-INDICATOR-ON(84) TO TRUE
* If delete request, bypass validation
* Validate subfile record
PERFORM DEV1RC
* If SFLRCD invalid, note the fact
IF (C-INDICATOR-ON(98) AND
C-INDICATOR-OFF(99)) THEN
MOVE ZZRR TO ZZSFRC OF ZSFLCTL-WS-O
IF (ZZSFRC OF ZSFLCTL-WS-O ZERO) THEN
SET C-INDICATOR-ON(99) TO TRUE
ELSE
SET C-INDICATOR-OFF(99) TO TRUE
END-IF
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
DCEXIT.
EXIT.
/EJECT
DDNLRC SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Check for null record
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE ‘N’ TO W0NLR
* customer code
IF (Z1AICD OF ZSFLRCD-WS-O NOT = SPACES) THEN
GO DDEXIT
END-IF
* customer name
IF (Z1APTX OF ZSFLRCD-WS-O NOT = SPACES) THEN
GO DDEXIT
END-IF
MOVE ‘Y’ TO W0NLR
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
DDEXIT.
EXIT.
/EJECT
DEV1RC SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Validate subfile record
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* customer code required
IF (Z1AICD OF ZSFLRCD-WS-O = SPACES) THEN
SET C-INDICATOR-ON(98) TO TRUE
SET C-INDICATOR-ON(33) TO TRUE
* Send message ‘*Value required’
* Message ID
MOVE ‘Y2U0001’ TO ZAMSID
* Message file.
MOVE ‘Y2USRMSG’ TO ZAMSGF
PERFORM ZASNMS
END-IF
* customer name required
IF (Z1APTX OF ZSFLRCD-WS-O = SPACES) THEN
SET C-INDICATOR-ON(98) TO TRUE
SET C-INDICATOR-ON(34) TO TRUE
* Send message ‘*Value required’
* Message ID
MOVE ‘Y2U0001’ TO ZAMSID
* Message file.
MOVE ‘Y2USRMSG’ TO ZAMSGF
PERFORM ZASNMS
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
DEEXIT.
EXIT.
/EJECT
DHPRCF SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Prompt for confirm
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Set screen conditioning indicators
PERFORM GBDSA2
* Update screen time
ACCEPT ZZTIME FROM TIME
MOVE ZZHNS TO ZZTME OF ZSFLCTL-WS-O
* Force PUTOVR
SET C-INDICATOR-ON(86) TO TRUE
WRITE UUB7EFK-F FROM ZMSGCTL-WS-O
FORMAT IS ‘ZMSGCTL’ INDICATORS ARE INDICS
END-WRITE
WRITE UUB7EFK-F FROM ZCMDTXT1-WS-O
FORMAT IS ‘ZCMDTXT1’ INDICATORS ARE INDICS
END-WRITE
WRITE UUB7EFK-F FROM ZSFLCTL-WS-O
END-WRITE
MOVE SPACES TO ZZCFCD OF UUB7EFK-WS-O
MOVE ‘N’ TO ZZCFCD OF UUB7EFK-WS-O
* Save CMD keys
MOVE INDICS TO WN30-A
WRITE UUB7EFK-F FROM ZCONFIRM-WS-O
FORMAT IS ‘ZCONFIRM’ INDICATORS ARE INDICS
END-WRITE
READ UUB7EFK INTO ZCONFIRM-WS-I
FORMAT IS ‘ZCONFIRM’ INDICATORS ARE INDICS
END-READ
MOVE CORRESPONDING
ZCONFIRM OF ZCONFIRM-WS-I TO
ZCONFIRM OF ZCONFIRM-WS-O
* Restore CMD keys
MOVE 1 TO IND-COUNT
SET CONDITION-FALSE TO TRUE
PERFORM UNTIL (CONDITION-TRUE)
MOVE WN30(IND-COUNT) TO IND(IND-COUNT)
ADD 1 TO IND-COUNT
IF (IND-COUNT 30)
SET CONDITION-TRUE TO TRUE
END-IF
END-PERFORM
* Update job time
ACCEPT ZZTIME FROM TIME
MOVE ZZHNS TO ZZJTM OF JOB-CONTEXT
IF (ZZCFCD OF UUB7EFK-WS-O NOT = ‘Y’) THEN
SET C-INDICATOR-ON(99) TO TRUE
ELSE
SET C-INDICATOR-OFF(99) TO TRUE
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
DHEXIT.
EXIT.
/EJECT
EAPRSF SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Update DBF from subfile records
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Initialise subfile reload flag
IF (C-ADD-MODE) THEN
MOVE ‘Y’ TO W0RSF
ELSE
MOVE ‘N’ TO W0RSF
END-IF
* Process all modified subfile records
READ SUBFILE UUB7EFK NEXT MODIFIED INTO ZSFLRCD-WS-I
FORMAT IS ‘ZSFLRCD’ INDICATORS ARE INDICS
END-READ
IF (C-NO-MOD-SFLRCDS) THEN
SET C-INDICATOR-ON(92) TO TRUE
ELSE
SET C-INDICATOR-OFF(92) TO TRUE
MOVE CORRESPONDING
ZSFLRCD-I OF ZSFLRCD-WS-I TO
ZSFLRCD-O OF ZSFLRCD-WS-O
END-IF
PERFORM UNTIL NOT (C-INDICATOR-OFF(92))
* Process modified subfile record
PERFORM EBPRSR
MOVE SPACES TO Z1SEL OF ZSFLRCD-WS-O
* Set screen conditioning indicators
PERFORM GADSA1
REWRITE SUBFILE UUB7EFK-F FROM ZSFLRCD-WS-O
FORMAT IS ‘ZSFLRCD’ INDICATORS ARE INDICS
END-REWRITE
READ SUBFILE UUB7EFK NEXT MODIFIED INTO ZSFLRCD-WS-I
FORMAT IS ‘ZSFLRCD’ INDICATORS ARE INDICS
END-READ
MOVE CORRESPONDING
ZSFLRCD-I OF ZSFLRCD-WS-I TO
ZSFLRCD-O OF ZSFLRCD-WS-O
IF (C-NO-MOD-SFLRCDS) THEN
SET C-INDICATOR-ON(92) TO TRUE
ELSE
SET C-INDICATOR-OFF(92) TO TRUE
END-IF
END-PERFORM
* If any errors, cancel reload
IF (C-INDICATOR-ON(99)) THEN
MOVE ‘N’ TO W0RSF
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
EAEXIT.
EXIT.
/EJECT
EBPRSR SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Process modified subfile record
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Set off error indicators
* Clear errors
MOVE WKIND0(1) TO IND(32)
MOVE WKIND0(2) TO IND(33)
MOVE WKIND0(3) TO IND(34)
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
EDEXIT.
EXIT.
/EJECT
EECHRQ SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Process update request
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* USER: Change DBF record
*
* Change object - customer file *
*
PERFORM SCCHRC
IF (W0RTN NOT = SPACES) THEN
* DBF Update error detected
* Screen errors
MOVE WKIND1(1) TO IND(32)
MOVE WKIND1(2) TO IND(33)
MOVE WKIND1(3) TO IND(34)
* Format Error
SET C-INDICATOR-ON(98) TO TRUE
* Enable entry
SET C-INDICATOR-OFF(87) TO TRUE
* SFLNXTCHG
SET C-INDICATOR-ON(84) TO TRUE
* Reset subfile record if changed record
IF (W0RTN = ‘Y2U0007’) THEN
MOVE CORRESPONDING
FAIREA3 OF UUAIREL0 TO
FAIREA4
PERFORM MBFLZ1
END-IF
ELSE
* DBF Update successful
* Enable entry
SET C-INDICATOR-OFF(87) TO TRUE
* No SFLNXTCHG
SET C-INDICATOR-OFF(84) TO TRUE
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
EEEXIT.
EXIT.
/EJECT
FACHMD SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Flip between *ADD and *CHANGE modes
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
IF (NOT C-ADD-MODE) THEN
SET C-ADD-MODE TO TRUE
ELSE
SET C-CHANGE-MODE TO TRUE
END-IF
PERFORM FBRQRL
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
FAEXIT.
EXIT.
/EJECT
FBRQRL SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Request subfile reload
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE ‘Y’ TO W0RSF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
FBEXIT.
EXIT.
/EJECT
GADSA1 SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Set display attributes for Subfile record
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
IF (C-ADD-MODE) THEN
SET C-INDICATOR-ON(89) TO TRUE
ELSE
SET C-INDICATOR-OFF(89) TO TRUE
END-IF
* Protect keys if change mode or updated record
IF (C-INDICATOR-ON(89) AND
C-INDICATOR-OFF(87)) THEN
SET C-INDICATOR-OFF(88) TO TRUE
ELSE
SET C-INDICATOR-ON(88) TO TRUE
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
GAEXIT.
EXIT.
/EJECT
GBDSA2 SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Set display attributes for Subfile control
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
IF (C-ADD-MODE) THEN
SET C-INDICATOR-ON(89) TO TRUE
ELSE
SET C-INDICATOR-OFF(89) TO TRUE
END-IF
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
GBEXIT.
EXIT.
/EJECT
MAIZZ1 SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Initialise subfile record
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE SPACES TO Z1DBRC OF UUB7EFK-WS-O
MOVE SPACES TO Z1SEL OF ZSFLRCD-WS-O
MOVE SPACES TO Z1AICD OF ZSFLRCD-WS-O
MOVE SPACES TO Z1APTX OF ZSFLRCD-WS-O
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
MAEXIT.
EXIT.
/EJECT
MBFLZ1 SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Move FAIREA4 fields to subfile
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* customer code
MOVE AIAICD OF FAIREA4 TO Z1AICD OF ZSFLRCD-WS-O
* customer name
MOVE AIAPTX OF FAIREA4 TO Z1APTX OF ZSFLRCD-WS-O
* Hold current record image for change detection
MOVE Y1DBRC TO Z1DBRC OF ZSFLRCD-WS-O
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
MBEXIT.
EXIT.
/EJECT
MEIZZ2 SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Initialise subfile control
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE SPACES TO Z2AICD OF ZSFLCTL-WS-O
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
MEEXIT.
EXIT.
/EJECT
SACRRC SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Create object - customer file *
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE SPACES TO W0RTN
* Move all fields to FAIREA3
* customer code
MOVE Z1AICD OF ZSFLRCD-WS-O TO AIAICD OF UUAIREL0-R
* customer name
MOVE Z1APTX OF ZSFLRCD-WS-O TO AIAPTX OF UUAIREL0-R
*
* Check for duplicate primary key
START UUAIREL0 KEY = EXTERNALLY-DESCRIBED-KEY
FORMAT IS ‘FAIREA3’
END-START
IF (NOT C-NO-RECORD) THEN
SET C-INDICATOR-ON(90) TO TRUE
MOVE ‘USR0028’ TO W0RTN
* Send message ‘customer file EX’
* Message ID
MOVE ‘USR0028’ TO ZAMSID
PERFORM ZASNMS
GO SAEXIT
ELSE
SET C-INDICATOR-OFF(90) TO TRUE
END-IF
*
WRITE UUAIREL0-R END-WRITE
IF (C-IO-ERR) THEN
SET C-INDICATOR-ON(91) TO TRUE
* Write error detected
MOVE ‘Y2U0004’ TO W0RTN
ELSE
SET C-INDICATOR-OFF(91) TO TRUE
* DBF Write successful
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Delete object - customer file *
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE SPACES TO W0RTN
* Move key fields to FAIREA3
* customer code
MOVE Z1AICD OF ZSFLRCD-WS-O TO AIAICD OF UUAIREL0-R
*
READ UUAIREL0 END-READ
IF (C-NO-RECORD) THEN
SET C-INDICATOR-ON(90) TO TRUE
ELSE
SET C-INDICATOR-OFF(90) TO TRUE
END-IF
IF (C-IO-ERR) THEN
SET C-INDICATOR-ON(91) TO TRUE
ELSE
SET C-INDICATOR-OFF(91) TO TRUE
END-IF
IF (C-IO-OK) THEN
MOVE CORRESPONDING
FAIREA3 OF UUAIREL0 TO
FAIREA3 OF Y1DBRC
END-IF
*
IF (C-INDICATOR-ON(90)) THEN
* Record already deleted
MOVE ‘Y2U0009’ TO W0RTN
* Send message ‘*Record no longer on file’
* Message ID
MOVE ‘Y2U0009’ TO ZAMSID
* Message file.
MOVE ‘Y2USRMSG’ TO ZAMSGF
PERFORM ZASNMS
GO SBEXIT
ELSE
CONTINUE
END-IF
*
IF (C-INDICATOR-ON(91)) THEN
* Record locked
MOVE ‘Y2U0004’ TO W0RTN
GO SBEXIT
ELSE
CONTINUE
END-IF
*
* Check for changed record
IF (Z1DBRC OF ZSFLRCD-WS-O NOT = Y1DBRC) THEN
MOVE ‘Y2U0007’ TO W0RTN
* Send message ‘*Update not accepted’
* Message ID
MOVE ‘Y2U0007’ TO ZAMSID
* Message file.
MOVE ‘Y2USRMSG’ TO ZAMSGF
PERFORM ZASNMS
* Use SETLL to release record lock
START UUAIREL0 KEY = EXTERNALLY-DESCRIBED-KEY
FORMAT IS ‘FAIREA3’
END-START
IF (C-NO-RECORD) THEN
SET C-INDICATOR-ON(90) TO TRUE
ELSE
SET C-INDICATOR-OFF(90) TO TRUE
IF (C-IO-ERR) THEN
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
SBEXIT.
EXIT.
/EJECT
SCCHRC SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Change object - customer file *
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE SPACES TO W0RTN
* Move key fields to FAIREA3
* customer code
MOVE Z1AICD OF ZSFLRCD-WS-O TO AIAICD OF UUAIREL0-R
*
READ UUAIREL0 END-READ
IF (C-NO-RECORD) THEN
SET C-INDICATOR-ON(90) TO TRUE
* Record not found
MOVE ‘Y2U0009’ TO W0RTN
* Send message ‘*Record no longer on file’
* Message ID
MOVE ‘Y2U0009’ TO ZAMSID
* Message file.
MOVE ‘Y2USRMSG’ TO ZAMSGF
PERFORM ZASNMS
GO SCEXIT
ELSE
SET C-INDICATOR-OFF(90) TO TRUE
IF (C-IO-ERR) THEN
SET C-INDICATOR-ON(91) TO TRUE
* Record locked
MOVE ‘Y2U0004’ TO W0RTN
GO SCEXIT
ELSE
SET C-INDICATOR-OFF(91) TO TRUE
IF (C-IO-OK) THEN
MOVE CORRESPONDING
FAIREA3 OF UUAIREL0 TO
FAIREA3 OF Y1DBRC
END-IF
END-IF
END-IF
*
* Check for changed record
IF (Z1DBRC OF ZSFLRCD-WS-O NOT = Y1DBRC) THEN
MOVE ‘Y2U0007’ TO W0RTN
* Send message ‘*Update not accepted’
* Message ID
MOVE ‘Y2U0007’ TO ZAMSID
* Message file.
MOVE ‘Y2USRMSG’ TO ZAMSGF
PERFORM ZASNMS
* Use SETLL to release record lock
START UUAIREL0 KEY = EXTERNALLY-DESCRIBED-KEY
FORMAT IS ‘FAIREA3’
END-START
IF (C-NO-RECORD) THEN
SET C-INDICATOR-ON(90) TO TRUE
ELSE
SET C-INDICATOR-OFF(90) TO TRUE
IF (C-IO-ERR) THEN
SET C-INDICATOR-ON(91) TO TRUE
ELSE
SET C-INDICATOR-OFF(91) TO TRUE
END-IF
END-IF
GO SCEXIT
END-IF
* Move Non-key fields to FAIREA3
* customer name
MOVE Z1APTX OF ZSFLRCD-WS-O TO AIAPTX OF UUAIREL0-R
*
REWRITE UUAIREL0-R END-REWRITE
IF (NOT C-IO-OK) THEN
SET C-INDICATOR-ON(91) TO TRUE
* Change error detected
MOVE ‘Y2U0004’ TO W0RTN
ELSE
SET C-INDICATOR-OFF(91) TO TRUE
* DBF Change successful
* Update saved record image
MOVE CORRESPONDING
FAIREA3 OF UUAIREL0 TO
FAIREA3 OF Y1DBRC
* Message type
MOVE SPACES TO ZAMSTP
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
ZAEXIT.
EXIT.
/EJECT
ZXEXPG SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Exit program: Normal
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE SPACES TO P0RTN
PERFORM ZYEXPG
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
ZXEXIT.
EXIT.
/EJECT
ZYEXPG SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Exit program: Direct
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CLOSE UUB7EFK
CLOSE UUAIREL1
CLOSE UUAIREL0
* Reset entry parameters as appropriate
PERFORM ZZEXPM.
* Exit program
ZYEXPG-EXIT.
GOBACK
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
ZYEXIT.
EXIT.
/EJECT
ZZEXPM SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Return parameters from work fields
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CONTINUE
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
ZZPEXT.
EXIT.
/EJECT
ZZINIT SECTION.
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Initialisation
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
MOVE SPACES TO P0RTN
PERFORM MEIZZ2
* = = = = = = = = = = = = = = = = = = = = = = = = = = = =
.
ZZEXIT.
EXIT.
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = */
/*H: SYSTEM : Widget Processing System
/*H: PROGRAMMER : J. Sloan
/*H: DATE : 24/04/85
/*H: (C) COPYRIGHT 1985 WIDGET CORPORATION
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = */
Function
Parameters
Notes
1. Calls an interactive display to edit a library list. Press the HELP key while
using the program for instructions.
2. Library lists are stored in file YLIBLST in the library specified by the LIBLST
parameter.
It is recommended that you have only one library list file per installation.
However, additional files can be created as follows:
Example
YEDTLIBLST
To edit a library list named BORGES:-
YEDTLIBLST LIBLST(BORGES)
Begin the syntax base line with the command name in upper case:-
Start each continuation syntax base line with ‘>—’ and end it with ‘—>’.
Show all parameter keywords in upper case on the syntax base line.
Do not split parameter descriptions over two lines, if this can be avoided.
List the parameters in the order in which they appear in the code for the
command. Note that on IBM i, the order in which the parameters appear
on the panel may be altered by use of the PMTCTL keyword.
Example
Use ‘>’ before a parameter value to indicate that it is the default value.
Use ‘-|’ and ‘|-’ to indicate a fork in a syntax base or branch line.
Use ‘——’ to indicate the termination of the syntax base line (for example,
no ‘*’ or ‘’), and continue the line to the edge of the diagram:
For qualified object names, place ‘/’ after an element name to indicate
qualification.
Place a box containing a ‘P’, after the last permitted positional parameter:
Place a box containing a ‘K’, after the last permitted keyword parameter.
Draw a line across the diagram to indicate the last required parameter.
Place the word ‘Required’ above this line on the right-hand side. Place
‘Optional’ below this line. If all parameters are optional, place ‘Optional’ in
the top left hand corner of the box.
To indicate variables, use lower case and connect compound nouns with
hyphens, for example, ‘library-list-name’. Values should be of a data type,
rather than a specific name, for example ‘date’ rather than ‘order- date’.
Parameter Descriptions
Each special value should be described. The actual special value should be
shown (for example, ‘*NONE’), followed by the text description.
For multi-part parameters which have a single value as well, show the
single value on a separate branch line from that containing the multi-part
parameter values (which may branch again to show a list of values):
The following rule applies to the examples of using the command which should
appear at the end:
Examples should cite at least one instance of using the command. Give a
typical example or examples.
YEDTLIBLST LIBLST(BORGES)
PNLGRP SUBMSGF=’WPMTMSG’.
. *T: Library list Object - command help
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. *H: SYSTEM : Widget Processing System
. *H: PROGRAMMER : J. Sloan
. *H: DATE : 24/04/92
. *H: (C) COPYRIGHT 1992 WIDGET CORPORATION
IMPORT PNLGRP=wssycmh NAME=’*’. <==Standard definitions
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:IMPORT PNLGRP=qhckmst1 NAME=’dspobjd/output’.
:IMPORT PNLGRP=qhckmst1 NAME=’dspobjd/outfile’.
:IMPORT PNLGRP=qhckmst1 NAME=’dspobjd/outmbr’.
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * Primary help text for the commands
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. wchgliblst help
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’wchgliblst/ALL’. <== Help group to
:IMHELP NAME=wchgliblst. gather all parameters
:IMHELP NAME=’wchgliblst/liblst’ together
:IMHELP NAME=’wchgliblst/libl’.
:IMHELP NAME=’wchgliblst/text’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * C. Change library list command overview
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * P. Library list name
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’wchgliblst/liblst’. <== Parameter
descriptions
:IMHELP NAME=’liblst/liblst’.
:P.Specifies the name and
&MSG(Wlb0301). of the
&MSG(Wll0301). that is to be changed
:IMHELP NAME=’whsyhph/STDTXT/REQVAL’. <== Standard text
fragments
:IMHELP NAME=’whsyhph/STDPARMVAL/LIB’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * P. Text
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’wchgliblst/TEXT’.
&MSG(WTX0001). (TEXT) &MSG(uis1005).
:XH3(WTX0001). (TEXT)
:P.Specifies a text description of the new
&MSG(Wll0301).
:PARML.
:PT.:PK DEF. *DFTTXT:EPK.
:PD.Default text is to be provided.
:PT.:PK.’&MSG(Wtx0201).’:EPK.
:PD.Up to fifty characters of free format text, enclosed in
apostrophes.
:EPARML.
:EHELP.
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * Reused groups LIBLST
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:IMHELP NAME=’liblst/liblst’.
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:P.Specifies the name and
&MSG(Wlb0301). of the
&MSG(Wll0301). containing the
&MSG(Wlb0315). to use to provide the
&MSG(Wlb0305). and the
&MSG(Wlb0316). of the submitted
&MSG(Wjb0301).
:PARML.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * LIBLST values
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’liblst/liblstval/job’.
:PARML.
:PT.:PK. *JOB:EPK.
:PD.The
&MSG(Wll0301)., name is the same as the
&MSG(Wjb0305).
:EPARML.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * LIBL preamble
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’liblst/libl’.
&MSG(WLB0006). (LIBL) &MSG(uis1005).
:XH3(WLB0006). (LIBL)
:P.Specifies the libraries to be included in the
&MSG(Wll0301).
:IMHELP NAME=’whsyhph/STDTXT/PLUS’.
:EHELP.
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * Primary help text for the panels
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. WDSPLIBLST panel help
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’zsflctl1/PNL/INTRO’. <== Overview for whole
&MSG(Wll2101). &MSG(uis1005). panel
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * Online Help Information for Display Options
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’zsflctl1/PNL/BOTINS’.
:IMHELP NAME=’whsyhph/STDTXT/ENTERRTN’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * Online Help Information for Function Keys
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’zsflctl1/PNL/CMDINS’.
&MSG(uis1001). &MSG(uis1005).
:xh3(uis1001). Function keys
:IMHELP NAME=’whsyhph/STD/F/F1HELP’.
:IMHELP NAME=’whsyhph/STD/F/F3EXIT/END’.
:IMHELP NAME=’whsyhph/STD/F/F12PREV’.
:IMHELP NAME=’whsyhph/STD/F/ENTER’.
:IMHELP NAME=’whsyhph/STD/F/HELP’.
:IMHELP NAME=’whsyhph/STD/F/HOME’.
:IMHELP NAME=’whsyhph/STD/F/PRINT’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * Library list name
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’zsflctl/zzllvn’. Help text for panel
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. * Text
. * - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:HELP NAME=’zsflctle/zztxvn’.
&MSG(Wtx0001). &MSG(uis1005).
:xh3(Wtx0001).
:P.The user text, if any, used to briefly describe the
&MSG(Wll0301).
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EPNLGRP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. *H: SYSTEM : Widget Processing System
. *H: PROGRAMMER : J. Sloan
. *H: DATE : 24/04/92
. *H: (C) COPYRIGHT 1992 WIDGET CORPORATION
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
IMPORT PNLGRP=WHSYHPH NAME=’*’. <== Standard definitions
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * References to command help groups
. * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:HELP NAME=’change_library_list’.
:ISCH roots=’change job liblst LIBLST how command wchglibl’.
&MSG(Wll5011). (WCHGLIBL) &MSG(uis1002). (&MSG(uis1003).)
:IMHELP NAME=’wchglibl/ALL’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:HELP NAME=’change_library_list_object’.
:ISCH roots=’change LIBLST liblst how command wchgliblst’.
&MSG(Wll5002). (WCHGLIBLST) &MSG(uis1002). (&MSG(uis1003).)
:IMHELP NAME=’wchgliblst/ALL’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:HELP NAME=’create_library_list_object’.
:ISCH roots=’create LIBLST liblst how command wcrtliblst’.
&MSG(Wll5001). (WCRTLIBLST) &MSG(uis1002). (&MSG(uis1003).)
:IMHELP NAME=’wcrtliblst/ALL’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:HELP NAME=’display_library_list_object’.
:ISCH roots=’display LIBLST liblst how command wdspliblst’.
&MSG(Wll5004). (WDSPLIBLST) &MSG(uis1002). (&MSG(uis1003).)
:IMHELP NAME=’wdspliblst/ALL’.
:EHELP.
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:EPNLGRP.
PNLGRP SUBMSGF=’WPMTMSG’.
. *T: Standard hypertext definitions
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
. *H: SYSTEM : Widget Processing System
. *H: PROGRAMMER : J. Sloan
. *H: DATE : 24/04/92
. *H: (C) COPYRIGHT 1992 WIDGET CORPORATION
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
IMPORT PNLGRP=wssypnh NAME=’*’. <==Standard definitions
. * = = = = = = = = = = = = = = = = = = = = = = = = = = = =
:HELP NAME=’wlllenH/WENT/LIBLST’.
&MSG(wll0001). &MSG(uis1005).
:ISCH roots=’LIBLST novice what’.
<==Index entry
&MSG(wll0001).
:xh3(wll0001).
:eul.
:ehelp.
. . . . . . etc
:EPNLGRP.
1st print - - - - 3 3 3
line
Last print 80 60 64 64 64 60 62
line
Length of 88 66 70 66 72 64 64
form (lines)
Lines per 8 6 8 6 8 6 8
inch (4 6 8
9)
Line 1 1 1 1 1 1 1
spacing (1
2 3)
Add. left 0 0 6 6 9 6 9
margin
space
Char. per 15 10 15 10 15 10 15
inch (10
15)
D F
database files • 4
Index 2
H N
HLL programs • 17
O
I OS/400
objects • 1
system values • 74
ideographic support • 77
internationalization
MRI translation • 66 P
Introduction • 1
PL/1 programs
iSeries coding structure and logic • 56
coding standards • 14 procedure and label names • 62
database • 44
naming conventions • 3 print file direction • 6
programming and documentation printer files • 13
standards • 3
printer form sizes • 1
iSeries
design standards • 1
Q
J
queues • 5
job descriptions • 5
R
L
related information
General IBM Manuals • 2
language support • 76 iSeries Manuals • 1
libraries RPG III programs • 21
naming conventions • 20
S
M
search indexes • 31, 90
mnemonics • 20
security implementation • 13
selection columns • 17
Index 3
T
testing standards • 1
version control • 26
4 Standards Guide