Professional Documents
Culture Documents
SC 414730
SC 414730
SC 414730
SC41-4730-00
AS/400 Advanced Series IBM
System/36 Environment Programming
Version 3
SC41-4730-00
Take Note!
Before using this information and the product it supports, be sure to read the general information under “Notices” on page xi.
This edition applies to the licensed program IBM Operating System/400, (Program 5716-SS1), Version 3 Release 6 Modification 0,
and to all subsequent releases and modifications until otherwise indicated in new editions. Make sure you are using the proper
edition for the level of the product.
Order publications through your IBM representative or the IBM branch serving your locality. If you live in the United States, Puerto
Rico, or Guam, you can order publications through the IBM Software Manufacturing Solutions at 800+879-2755. Publications are not
stocked at the address given below.
A form for reader comments is provided at the back of this publication. If the form has been removed, you can mail your comments
to:
If you have access to Internet, you can send your comments electronically to IDCLERK@RCHVMW2.VNET.IBM.COM; IBMMAIL, to
IBMMAIL(USIB56RZ).
When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes
appropriate without incurring any obligation to you or restricting your use of it.
Contents v
Restoring Files and Members from an Considerations for System/36
AS/400 System to the System/36 Environment Program Start Requests 13-8
Environment . . . . . . . . . . . . . . . 10-9 Errors on Program Start Requests . . 13-11
Moving from System/36 to the System/36 Subsystem
Environment . . . . . . . . . . . . . . . . 10-10 Descriptions/Communications Entries 13-15
Subsystem Communications Device
Chapter 11. Security . . . . . . . . . . . . 11-1 Allocation . . . . . . . . . . . . . . . . 13-16
System Security Levels . . . . . . . . . . . 11-1 OS/400 Intersystem Communications
Sign-On Security . . . . . . . . . . . . . 11-1 Function (ICF) . . . . . . . . . . . . . . . 13-16
User Profiles and Special User Authority . 11-2 ICF Files . . . . . . . . . . . . . . . . . 13-17
User Class . . . . . . . . . . . . . . . . . 11-2 Tying the Application to Communications
Special Authority . . . . . . . . . . . . . 11-2 Configurations . . . . . . . . . . . . . 13-17
Initial Program Security . . . . . . . . . . 11-4 Communications Operations . . . . . . 13-20
Menu Security . . . . . . . . . . . . . . . 11-4 Return Codes and Messages . . . . . 13-28
Limited Capability . . . . . . . . . . . . . 11-4 Testing Communications Applications 13-28
Group Profile . . . . . . . . . . . . . . . . 11-4 File Transfer Subroutines . . . . . . . . . 13-30
Resource Security . . . . . . . . . . . . . . 11-4 File Transfer Subroutine Parameters . 13-31
Authority for a User to a Resource . . . 11-5 File Transfer Support Considerations . 13-33
Public Authority . . . . . . . . . . . . . . 11-7 Asynchronous Communications . . . . . 13-34
Library-Level Security . . . . . . . . . . . 11-7 Asynchronous Configuration
Authorization Lists . . . . . . . . . . . . . 11-7 Considerations . . . . . . . . . . . . . 13-34
Authority Holders . . . . . . . . . . . . . 11-7 Asynchronous Programming
Moving from System/36 to the System/36 Considerations . . . . . . . . . . . . . 13-35
Environment . . . . . . . . . . . . . . . . . 11-8 BSCEL . . . . . . . . . . . . . . . . . . . . 13-36
System/36 User Identification File . . . . 11-8 BSCEL Terminology Considerations . 13-36
System/36 Resource Security File . . . 11-8 BSCEL Configuration Considerations . 13-37
Additional Security Considerations . . 11-11 BSCEL Programming Considerations 13-37
Saving and Restoring Authorities . . . 11-12 Finance Considerations . . . . . . . . . . 13-38
Configuration Considerations . . . . . 13-38
Chapter 12. Designing Records . . . . . 12-1 Programming Considerations . . . . . 13-38
Identifying Required Fields . . . . . . . . . 12-1 Retail Considerations . . . . . . . . . . . 13-39
Naming Fields . . . . . . . . . . . . . . . . . 12-1 Configuration Considerations . . . . . 13-39
Using Numeric Fields . . . . . . . . . . . . 12-1 Programming Considerations . . . . . 13-39
Zoned Decimal Format . . . . . . . . . . 12-2 Intrasystem Communications . . . . . . . 13-39
Packed Decimal Format . . . . . . . . . 12-3 Programming Considerations . . . . . 13-39
Binary Format . . . . . . . . . . . . . . . 12-4 System/36 APPC to AS/400 APPC . . . 13-40
Floating-Point Format . . . . . . . . . . . 12-5 System/36 Peer to AS/400 Advanced
Using Alphanumeric Fields . . . . . . . . . 12-5 Program-to-Program Communications
Using Keys . . . . . . . . . . . . . . . . . . 12-5 (APPC) . . . . . . . . . . . . . . . . . 13-41
Allowing for Deletion of Records . . . . . . 12-6 System/36 BSC/CICS to AS/400 SNA
Determining Field Size . . . . . . . . . . . . 12-6 Upline Facility . . . . . . . . . . . . . . . 13-41
Defining Record Length . . . . . . . . . . . 12-6 Remote Host Support Considerations 13-41
Allowing for New Fields . . . . . . . . . 12-6 SNUF Programming Considerations . 13-41
Describing Record Layout . . . . . . . . . . 12-6 System/36 BSC/IMS to AS/400 SNA Upline
Facility . . . . . . . . . . . . . . . . . . . 13-42
Chapter 13. Communications . . . . . . 13-1 Remote Host Support Considerations 13-42
Configuring the Communications SNUF Programming Considerations . 13-42
Environment . . . . . . . . . . . . . . . . . 13-1 Using CL Override Commands . . . . . . 13-44
System/36 Background . . . . . . . . . . 13-1 General Programming Considerations . . 13-45
Communications Procedures Examples 13-2 Migration Considerations . . . . . . . . . 13-45
ENABLE and VRYCFG Hierarchy and Automatic Dial and Telephone Number
Examples . . . . . . . . . . . . . . . . . 13-6 List Support . . . . . . . . . . . . . . . 13-45
OS/400 Subsystem Considerations for X.21 . . . . . . . . . . . . . . . . . . . . 13-46
System/36 Users . . . . . . . . . . . . . . 13-7
Contents vii
Using Messages with Displays . . . . 15-17 Chapter 18. Jobs and Job Processing . 18-1
Moving from System/36 to the System/36 Using Jobs and Job Processing . . . . . . 18-1
Environment . . . . . . . . . . . . . . . . 15-17 Jobs and Job Steps . . . . . . . . . . . . . 18-1
Starting and Ending Jobs . . . . . . . . . . 18-1
Chapter 16. Programs and Procedures 16-1 Starting Jobs . . . . . . . . . . . . . . . . 18-1
Designing Programs and Procedures . . . 16-1 Running Jobs . . . . . . . . . . . . . . . 18-2
Programs . . . . . . . . . . . . . . . . . . . 16-1 Using the System/36 Environment
Batch and Interactive Programs . . . . . 16-1 Command Processor . . . . . . . . . . 18-2
Program Characteristics . . . . . . . . . 16-2 Using the Initiator Function . . . . . . . . 18-4
Program Types . . . . . . . . . . . . . . 16-2 Processing OCL Statements and
Comparison of Program Types . . . . . 16-4 Procedure Control Expressions . . . . 18-4
Summary Table of Users and Requesters 16-4 Ending Jobs . . . . . . . . . . . . . . . . 18-6
Designing Applications . . . . . . . . . . 16-5 Managing and Scheduling Jobs . . . . . . 18-7
Programming Considerations . . . . . . 16-6 Job Priorities . . . . . . . . . . . . . . . . 18-7
Procedures . . . . . . . . . . . . . . . . . 16-21 Using Batch Job Immediate Support . . 18-8
Procedure Attributes . . . . . . . . . . 16-21 Using the Job Queue . . . . . . . . . . . 18-8
Parts of a Procedure . . . . . . . . . . 16-21 Evoking Other Jobs . . . . . . . . . . . . 18-11
Using Procedures . . . . . . . . . . . . 16-22 Submitting Jobs to Run Later . . . . . . . 18-11
Procedures with Menus . . . . . . . . . . 16-23 Using Job Queue to Run Jobs Later . 18-11
Calling a Procedure from Another WAIT OCL Statement . . . . . . . . . . 18-11
Procedure . . . . . . . . . . . . . . . . . 16-23 Submitting Jobs by Security Classification 18-12
Considerations for Multiple Requester Preventing Users from Ending Jobs . . . 18-13
Terminal Procedures . . . . . . . . . . . 16-23 Preventing Interrupted Jobs . . . . . . . . 18-13
Delaying MRT Termination . . . . . . . 16-25 Preventing Informational Messages from
Internal Processing of MRT Jobs . . . 16-25 Appearing . . . . . . . . . . . . . . . . . 18-13
Designing Procedures . . . . . . . . . . . 16-26 Running Jobs during Initial Program Load
Naming a Procedure . . . . . . . . . . 16-26 (IPL) . . . . . . . . . . . . . . . . . . . . 18-13
Procedure Performance and Coding Running Jobs without Operators . . . . . 18-14
Techniques . . . . . . . . . . . . . . . 16-26 End-of-Day Processing . . . . . . . . . . 18-14
Programming Considerations for Job Date and Date Format . . . . . . . . 18-14
Procedures . . . . . . . . . . . . . . . 16-27
Moving from System/36 to the System/36 Chapter 19. Error Prevention, Detection,
Environment . . . . . . . . . . . . . . . . 16-29 and Recovery . . . . . . . . . . . . . . . . 19-1
Types of Failures and Errors . . . . . . . . 19-1
Chapter 17. Mixing System/36 System Failures . . . . . . . . . . . . . . 19-1
Environment and AS/400 Functions . . 17-1 Disk Device Failures . . . . . . . . . . . 19-1
Using AS/400 Architectural Features in Power Failures . . . . . . . . . . . . . . . 19-1
System/36 Programs . . . . . . . . . . . . 17-1 Equipment Failures . . . . . . . . . . . . 19-1
Using AS/400 CL Commands in the Programming Errors . . . . . . . . . . . 19-1
System/36 Environment . . . . . . . . . . 17-2 System Operator Errors . . . . . . . . . 19-2
Entering AS/400 CL Commands User Errors . . . . . . . . . . . . . . . . . 19-2
Interactively . . . . . . . . . . . . . . . . 17-2 Error Prevention . . . . . . . . . . . . . . . 19-2
Adding AS/400 CL Commands to Using the Automatic Response Function 19-2
System/36 Procedures . . . . . . . . . 17-3 Preventing Unscheduled Ending of Jobs 19-2
Program Control in the System/36 Testing and Debugging Programs . . . 19-2
Environment . . . . . . . . . . . . . . . . . 17-5 Using the WAIT and FILE OCL
// LOAD and // RUN OCL Statements . 17-5 Statements . . . . . . . . . . . . . . . . 19-3
High-Level Language CALL Statement . 17-8 Allocating the Diskette or Tape Drive to a
File Processing in System/36 Environment 17-8 Job . . . . . . . . . . . . . . . . . . . . . 19-3
Database Files . . . . . . . . . . . . . . . 17-8 Error Detection . . . . . . . . . . . . . . . . 19-3
Printer Files . . . . . . . . . . . . . . . 17-11 Error Detection Subroutines . . . . . . . . . 19-3
Display and Communications Files . . 17-12 Program Language Error Detection . . . . 19-3
Other Device Files . . . . . . . . . . . 17-14 System/36-Compatible COBOL Language 19-4
System/36-Compatible RPG II Language 19-4
Contents ix
x OS/400 System/36 Environment Programming V3R6
Notices
References in this publication to IBM products, programs, or services do not imply that IBM intends to
make these available in all countries in which IBM operates. Any reference to an IBM product, program,
or service is not intended to state or imply that only that IBM product, program, or service may be used.
Any functionally equivalent product, program, or service that does not infringe any of the intellectual prop-
erty rights of IBM may be used instead of the IBM product, program, or service. The evaluation and
verification of operation in conjunction with other products, except those expressly designated by IBM, are
the responsibility of the user.
IBM may have patents or pending patent applications covering subject matter in this document. The fur-
nishing of this document does not give you any license to these patents. You can send license inquiries,
in writing, to the IBM Director of Licensing, IBM Corporation, 500 Columbus Avenue, Thornwood, NY
10594, U.S.A.
| Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
| exchange of information between independently created programs and other programs (including this one)
| and (ii) the mutual use of the information which has been exchanged, should contact the software interop-
| erability coordinator. Such information may be available, subject to appropriate terms and conditions,
| including in some cases, payment of a fee.
| IBM Corporation
| Software Interoperability Coordinator
| 3605 Highway 52 N
| Rochester, MN 55901-9986 USA
This publication may refer to products that are announced but not currently available in your country. This
publication may also refer to products that have not been announced in your country. IBM makes no
commitment to make available any unannounced products referred to herein. The final decision to
announce any product is based on IBM's business and technical judgment.
Changes or additions to the text are indicated by a vertical line (|) to the left of the change or addition.
This publication contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an
actual business enterprise is entirely coincidental.
The System/36 environment supplies the proce- See Chapter 2, “Operating in the System/36
dures, operation control language statements, Environment,” for more information.
utility control statements, and control commands
that you use to: Configuration
Create and maintain System/36 programs on
the AS/400 system The System/36 environment consists of the fol-
lowing:
Run System/36 programs and procedures on
the AS/400 system The AS/400 configuration
System/36 environment configuration
Create and maintain System/36 disk files on
the AS/400 system See Chapter 3, “Configuring the System/36
Sort System/36 files on the AS/400 system Environment,” for more information.
The AS/400 system uses messages to communi- However, when you start mixing System/36 envi-
cate with you. Your programs use messages to ronment functions and AS/400 functions, you must
communicate with users. Messages supply infor- follow certain rules. See Chapter 17, “Mixing
mation, prompt the user to enter data, or indicate System/36 Environment and AS/400 Functions” for
an error has occurred. A message member in more information.
the System/36 environment is a library load
member that defines the text of each message Jobs and Job Processing
and its associated message identification code.
On the OS/400 operating system, a message On System/36, a job is a unit of work composed
member is a message file (*MSGF) object. of one or more programs. A job step is a unit of
work done by one program. Jobs can have one
The following are the types of messages available or more job steps.
on the AS/400 system:
Informational See Chapter 18, “Jobs and Job Processing,” for
Prompting more information.
à@ Display Messages
ð Selection
__
System : RCH3836ð F3=Exit F12=Cancel
Queue . . . . . : QSYSOPR Program . . . .: \DSPMSG (C) COPYRIGHT IBM CORP. 1988, 1992.
Library . . . : QSYS Library . . .:
Severity . . . . : 72 Delivery . . .: \HOLD
á ñ
Type reply (if required), press Enter.
Controller RCHASGT1 contacted on line LANLINE.
All sessions ended for device RCHASLAM.
An adapter has inserted or left the token-ring on line LANLINE.
An adapter has inserted or left the token-ring on line LANLINE. Consider the following factors when using the
All sessions ended for device RCHAS415ð1.
All sessions ended for device S1ð1ð1ð7. System Request menu:
An adapter has inserted or left the token-ring on line LANLINE.
An adapter has inserted or left the token-ring on line LANLINE.
An adapter has inserted or left the token-ring on line LANLINE.
An adapter has inserted or left the token-ring on line LANLINE.
The wording of options is tailored to the envi-
SYS1631 Options ( 123)
Empty slot or picker failure during DELETE. ronment in which you are running.
Reply . . . ______________________________________________________
Bottom
Another way to determine whether you are in the Depending on the security needed (and on some
System/36 environment is to specify the Display performance considerations), you can determine
Job (DSPJOB) CL command and select option 1 whether MRT security works as it does on
to display your job status attributes. If your job is System/36, or if you should tailor it to work differ-
processing in the System/36 environment, the ently. For more information on security, see
special environment attribute for your job is *S36. Chapter 11, “Security.” For information on the
Change S/36 MRT Security and Performance
If you entered the System/36 environment with the display, see page 3-11.
Start System/36 Environment (STRS36) CL
command, you can use the End System/36 Envi-
ronment (ENDS36) CL command to leave the Configuration of the System/36
System/36 environment. Environment
If you entered the System/36 environment This section describes the System/36 environment
because the special environment value for your configuration displays and prompts that you see
user profile is *S36, or your user profile is when you use Change System/36 Environment
*SYSVAL and system value QSPCENV is *36, Configuration (CHGS36) command, or after typing
you can do the following to leave the System/36 a 2 in the Option column, next to the configuration
environment: description of the Change S/36 Environment Con-
1. Change the special environment of your user figuration display.
profile from *S36 to *NONE by using the
The following function keys are valid for the S/36 Display IDs: If you type a 2 in the
Change S/36 Environment Configuration display: Option column, next to the S/36 display IDs Con-
figuration Description of the Change S/36 Environ-
Enter
ment Configuration display and press the Enter
All entries are verified and, if correct, saved
key, your display might look as follows:
when no options are on the display. If incor-
rect entries were made, you are returned to
the display with the entries. If no incorrect à@ Change S/36 Display IDs
ð
entries were made, the configuration informa- S/36 environment . . . . . . . . . . . : #LIBRARY
tion for this display. F3=Exit F5=Refresh F6=Sort S/36 display IDs
More...
F5=Refresh
All AS/400 system tape device names are
shown. To use a tape device when running in
á ñ á ñ
The following function keys are valid for the Use the 3270 emulation option to specify trans-
Change S/36 Diskette ID display: lation on a remote display.
UK multinational á ñ
United States/Canada
United States multinational
The following general System/36 environment
Japan English
values can be changed on this display:
Japan English multinational
Japan Katakana The default session library. This library works
Netherlands as it did on the System/36, except the library
Netherlands multinational name does not appear on the AS/400 sign-on
Iceland display.
Iceland multinational The default files library. This is the library
ROECE-Latin where you can find your System/36 environ-
Turkey ment files. On the AS/400 system, files must
Yugoslavia multinational reside in a library.
Cyrillic
Greece Use library list for files. Specify N for this field
Thailand if you do not want the System/36 environment
Cursive language–right-to-left to do an automatic search of the library list for
Noncursive language–right-to-left database files.
Date differentiated files. Specify Y for this
The following function keys are valid for the field if any application uses date-differentiated
Change S/36 3270 Device Emulation Values files.
display:
Shared opens of files. Specify N for this field
F3=Exit if you do not want the System/36 environment
Shows a display that lets you specify if you to use automatic shared opens of files.
want to save the changes made on the config-
uration displays. Record blocking when sharing files. Specify Y
for this field if you want the System/36 envi-
F12=Cancel ronment to use record blocking for all sequen-
Shows a display that lets you specify if you tially accessed files, including those shared
want to save the changes made on this with other jobs.
display.
Store deleted files in cache. Specify N if you
want to delete a database file through the
S/36 Environment Values: If you type a 2 DELETE OCL statement. Otherwise, the
in the Option column, next to the S/36 environ- default value Y causes deleted files to be
ment values Configuration Description of the placed in a cache. When you create a data-
Change S/36 Environment Configuration display base file, the System/36 environment
and press the Enter key, your display might look searches the cache for a file with the same
as follows: attributes and inserts the file into the library.
Print information
– The default lines per page. This option
works as it did on System/36.
The default is 20. Add only S/36 users . . . . . . \NO___ \YES, \NO, \SAME
Substitute ICF procedure data . \YES__ \YES, \NO, \SAME
MRT user profile . . . . . . . . \FRSTUSR \OWNER, \FRSTUSR, \SAME
Check authority to files . . . . \ALLUSR_ \ALLUSR, \FRSTUSR, \SAME
*SUBMITTER MRT delay value . . . . . . . . ð_____ 1-32767, \SAME
MRT job initiation . . . . . . . \IMMED \IMMED, \JOBQ, \SAME
By specifying *SUBMITTER, the job is MRT storage pool . . . .
MRT job priority . . . .
. . .
. . .
.
.
\BASE___
2ð________
\BASE, \CURRENT, \SAME
1-99, \SUBMITTER, \SAME
started with the same run priority as the
submitter at the time the job is submitted.
display:
á ñ
Bottom
á ñ á ñ
When you select option 5 for any of the configura- For more information on the attributes that can be
tion descriptions on the Display S/36 Environment retrieved and a description of the function keys,
Configuration display and press the Enter key, the see “S/36 Environment Values” on page 3-9.
displays that show would be similar to those that
show when you use the CHGS36 command, or Work with System/36
type 2 in the Option column of the Change S/36
Environment Configuration display. The informa-
Environment Configuration
tion that appears after selecting option 5, could
If you use the Work with System/36 Environment
have been changed with either the CHGS36 or
Configuration (WRKS36) command, the Work with
CHGS36A commands. You cannot change any
S/36 Environment Configuration display should
information using the DSPS36 command. If you
look similar to the following:
use the DSPS36 command with
OUTPUT(*PRINT), the configuration information is
printed in a spooled file, and you will not see any à@ Work with S/36 Environment Configuration
ð
panels. Type options, press Enter.
2=Change 5=Display 6=Print
To determine which printer and output queue is By setting the PRTDEV to *SYSVAL in the user
used at job initiation time, the system looks at the profile, the session printer value set in the work-
following objects: station device descriptions was never looked at.
Job description (JOBD) The session printer value was not reset because it
User Profile (USRPRF) was never used.
Workstation device description (DEVD)
Use any of the following methods to specify the To display the status of all active printer spool
output queue that will contain the printed output writers on the system, use the STATUS WRT
for a job: control command. You can select an option to
display the message queue associated with an
Specify the name of the output queue that is active writer. See the Printer Device Program-
to contain the output (or specify *DEV to place ming book for complete information about how
the output in the output queue for the printer) print spooling works.
in the job description for the job. Use this
method when multiple users or jobs use the
same job description and want their output in Printer Control Guidelines
the same output queue.
Specify that the user profile defines the output The following sections describe several functions
queue (use the *USRPRF special value) in the you can use to manage or control printer output.
job description for the job. In each user’s
profile, specify the name of the output queue Changing the Session Printer
that is to contain the output for the user. This
method should be used when multiple users During System/36 environment configuration, you
of jobs use the same job description and want specify a printer to receive output from each
their output in different output queues. display station. This printer is called the session
printer. The session printer is used for all printed
After the job has been started, use the
output created in the System/36 environment while
Change Job (CHGJOB) command to specify
a user is signed on unless a // PRINTER OCL
the name of the output queue that is to
statement has been processed for a particular
contain the output for the job. This method
print file. Use the PRINT procedure to change the
should be used if you temporarily need to
following values:
change the output queue that is used by the
job. The CHGJOB command will change the The printer ID used for printed output,
routing of the output for the duration of the job including system list
or until another CHGJOB command is The number of lines per page
entered. The vertical print density (lines per inch)
The horizontal print density (characters per
Controlling Print Spooling inch)
The forms number to be used
The operators control all output queues and print
entries in the output queue. The operator can, for The PRINT procedure changes these values for
example, start or stop the printers and change the the session. The settings return to the defaults
number of copies to print. when the session ends.
Note: Not all printers allow changing lines per
Users have some control over the print entries inch or characters per inch. The System/36 Envi-
they create. For example, they can change the ronment Reference book has more information
number of copies to print for spool files they about the PRINT procedure.
created.
On the System/36, you can direct your Print key These values remain in effect after the system
output to a unique printer. In the System/36 envi- operator signs off. However, when using the SET
ronment on the AS/400 system, all Print key procedure to specify a printer ID, the values
output is sent to the printer assigned to the remain in effect after signing off only if you specify
session printer. When the session printer is PRTDEV(*WRKSTN) in the user profile. The
changed, the printer for Print key output is also System/36 Environment Reference book has more
changed. information about the SET procedure.
The SET procedure and the ID, BORDER, and The printer ID printed output uses
HEADER parameters on the SETCF utility control Number of lines per page
statement of the $SETCP utility program do not Vertical print density (lines per inch)
support changing the Print key printer, the Print Horizontal print density (characters per inch)
key border, or the Print key header information. If Forms number
any are specified, an error is issued. Number of copies to print
Whether the paper needs to be aligned before
the output prints
Changing the System List Device
Whenever a RUN OCL statement is processed, a
The system list device is the default printer speci-
generic printer override is generated through an
fied during system configuration. Use the
AS/400 OVRPRTF FILE (*PRTF) command. The
SYSLIST procedure to change the system list
information from the PRINT procedure (the
device to another printer, direct the output to the
FORMS OCL statement) is used as parameters
display station, or to turn this function off (no
on this command. Printing done by an application
output is listed). The System/36 Environment Ref-
or a utility uses the parameter from this command.
erence book has more information about the
SYSLIST procedure. If a PRINTER OCL statement is specified, RUN
OCL statement processing generates a specific
Changing the System Printer printer override using information from the
PRINTER OCL statement. This override applies
If the session printer is not set, and you do not to the utility or application printer file that uses the
specify a system list device, printed output uses same name as that used on the PRINTER OCL
the default system printer. You can specify or statement. See the Data Management book for
change the system printer by using the more information on overrides.
CHGSYSVAL command with the
SYSVAL(QPRTDEV) parameter. The System/36 Environment Reference book has
more information about these OCL statements.
Changing the Printer
Configuration Information Controlling or Displaying Print
Spooling Information
Use the SET procedure to specify the following
printer-related items for the display station: The system operator controls print spooling with
control commands. To display information about
Printer ID to use for session output
the status of the spooled files, use the STATUS or
Forms number
STATUSF control command with the PRT param-
Output in an output queue is printed on a first- The START PRT control command in the
in/first-out basis, with no regard to forms number. System/36 Environment Reference book has more
If, for example, two or more jobs use different information about printing by forms type. See the
forms numbers, the system operator controlling a Printer Device Programming book for information
printer has to change the forms often. The about assigning forms numbers.
system allows operators to control the printing of
output using different forms numbers. Combining Several Print Files in
One Job
The system has two methods of printing by forms
number. Using the START PRT control The system allows you to combine printer output
command, you can print by a specific form, or by from several programs into one print file. A print
groups of forms. This method allows operators to file is a device file that determines which attri-
print all reports that use the same forms number butes apply to the printed output. A particular
together. For example, you can print all jobs in printer may or may not support all of the attributes
the output queue with special invoice forms specified in a printer file. Users can create their
together. own printer files. The programs must:
To print by groups of forms (using the FORMS Run in the same job
parameter of the START PRT command), the Specify the same printer for the output
spool writer prints all entries in the output queue
using the forms on the printer. When the spool The first program of the job creates the print file,
writer finishes printing the entries, it prompts you and the remaining programs in the job add output
to change forms in the printer. This method to the same print file.
reduces the number of times you have to change
For example, you have three order-entry programs
the paper in a printer.
within a job, and each program produces one
To print by a specific forms number, the spool report. You can have one print file instead of
writer prints only those entries that have the speci- three separate print files to allow all reports
fied forms number. When there are no more produced by the order-entry programs to be
printed at the same time. The following figure
shows how this process works.
Program 3 Report 3
Assigning Priorities to Printed
Output
Use the PRINTER OCL statement to assign a pri-
ority to printed output. You can assign printed
Printed Output Report 1 output a priority of 0 through 5. Output with a pri-
(The three reports are Report 2 ority of 5 prints first. The system assigns output a
printed together.) Report 3
priority of 1, if you do not assign a priority. Output
with a priority of 0 means that the output is held
RV2W104-0 on the output queue until an operator releases the
output by typing the RELEASE control command.
The PRINTER OCL statement in the System/36
Use the CONTINUE parameter of the PRINTER
OCL statement to combine multiple reports into
Environment Reference book has more informa-
tion about assigning priorities to printer output.
one print file. See the System/36 Environment
Reference book for more information about the
The following table shows how the System/36
PRINTER OCL statement.
environment printed output priorities are mapped
Note: The size of the print file is determined by to the AS/400 printed output priorities:
the record length of the first program’s print file. If
any program's printed output has a different System/36 Environment AS/400 System
length, the first program’s record length must be Priority Priority
equal to or greater than the longest record length
0 7 and HOLD (*YES)
required in the job while the CONTINUE param- 1 7
eter is in effect. For more information, see 2 6
“CONTINUE-YES Processing” on page 17-11. 3 5
4 4
5 3
Assigning the Delayed Status to
Printed Output
Use the DEFER parameter of the PRINTER OCL Programming Considerations
statement to specify the delayed status of a
spooled file. The delayed status indicates whether The following sections describe the programming
a spooled file can begin printing before the file is considerations for the use of print files in the
completed by the program. Normally, the output System/36 environment, and provides program-
is not printed until it is complete (when the job ming considerations for printed output attributes.
ends or the program closes the spooled file).
RSLW105-0
RSLW104-0
Figure 5-2. Objects Addressed through the AS/400 System Library (QSYS)
RSLW103-0
Folders are also objects that must be addressed System/36 Object AS/400 Object
through a library. On the AS/400 system, a folder
Load member Program
is a document library object (DLO).
Display file
Message file
The following table shows the mapping of some of
the System/36 types of information to objects on Network resource direc- DDM files
the AS/400 system. tory (NRD)
Procedure member Member of source phys-
System/36 Object AS/400 Object ical file QS36PRC
Compiled display formats Display file Source member Member of source phys-
ical file QS36SRC
Compiled message Message file
member Subroutine member Program
User Files
User Information Stored on Disk
User files contain the data your programs need.
This section describes the contents of user infor- For more information about files, see Chapter 7,
mation stored on disk. “Files.”
Output Queues contain printed output stored on User libraries contain the programming information
disk for later printing. For more information about for your jobs. For more information about
output queues, see “Print Spooling” on page 4-3. libraries, see Chapter 6, “Libraries.”
The job queue contains information about jobs Folders contain members created by OfficeVision
waiting to be run. For information about the job for OS/400. For more information about folders,
queue, see “Using the Job Queue” on page 18-8. see Chapter 8, “Folders and Data Dictionaries.”
The System/36 environment contains the following Do not place double quotation marks (") around
types of libraries: names containing special characters (extended
names). The System/36 environment internally
The System/36 environment system library places quotation marks around extended names.
(QSSP). The QSSP library contains the Extended names include any displayable char-
IBM-supplied programs, procedures, files, and acter (code points greater than hex 3F) except
so on for the System/36 environment. embedded blanks, asterisks (*), single quotation
The System/36 environment user library marks ('), double quotation marks (”), or question
(#LIBRARY). #LIBRARY contains user- marks (?). If a name contains these characters, it
written applications. Since the system is invalid and you receive an error message.
searches #LIBRARY for objects, you can
place applications run by many users in You can create meaningful library names by
#LIBRARY. abbreviating the name of the application that uses
the library. For example:
The system library (QSYS). System library
QSYS contains the IBM-supplied programs, Application Library name
files, messages, commands, and so on for the Accounts receivable ACCTLIBR
AS/400 system. Payroll PAYLIB
Miscellaneous programs PROGLIBR
Other licensed program libraries. These Messages library MSGLIBR
libraries contain the IBM-supplied program-
ming support for the programming languages
and utilities.
Group Libraries
Your application libraries. These are the Group libraries are a set of libraries collectively
libraries you create to store your programming identified by one name. When you create a group
information. library, specify a name for it. Each library in the
group is named as an extension of the group
Library Names name. The group library name and the library
name are separated by one or more periods.
A library name in the System/36 environment can
be up to 8 characters long. The name must begin For example, a group library name is M.TEST.
with an alphabetic character (uppercase A through Libraries in the group are named M.TEST.1,
Z, #, $, or @). The remaining characters can be M.TEST.2, and M.TEST.3. The group library in
any combination of numeric, alphabetic, and this example could also be considered part of a
special characters. The following names are not group named M.
allowed:
If you use the FROMLIBR procedure or the To create load members, use compilers or utilities.
$MAINT utility program to create a record-mode
file from a source or procedure member, the Listing Members and Library
COPY and CEND statements are placed in the file
automatically. Otherwise, you must specify the
Information
COPY and CEND statements (for example, if a
When your library is on disk, use the LISTLIBR
program you coded is to create a file that
procedure to:
becomes a library member).
List the library’s directory
You can use record-mode files on other systems if List members from the library
the files are written as basic data exchange files.
The System/36 Environment Reference book has When you have a library saved on diskette or
more information about using record-mode files. tape, or you have one or more members in a
diskette or tape file, use the LISTFILE procedure
to list information about the members.
Programming Guidelines for
Libraries
Saving and Restoring Libraries
The following sections describe the functions you
can do with libraries and library members in the Use the SAVELIBR procedure to save an entire
System/36 environment, and they indicate the pro- library on diskette or tape. Use the RESTLIBR
cedures you use to do the functions. The procedure to restore an entire library from diskette
System/36 Environment Reference book has more or tape to disk.
information about these procedures.
The System/36 environment libraries (#LIBRARY,
QSSP, and QS36F) are saved when you save all
Creating Libraries nonsystem libraries using the following CL
command:
Use the System/36 environment Build Library
(BLDLIBR) procedure to create libraries on disk. SAVLIB LIB(*NONSYS)
BLDLIBR also creates the QS36SRC and
They can be restored using the following CL
QS36PRC source files. The BLDLIBR procedure
commands:
always creates libraries in the system auxiliary
storage pool (ASP). The authority to use the RSTLIB SAVLIB(*NONSYS)
library defaults to the system value of QCRTAUT.
The authority of objects created into the library, if or
or
Library Lists
RSTLIB SAVLIB(#LIBRARY)
RSTLIB SAVLIB(QS36F) A library list is an ordered list of libraries. Each
job has a library list. When you use a library list,
Copying Libraries and Library each library in the list is searched in the order of
its occurrence until the system finds an object of
Members
the specified name and type. If more than one
Use the LIBRLIBR procedure to copy library object of the same name and type exists in the
members from one library to another. Use the list, the system uses the object from the library
FROMLIBR procedure to copy library members that appears first in the library list.
from a library to a disk, diskette, or tape file. Use
The library list illustrated in Figure 6-1 consists of
the TOLIBR procedure to copy library members
the following:
from a file (either disk, diskette, or tape) to a
library. System part. The system libraries, specified
by the QSYSLIBL system value, that contain
Securing Libraries objects needed by the system. Library QSYS
is an AS/400 system library.
See Chapter 11, “Security,” for information about Product libraries. Up to two product libraries
securing libraries. used to support languages and utilities for the
job.
Listing Files Current library. The current library for the job.
This can be a duplicate of a library in the user
Use the CATALOG procedure to list information
part of the library list.
about files. The System/36 Environment Refer-
ence book describes the CATALOG procedure. User part. The objects referred to by the
system’s users and applications.
Renaming Libraries or Library
Members
Use the RENAME procedure to rename a library,
file, or folder. Use the CHNGEMEM procedure to
rename a library member.
The following objects are not discussed. The Searching for Source Members: The
search order for these objects is always to the System/36 environment follows the same search
library specified or is managed by the product order used on System/36. The search order for
defined. source members depends on the procedure or
command being processed. The procedures
Alternate indexes (located in the System/36 search only the library specified. If no library is
environment files library) specified, the procedure searches #LIBRARY.
Folders (defined and managed by office
systems)
Searching for Migration Commands:
Data dictionaries (defined and managed by
the interactive data definition utility (IDDU)) There are control language commands that allow
Documents (defined and managed by office you to migrate objects restored from System/36
systems) into the AS/400 objects. If the file name is speci-
Mail logs (defined and managed by office fied (with an explicit name or *CURRENT), only
systems) that library is searched. If *LIBL is allowed, the
job library list is searched to locate the object.
The default files library becomes the session files For example, you can create a sequential file with
library when you start the System/36 environment. enough room for five hundred 256-byte records, or
When you enter statements from the keyboard, with 50 blocks of disk space allocated for it.
the session files library and current files library are
the same. When starting a procedure, the session
files library is made the current files library for the
Naming a Physical File
procedure. Use the FILELIB OCL statement and
The System/36 environment requires you to
FLIB procedure to change the current and session
uniquely identify each file through a file name and
files library. For more information, see the
a file label. The file name indicates how the
System/36 Environment Reference book.
program refers to the file. The file label indicates
how the system refers to the file on disk. A file
You can create files on disk using:
name or file label can be up to 8 characters long
The BLDFILE procedure. For example, if you and must begin with an alphabetic character (A
want to create a sequential file named through Z, #, $, or @). Characters (other than the
NEWFILE, and you have enough space for
Do not name files ALL. Apostrophes ('), question When creating these date-differentiated files,
marks (?), asterisks (*), and quotation marks (") make sure the following attributes of the date-
are not allowed. Do not use the following charac- differentiated file are the same:
ters because they have special meanings in pro-
Record length
cedures: commas (,), slashes (/), greater than
Delete-capable/nondelete-capable
signs (>), equal signs (=), plus signs (+), and
Duplicate keys allowed/not allowed
hyphens (-). If you use any of these characters,
Keyed file/nonkeyed file
the System/36 environment puts double quotation
Key position and length (if keyed file)
marks around the file name and then uses this
Initial allocation
expanded name as the actual name on disk. For
Form of initial allocation (blocks or records)
more information, see “Naming Conventions for
Extend value
Files, Libraries, and Folders” on page 5-4.
File size
File type
Create meaningful file labels by abbreviating the
name of the application that uses the file. For
If these attributes are not the same, an error
example:
appears when you try to create a new file for input
File Label Application or Type of File or output.
ACCTRECV Accounts receivable
CUSTMAST Master customer file Using Group Files: A group file is a set of
CUSTORDS Customer orders files identified by a file name with identifiers sepa-
rated by one or more periods. The characters
NAME and LABEL are parameters on the FILE preceding a period identify the file group.
OCL statement. Specify the LABEL parameter
only when the name of the file on disk is different The limit of 8 characters for a file name applies to
from the name used in the program. If you do not names for group files. The period is one of the 8
specify the LABEL parameter, the program uses characters. A group name should not be more
the name specified as the NAME parameter. For than 6 characters long plus a period (.). A
example, in the COBOL coding and the FILE OCL 7-character group name plus a period (.) does not
statement shown below, the file name used by the allow more characters to differentiate between
program is ITEMMAST, but the file label is files in a group.
INVMAST (the actual name of the file on disk).
The following figure shows examples of file names
Following is the COBOL program segment: that identify group files.
INPUT-OUTPUT SECTION.
FILE-CONTROL. File Name File Group Name
SELECT INPUT-FILE ASSIGN TO DISK-ITEMMAST.
INV.MAST
Following is the FILE OCL statement: INV.TRAN INV
INV.WORK
// FILE NAME-ITEMMAST,LABEL-INVMAST
M.TEST.1
M.TEST.2 M.TEST or M
Using File Dates: You can assign the same M.TEST.3
file label to more than one file if each file has a
different creation date. The creation date is the
system date when an object is created. A system RSLW068-0
High-level language program. See the appro- Files stored in the cache do use additional
priate language book. storage. You can monitor this storage by dis-
DFU. The &dfulist. has more information. playing the System/36 environment values
(DSPS36 command) and watching the number of
Query/36. See the Query/400 Use book for kilobytes of storage used by the cache. To
more information. remove all files from the cache, have a user with
LISTDATA procedure. Use the LISTDATA QSECOFR authority call the QEXCLNCI program.
procedure to selectively list data from a file, The QEXCLNCI program submits a request for a
no matter what its organization is. The data database server job to remove all the files from
can be printed or displayed. the cache. The system also submits a request for
a database server job to remove all the files from
Use the LISTDATA options to:
the cache when the system is started or when the
– Print or display the records in either char- System/36 environment value for storing the
acter or hexadecimal representation. deleted file in cache is set to N (No) by the
– Specify the maximum number of records Change System/36 (CHGS36) command or the
to be printed. Change System/36 Environment Attributes
– Make the record length either larger or (CHGS36A) command.
smaller than the original record length.
– Include or omit selected records. | Every library has an Object Information Repository
| (OIR). The OIR is where information about the
LISTFILE procedure. Use the LISTFILE pro-
| objects contained in the library is kept. When a
cedure to list the contents of files or libraries
| file is deleted and stored in the cache, the OIR
from disk, diskette, or tape.
| entry for that file is not removed. The OIR entry is
| replaced if the file is subsequently reused from the
Store Deleted Files in Cache | cache with the same name in the same library.
| Otherwise, the OIR entry persists. If enough of
| System/36 environment has a configuration option | these unused OIR entries accumulate for a library,
| to store files being deleted in a cache. When you | users may be prevented from adding new objects
| create a database file, the System/36 environment | to the library.
| searches the cache for a file with the same attri-
| butes, inserts the file into the library, and removes | The QEXCLNCI program can be called by a user
| it from the cache. Using a file stored in the cache | with QSECOFR authority to remove these unused
| is a faster method of creating a file. | OIR entries. The program must be called with a
Note: When a file that is stored in the cache is | single parameter specified. When a library name
reused, its creation date and time and record | is specified for the parameter, the program
format name are not updated. | attempts to remove the unused entries from the
| OIR of that library. When *ALL is specified for the
Database files meeting the following requirements | parameter, the program attempts to remove
are stored in the cache: | unused entries from the Object Information Repos-
| itories of every library on the system. To reduce
File only has one member | conflicts with other system activity, this function of
File is not an alternate index file or a remote | the QEXCLNCI program should be performed
file (DDM) | during times of low system use.
The program that creates the file arranges records When a record is added to a sequential file, it is
in the same sequence they were placed in the file. placed at the end of the file, not between existing
The program places the first record in the first records. In Figure 7-1, when the file loading
position in the file, the second record in the program adds record 6, it is placed after record 8,
second position, and so forth. not between records 5 and 7. If it is important
that record 6 appear between records 5 and 7,
Figure 7-1 shows the creation of two sequential you can run a sort program to arrange the records
files. The file loading program reads the records into a new ordered sequence.
on the left in the following sequence: 2, 4, 5, 7, 8.
Because the records are loaded onto a disk in this You can process sequential files consecutively,
same sequence, the disk file is a sequential file. randomly by relative record number, or by the
The file loading program reads the records on the generalized processing method (both consec-
right in the sequence: 7, 2, 5, 8, 4. The records utively and randomly). See “File Processing
are loaded onto a disk in the same sequence, so Methods” on page 7-13 for more information.
this is a sequential file also.
7 8
5 5
4 2
2 7
File-Loading File-Loading
Program Program
2 4 5 7 8 7 2 5 8 4
RSLW013-1
8 4
7 8
5 5
4 2
2 7
File-Loading File-Loading
Program Program
Disk File
2 4 5 7 8
RSLW014-1
RSLW015-0
Figure 7-3 shows an example of synonym record by its address in the file. The key (also
records. called the key field or the record key) is the
portion of the record containing information that
Only one synonym record can be stored in a cal- identifies the record. For information about the
culated record position. Therefore, if you use for- rules for forming keys, see “Using Index Keys” on
mulas to create direct files, you must plan how to page 7-11.
store and retrieve synonym records from various
locations within the file. See Appendix A, “Access With an index, a program processes required
Algorithms for Direct Files” for more information. records by referring to the key of the record. For
example, if you have an indexed file with order
You can access direct files consecutively, ran- records containing customer number, amount
domly by relative record number, or by the gener- ordered, and balance due, your program can use
alized processing method. See “File Processing the customer number as the key to find a record
Methods” on page 7-13 for more information. for a particular customer without reading any other
records.
Indexed File Organization
Figure 7-4 on page 7-9 shows how indexed files
In an indexed file, the file loading program are organized.
arranges records in the sequence they were
written. As the records are added, an index, You can process indexed files consecutively,
called the primary index, is built for the file. sequentially by key, randomly by relative record
Thus, an indexed file contains two parts: an index number, randomly by key, or by the generalized
and the sequentially organized records. processing method. See “File Processing
Methods” on page 7-13 for more information.
The index is a table containing an entry for each
record in the file. Each index entry identifies a See the DB2 for OS/400 Database Programming
record by the value of its key and locates the book for information on how to tell how much
space an indexed file requires.
7 8
5 5
4 2
2 7
File-Loading File-Loading
Program Program
Index
Disk File
2 4 5 7 8 2 4 5 7 8
Index
Disk File
2 4 5 7 8 7 2 5 8 4
RSLW016-1
Multiple Indexes for a File All the indexes point to the same data records in
the file, but each index can use a different portion
A physical file is a file that contains data records. of the record as the key. The field(s) used as the
After you create a physical file, you can create key in an index can overlap the field(s) used as
indexes (called alternative indexed files) for that the key in other indexes. Therefore, you can
file without creating new data records (see process records from the file in various
Figure 7-5). sequences, depending on which index you use.
For example, for a personnel file, you can use the
You can create any number of alternative indexed employee number as one key and the department
files. The files you create to define each of the number as a second key. A high-level language
logical files are called alternative indexed files. program treats a multiple-index file the same way
You can create alternative indexed files for any file it treats a normal indexed file.
type: sequential, direct, or indexed. You can
create alternative indexed files with the When changes are made to the physical file, all
BLDINDEX procedure. The System/36 Environ- indexes (primary and alternative) are changed as
ment Reference book has more information about required to reflect the change (if restrictions for
the BLDINDEX procedure. Names for alternative duplicate keys or changing keys are followed).
indexed files must follow the same rules as phys- For example, if you use the employee number as
ical files. one key and the department number as a second
key, changes you make to the file (while using the
Figure 7-5 shows an example of multiple indexes index based on the employee number) are auto-
for an indexed file. matically made in the index based on the depart-
ment number. You must have a FILE OCL
statement for each index that the program uses.
2 4 5 7 8 7 2 5 8 4 Physical
D B A E C File
A B C D E Alternative
Index File
Alternative
Index RSLW017-0
Note: System/36 would not allow the user to information about the file’s size (?F'S'? or
update the primary index fields. The OS/400 ?F'A'?). If the specified file is an alternative
program does not differentiate between indexes, indexed file, the system can substitute the
and all index fields can be modified. number of blocks or records allocated for the
physical file.
Using Multiple-Index Files: When you You can change key values on change oper-
use multiple-index files, be aware of the following ations. When you change an index, consider
factors: the following:
Unlike the System/36, date-differentiated alter- – In a COBOL program, you can change a
native indexed files cannot be created. key that has been used to retrieve the
However, an alternative indexed file can be record. Therefore, do not retrieve the
built for a physical file that is date- record by the field to be changed.
differentiated.
– In an RPG II program, between the record
You cannot delete the physical file if alterna- retrieval (CHAIN, READ, READE, or
tive indexed files are specified for it. The READP operation) and the record change,
RETAIN-S parameter of the FILE OCL state- do not make another retrieval operation to
ment is not allowed for the physical file or for the file (this ensures that you change the
the alternative indexed files. correct record).
To delete a physical file, you must first delete When you change a record, and a key for any
all alternative indexed files. Use the DELETE index is changed or a record is added, dupli-
procedure to delete the alternative indexed cate keys can occur. The duplicate key can
files. You can delete a physical file and all cause an error message to appear for an
indexes by using the file group naming con- index the program is not using. The error
vention and the DELETE procedure to delete message occurs only for indexed files that do
the entire group. See “Using Group Files” on not allow duplicate keys. You indicate
page 7-2 for more information about file whether an indexed file allows duplicate keys
groups. when you create the file. For more informa-
You cannot rewrite (overlay using DISP-OLD tion about specifying duplicate keys, see
on the FILE OCL statement) an existing phys- “Specifying Duplicate Keys” on page 7-11.
ical file if it has alternative indexed files.
Before you can overlay the data in the phys- Saving Multiple-Index Files: When you
ical file, you must delete the alternative use the SAVE procedure to save an indexed file,
indexed files. the system saves the data and a description of the
primary index.
You cannot rewrite an alternative indexed file.
You can only add to or change alternative
When you save an alternative indexed file, the
indexed files.
system saves only a description of the index. It
You can specify a multiple-index file in a pro- does not save the index itself or the data in the
cedure substitution expression that retrieves file. Saving the physical file does not save the
Primary Index:
Key = Fields 1 and 2
Record
Alternative Index:
Key = Fields 5, 9, 7 1 2 3 4 5 6 7 8 9 10 11 12
Checking for Duplicate Keys: If a file does not Key” on page 7-15. When you specify limits for
allow duplicate keys, the system checks for dupli- keys with duplicates, the lower limit is set to the
cate keys before an index entry is added to the first duplicate key in the index, and the upper limit
file (either during add operations or during change is set to the last duplicate key. The upper limit is
operations that change a key field). If an opera- determined as records are read from the file. The
tion would cause a duplicate key in an index that upper limit includes records added by other jobs.
does not allow duplicate keys, the operation is not
allowed. Using Alternative Indexed Files: If you
change, delete, or add records to a multiple-index
Sequence of Duplicate Keys: If an indexed file file, the system must change all the indexes.
has duplicate keys, the sequence of the duplicate Therefore, the number of alternative indexed files
keys is maintained by the relative record number directly affects the performance of the program.
of the records in the file. That is, the first record
entered or added to the file is represented by the It is more efficient to build alternative indexed files
first entry in the index. Change operations do not for a file only when needed. For example, if a
change the position of records in the file. If a program requires a certain index to produce a
change operation changes a key, the new key is monthly report, that index could be built just
put in sequence by the relative record number of before running the job that produces the monthly
the original record. report.
Consecutive processing allows you to process Sequential Files: When the system processes a
records in the order in which they appear in the sequential file consecutively, the space at the end
file. Sequential processing by key allows you to of the file reserved for new records is not read.
process indexed files by the sequence of the keys Therefore, record 4 is the last record read in the
in the index. Random processing by relative sequential file in Figure 7-7.
record number allows you to process a record by
Direct Files: When the system processes a
specifying the record’s relative record number.
direct file consecutively, if it is not delete-capable,
Random processing by key allows you to process,
the program reads the gaps that were left for new
in an indexed file, a record by specifying the
records. Therefore, the program must test for a
record key. Generalized processing allows you to
blank record each time it reads a record. When a
process a file using a combination of the above
program processes a direct file that is delete-
methods.
capable, the deleted records are bypassed. A
Do not confuse these processing methods with file direct file in the System/36 environment is a disk
organizations. However, the file organization file in which records are referenced by the relative
plays a significant role in determining which pro- record number. A direct file is created as an
cessing method you can use in a program. The OS/400 physical file.
following table indicates which processing method
Indexed Files: When the system processes an
you can use for each file organization.
indexed file consecutively, the program ignores
the index portion of the file as it reads the records.
Organization However, if change operations change keys, or if
Processing
Method Sequential Direct Indexed records are added or deleted, the system auto-
Consecutive Yes Yes Yes matically changes all indexes for the file. The
space at the end of the file that is reserved for
Sequential by key No No Yes
new records is not read. Therefore, record 4 is
Random by rela- Yes Yes Yes the last record read in the indexed file in
tive record Figure 7-7.
number
Random by key No No Yes
Generalized pro- Yes Yes Yes
cessing method
(nonkeyed pro-
cessing)
Generalized pro- No No Yes
cessing method
(keyed pro-
cessing)
7 2 5 8 4
Direct File
2 4 5 7 8
Begin Reading
Indexed File
Index Records
2 4 5 7 8 7 2 5 8 4
RSLW019-0
Sequential Processing by Key: When specify the upper and lower limits of the key
the system processes an indexed file sequentially values of the records you process sequentially by
by key, the program processes the records key in ascending order, as shown in Figure 7-9.
according to the sequence of the keys in the
index, as shown in Figure 7-8. You can also specify the limit of the key values for
records you process sequentially by key in
Although the system processes the keys consec- descending order, as shown in the following
utively, it processes the records randomly because figure.
the index entries are sorted but the records are
Limit
not. The system processes records in ascending
order of key value. Index Records
2 4 5 7 8 7 2 5 8 4
Read Records
Read Index
Sequentially RSLW020-0
Low High
Key Key
Index Records
2 4 5 7 8 7 2 5 8 4
Begin End
Processing Processing RSLW021-0
New limits are set Sequential Files: You can processing sequential
A random read operation occurs files randomly by relative record number when you
The file is closed process only a few of the records in the file and
you know the relative record numbers of the
records.
Read Directly
Direct File
2 4 5 7 8
RSLW022-1
Figure 7-10. Random Processing by Relative Record Number for a Direct File
Blank records are not a problem when retrieving Generalized Processing Method: Use
records from a direct file, because the program the generalized processing method to process a
reads only the desired records. In the example in disk file randomly, consecutively, or sequentially
Figure 7-10, the direct file contains customer while changing, deleting, or adding records.
records stored at record positions based on the When using the generalized processing method,
customer number. The program receives a you can do nonkeyed or keyed processing.
request to read the record for customer 4. The
system uses the customer number as the relative For example, assume you have a file of employee
record number. The program retrieves the records containing employee number, department
requested record (the fourth record relative to the number, and location code, and the file is an
beginning of the file) without reading any other indexed file with location code as the key. Using
record. The program must determine whether the generalized processing method with keyed
there is information in the record. processing, your program can process the records
for all the employees at a location.
Indexed Files: When the system processes an
indexed file randomly by relative record number, it As Figure 7-12 on page 7-18 shows, the program
processes the records by their relative record can process the file randomly by key to find the
number values. If change operations change any first record that has the location code.
of the keys in the records, or adds or deletes any
records from the file, the system changes all As Figure 7-13 on page 7-18 shows, after the
indexes for the file. program finds that record, it can process the file
sequentially by key to process the records for the
Random Processing by Key: The system other employees at that location.
processes only indexed files randomly by key.
Figure 7-11 shows an example of random pro- As Figure 7-14 on page 7-19 shows, while pro-
cessing by key for an indexed file. In the example cessing the file, the program can add records to
in Figure 7-11, the program receives a request to the file.
read the record for customer 4. The system uses
Sequential or Direct Files: Use the nonkeyed
the customer number as the key. It retrieves the
generalized processing method to process
record for customer 4 in two steps:
sequential or direct files consecutively or randomly
1. The system searches the index for a value by relative record number.
that matches the requested key. The index
entry with the matching key value also con- Indexed Files: Use the nonkeyed generalized
tains the relative record number of the record processing method to process indexed files by
for that key. using:
2. The system reads the record at that record Consecutive processing
position from the data portion of the file. Random processing by relative record number
Request
Customer 4 Processing
Program
2 4 5 7 8 7 2 5 8 4
Index Records
RSLW023-1
Read Index
Randomly by Key
Program
Process
LOC LOC LOC LOC LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC
A A B C C 001 33 B 002 15 C 003 12 A 004 24 A 005 32 C
Index Records
RSLW024-0
Read Index
Sequentially by Key
Program
Process
LOC LOC LOC LOC LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC
A A B C C 001 33 B 002 15 C 003 12 A 004 24 A 005 32 C
Index Records
RSLW025-0
Add
EMP DEP LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC EMP DEP LOC
001 33 B 002 15 C 003 12 A 004 24 A 005 32 C 006 27 C
Specifying an Extendable File: You can The system automatically extends a file when
specify a file as extendable using either of the fol- records are added using consecutive, sequential-
lowing methods: by-key, or random-by-key access.
The EXTEND parameter of the FILE OCL You can extend a file any number of times, up to
statement specifies the number of blocks or 8 000 000 records. A file is not extended if there
records to extend the file. is not enough disk space, or if a disk input/output
BLDFILE procedure. The number of blocks or error occurs. You cannot cancel a file extension.
records to extend the file is a parameter.
If you have used the maximum number of exten-
The extension value must be a numeric value that sions, the system sends a message to the oper-
indicates the amount of additional space needed ator asking whether the file should be extended
again.
Job Y
// FILE NAME-A,JOB-YES,DISP-SHR
// LOAD PROGB
// RUN
Figure 7-15. OCL Statements Used with Two Jobs Sharing a File
You add records to indexed files randomly by key You can change the buffer size using the
using chaining. Chaining compares the key field DBLOCK parameter of the FILE OCL statement.
of the record to be added with the key fields You can specify a DBLOCK value up to 65 535,
already in the index. This ensures that the record but any value over 32 767 results in a blocking
to be added is not a duplicate of a record already value of 32 767. The block length does not affect
in the file. With chaining you can design your the way records are stored on the disk, but does
program to handle any duplicate key fields it finds, affect when they are stored.
without requiring the operator to respond to an
error message. The System/36 environment allows record
blocking to be used only when the following condi-
The System/36-Compatible RPG II User’s Guide tions are true:
and Reference book has more information about The file is opened for input or output.
using chaining to add a record to an indexed file. Sequential processing is used.
The file is not being shared with other jobs
Using COBOL to Add Records to Delete- (DISP-SHR on the FILE OCL statement is not
Capable Files: If you specify relative organiza- specified).
tion for the file, you can add records to
delete-capable files. When you specify ACCESS To use record blocking when sharing files, do one
IS RANDOM or ACCESS IS DYNAMIC, new of the following:
RSLW027-1
SHR Read and Read and change If the file is not available, the system automatically
change waits for the file until the program using the file
SHRMM Read and Read and change goes to the end of the job step. If the waiting
change program is requesting no share, it must wait until
SHRMR Read and Read only the job that owns the file reaches a job step in
change which the file is not used. While the program is
waiting, all other programs that request the file
SHRRM Read only Read and change
also have to wait. When the file becomes avail-
will function the same as the following statement: The system does not automatically extend files
OVRDBF FILE(FILEA) TOFILE(QS36F/FILEB) MBR(M88ð6ð1)
during an access by relative record number. If
your application needs to extend files during an
Adding the DBLOCK keyword with a value of 100 access by relative record number, you can do so
to the FILE OCL statement produces the following in your application, using two different access
statement: methods on the file at the same time, as follows:
OVRDBF FILE(FILEA) TOFILE(QS36F/FILEB) MBR(M88ð6ð1) + 1. Open the file once for sequential output and
SEQONLY(\YES 1ðð) once for update by relative record number.
Note: If a FILE OCL statement has a name 2. Add blank or deleted records to the end of
matching a work station or printer file being your file, using the sequential access when
opened by a program, the system will try to open
SAVEFLDR
This file cannot be created on the AS/400 Diskette File Expiration Dates
system, but can be restored with the Restore
When you copy a file or library to diskette, one of
System/36 Folder (RSTS36FLR) command.
the parameters you can specify is the number of
SAVE/RESTORE retention days. This parameter specifies how long
The system creates these files when you use the system protects the diskette file. The system
the SAVE, SAVELIBR, or FROMLIBR (sector- uses the value specified for retention days to cal-
mode) procedures in the System/36 environ- culate the expiration date.
ment. The format of the diskette file is the
same as if you used the Save Object The calculation is:
(SAVOBJ) or Save Library (SAVLIB) com- expiration date = program date + retention days
mands. The files can be exchanged only with
another AS/400 system using the System/36 If you specify 999 for the retention days param-
environment RESTORE, RESTLIBR, or eter, the file is considered permanent and never
TOLIBR procedures, or the Restore Object automatically expires. The program date in the
(RSTOBJ) or Restore Library (RSTLIB) com- System/36 environment is the date associated
mands. with a program (job step).
Diskette Data Compression The system examines the expiration date each
time you create a file on diskette. If the date has
Diskette data compression enhances the perfor- passed, the system writes over the file. For
mance of the SAVE or RESTORE procedure by example, a diskette file named FILE1 has an expi-
compressing the duplicate character strings in ration date of 14 July 1988. If you copy another
your data files. To compress in the System/36 file to that diskette before 14 July 1988, FILE1
environment is to replace repetitive characters in a remains on the diskette. However, if you copy a
file with control characters so that the file takes up third file to that diskette on or after 14 July 1988,
less space when saved to diskette. FILE1 is no longer stored on the diskette. The
system automatically deletes FILE1 because its
If you have files with many duplicate characters, retention period has ended.
diskette data compression can reduce the number
This section describes procedures and techniques The INIT procedure can be used to change the
you can use to process diskettes. volume ID or the owner ID without affecting the
data on the diskette, and to remove all files
There is no System/36 environment high-level lan- without changing the volume ID, owner ID, or
guage support for diskette. For your programs to format.
use information on diskette, you must: Note: The AS/400 diskette-related save/restore
1. Copy the diskette information to a disk file procedures require double-density diskettes, for-
2. Run your program to use the disk file matted with FORMAT2 (1024 bytes per sector).
3. Copy the disk file back to diskette
The INIT procedure in the System/36 Environment
Reference book has more information about pre-
Preparing Diskettes paring diskettes.
You prepare a diskette for use by the system
using the INIT procedure. The INIT procedure Copying, Saving, and Restoring
determines the format of the diskette (the number Information
of bytes that can be stored on each sector). It
also deletes information on the diskette. The System/36 environment supplies the following
procedures to let you copy, save, or restore infor-
You may or may not have to prepare your mation using diskettes. The System/36 Environ-
diskettes. If you do not know the format of your ment Reference book has more information about
diskettes, use the CATALOG procedure to check these procedures.
the diskettes. See the System/36 Environment
Reference book for information about the Copying Information: Use the following
CATALOG procedure. procedures to copy information to or from
diskettes:
When you use the INIT procedure, the system
allows you to specify identifying information to be COPYI1
placed on the diskette. This identifying informa- Copies an entire diskette to one or several
tion is: diskettes.
A 6-character name called the volume ID. FROMLIBR
You specify the volume ID on system proce- Copies one or more library members to
dures to make sure you use the proper diskette. If the diskette file created is a
diskette. Valid characters for the ID are A sector-mode file, it can only be copied back to
through Z and 0 through 9. the System/36 environment using the TOLIBR
procedure. If the file is a record-mode file, it
A 14-character name called the owner ID.
can be exchanged with System/36 using the
Use the owner ID to determine the owner of a
TOLIBR procedure, or with the AS/400
diskette. This ID is not checked by the
system using the TOLIBR procedure or the
system procedures, but is displayed by the
Restore System/36 Library Member
CATALOG procedure. Valid characters for
(RSTS36LIBM) command.
the ID are A through Z and 0 through 9.
JOBSTR
If you specify values for the STARTING Copies a diskette file (that contains one or
LOCATION and ENDING LOCATION parameters, more procedure members and source
the values are checked for syntax errors. members) to a specified library. The diskette
However, the values are ignored when you use
Job
Use the ALLOCATE OCL statement to dedicate
Coexistence Considerations
the diskette drive to a job. For example, you have
This section contains the following coexistence
a procedure that saves three files (the diskette
considerations:
has a volume ID of VOL001):
SAVE FILE1,,,VOLðð1 Restoring the AS/400 system to System/36
SAVE FILE2,,,VOLðð1 Restoring System/36 to the AS/400 system
SAVE FILE3,,,VOLðð1 Restoring the AS/400 system to the
System/36 environment
Copy the data to a basic or I-exchange format There are two ways to use diskettes to move
diskette on System/36 using the TRANSFER source and procedure members from an AS/400
procedure. On the AS/400 system use the system to another AS/400 system:
System/36 environment TRANSFER proce-
Save the library that contains the source and
dure or the Copy from Diskette
procedure members to a diskette using the
(CPYFRMDKT) command to copy the data
SAVELIBR procedure. On the other AS/400
back to a disk file.
system, use the RESTLIBR procedure to
restore the library onto the system.
RSLW070-1
System header and trailer labels can include the Note: Some nonlabeled tapes have a leading
following information about the tape file: tape mark. In order to get the first data file,
SEQNUM 2 must be specified to read FILEA data.
Name of the file
Date the file was created
Expiration date of the file
Sequence number (SEQNUM) of the file,
Tape Files
either from the beginning of the tape or the
The types of tape files you can create in the
beginning of a sequence of tapes
System/36 environment are shown in the following
Volume sequence number of the tape, if the
list. Except where noted, the formats of these
file is on more than one tape (a multivolume
tape files are unique to this system. The informa-
file)
tion can be exchanged only with another AS/400
Record length of tape file
system in the System/36 environment.
Record format of tape file
Block length of tape file (system trailer header COPYFILE
only) The COPYFILE file type is created when you
use the SAVS36F command to save a disk
The user header and trailer labels can contain file. The format of the tape file is the same
information about the: as if the SAVE procedure or the $COPY utility
Type of file created program had created it on the System/36.
Size of file created The files can be exchanged with another
AS/400 system using the RSTS36F command
or the RESTORE procedure in the System/36
Nonlabeled environment, or exchanged with a System/36
using the RESTORE procedure.
Use nonlabeled tapes when exchanging data with
systems that do not support the IBM standard EXCHANGE
label tapes. The EXCHANGE file type is created when
you use the System/36 environment
When you copy a file to a nonlabeled tape, the TAPECOPY procedure. The format is the
system does not create volume, header, or trailer same as created by TAPECOPY procedure
labels. You must keep track of the tape informa- on System/36. This type allows information to
tion normally stored in these labels. The following be exchanged with another system, not nec-
figure shows the file format of a nonlabeled tape. essarily System/36.
LIBRFILE
The LIBRFILE is created when you use the
FILEA T FILEB T FILEC T T Save System/36 Library Member
(data) M (data) M (data) M M
(SAVS36LIBM) command to save procedure
and source members from a source file or the
SEQNUM 1 SEQNUM 2 SEQNUM 3 FROMLIBR procedure to create a record-
RSLW071-2 mode file. The format of the tape file is the
same as if the FROMLIBR procedure or the
Each file is assigned a sequence number $MAINT utility program had created it on
(SEQNUM) and a tape mark (TM). System/36. The files can be exchanged with
another System/36 using the TOLIBR proce-
dure or with the AS/400 system using the
You can secure access to an entire tape or to File security will be checked when processing
specified files using the methods described in the standard label, or bypass labeled tapes only.
following sections.
On the cartridge tape drives, you control write Automatically Advancing to Next
access by using the write-protect device on the Tape Drive
cartridge. Set the device to write-enable to allow
information to be written onto the tape. Set the The AUTO parameter on procedures and on the
device to write-disable to prevent any information tape FILE statement determine whether or not
from being added to or changed. processing should automatically advance to the
next tape drive when processing is complete on
Using Tapes Secured by Other the first drive. When using these procedures or
Systems the tape FILE statement, the following should be
considered:
If tapes created on systems other than the AS/400 The default for the AUTO parameter is to
system were secured using the following methods, always automatically advance to the next tape
they will remain secure in the System/36 environ- drive if the unit is T1 or T2. The AUTO
ment. parameter is ignored if the unit is TC.
If the next tape drive is either not available or
Securing Access to Tapes: Security not configured and AUTO or AUTO-YES was
access on IBM standard label tapes is controlled specified or is the default, the values are
by a code of X'00', X'40', or X'F0' in the tape ignored and only the first tape drive is allo-
volume label (VOL1). If one of these codes is not cated. If the next tape drive is available, it is
found, only a security officer can continue using allocated when the first tape drive is allocated.
the tape. The system checks volume security
when processing standard label or bypass label If AUTO or AUTO-YES is specified or is the
tapes only. default, the next tape drive must support the
same density as the first tape drive. The tape
mounted on the next drive must be initialized
Securing Read/Write Access to Files:
to the same density as the first tape. If the
Security access to files on IBM standard label density of the next tape is not the same as the
tapes is controlled by a 0, 1, or 3 in the header first tape, an error message is issued.
label (HDR1) for each file:
When configuring your System/36 environ-
0 No security access to the file. ment, you should use caution when assigning
1 You must be a security officer to read or write unit IDs of T1 or T2 to a cartridge tape drive.
to the file. Cartridge tape drives and reel-to-reel tape
drives do not have the same density. If T1 is
Sign-On Security
Sign-on security is active when your system secu-
rity level is 20, 30, 40, or 50. A user must type a
password and a user name on the Sign On
User Profile
Resource display to sign on the system (a user profile by
Special
Authorities
Security that name must exist).
Note: Your system is shipped with physical secu-
rity active, and user passwords are not required.
Anyone can sign on the system by typing any user
name from 1 to 10 characters. If a user profile by
that name does not exist, the system creates one
Access to
Resources
and the user is given authority for a minimal-
RSLW102-0
security system.
User Class
The classification you specify in a user profile
determines what system control operations and
menu options the user can use. The user classes
(C) COPYRIGHT IBM CORP. 198ð, 1988.
are:
á ñ *SECOFR: Security Officer
*SECADM: Security Administrator
Notes: *PGMR: Programmer
1. Passwords do not appear when you type them *SYSOPR: System Operator
on this display. *USER: General User
2. The Password field does not appear on a Each user class has a set of special authorities
level 10 system. associated with it depending on the system secu-
rity level you use. See the Security – Reference
book for information about the special authorities
User Profiles and Special User associated with each user class.
Authority
See “System/36 User Identification File” on
User profiles identify users on the system. They page 11-8 for information about how these user
tell the system who can sign on and what func- classes compare to System/36 user profile secu-
tions can be performed after signing on. Create rity classifications.
user profiles with the Create User Profile
(CRTUSRPRF) CL command. See the CL Refer- Special Authority
ence book for more information.
Special authority allows a user to perform system
Throughout this chapter the term user also means control operations such as saving the system,
remote users starting communications jobs. controlling other users' jobs, using the system
Therefore, user profiles must be created for service tools, controlling spooled files, and cre-
remote users to sign on and allow access to ating user profiles. You assign special authority in
system resources. the user profile by specifying the class of user
(that has the appropriate special authorities asso-
User profiles tailor the way a user operates on the ciated with it) or by tailoring the special authorities
system by controlling or assigning: for a specific user environment. Use the Create
User class User Profile (CRTUSRPRF) or the Change User
Special authority Profile (CHGUSRPRF) CL command to assign
special authority.
During migration from your System/36 to the Access Levels: When the System/36
System/36 environment, security levels and classi- resource security file is migrated to the System/36
fications are migrated following the procedures environment, the System/36 access levels are
described in this section. mapped to system-defined authorities on the
AS/400 system, as shown in the following figure:
System/36 User Identification File
Figure 11-1. Access Levels and AS/400 System-
Each user profile defined in the System/36 user Defined Authorities
identification file is replaced on the AS/400 system
System/36 AS/400
with an AS/400 user profile. The following table
Access Level System-Defined Authority
shows how the System/36 user profile security
classifications are mapped to AS/400 user profile Owner *ALL
Change *CHANGE + *OBJEXIST
user classes:
Update *CHANGE
Read *USE
System/36 Security Classi- AS/400 System User Class Run *USE
fication
None *EXCLUDE
M — Master Security Officer Security Officer —
*SECOFR
S — Security Officer Security Administrator — Resource Ownership: On System/36, a
*SECADM resource can have multiple owners or no owner.
O — System Operator System Operator — On the AS/400 system, a resource must have one
*SYSOPR and only one owner. When resources are
C — Subconsole Operator System Operator — migrated from System/36 to the AS/400 system,
*SYSOPR ownership is established using the following rules:
D — Display Station User User — *USER
Resources with no owner on System/36 are
owned by a system-supplied default owner
If you are familiar with System/36 security classi- user profile called QDFTOWN.
fications, use this mapping as a guideline when Resources with more than one owner are
you are assigning user class to new users. owned by the first owner found in the resource
security file. All other System/36 owners are
System/36 Resource Security File given all (*ALL) authority to the resource but
are not owners.
On System/36, the resource security information is
Library members, which could not have an
contained in the resource security file and applies
owner on System/36, are given the same
to files, libraries, folders, subdirectories, folder
owner as the library that contained them.
members, and special resource types such as
alternate index files, the system library, and
groups of files, libraries, and folders. On the Libraries: When a secured library is migrated
AS/400 system, authority to objects are associated from System/36 to the AS/400 system, an authori-
with the object itself, not in a separate file. Also, zation list is created with the same name as the
authority to objects is checked by the System/36 library. This authorization list is used to secure
environment whenever an object is referred to, not the library and all the objects migrated into the
just when it is used. For example, the FILE OCL library.
statement and the ?F'S,NAME'? procedure sub-
stitution expression both require a minimum Each user record in the resource security file for
authority of *USE to the file to be run. On the library is added to the authorization list with a
System/36, the FILE OCL statement and comparable access level. The public authority for
?F'S,NAME' substitution expression could be run the authorization list comes from the default
without any authority to the file. The following access level specified for the library in the
1. Files can be secured without the use of an If you want to add your own new GROUP entry,
authority holder, just like other objects. create an authorization list (CRTAUTL command)
However, if the file is deleted and recreated, with the group name as its name and add
all the authorities previously granted to the file authority (ADDAUTLE CL command) for each user
are lost unless an authority holder is defined. you want to use the group. Use this authorization
2. DISP-OLD processing of files requires *ALL list to secure all the objects in the group by specif-
authority to the file. On the System/36 it ically granting the authorization list authority for
required CHANGE authority. When the objects.
DISP-OLD processing occurs for existing files,
the required authority to the file’s library may When new files are created in the System/36 envi-
require *CHANGE if it is necessary to change ronment with the GROUP name as part of their
the attributes of the existing file. name, they are automatically secured with this
authorization list. Other objects such as libraries
3. When a new file is created, and the file and programs are not.
already exists with a different date (date-
differentiated files), *ALL authority is required Note: Automatically adding files to group authori-
to the existing file. zation lists only occurs when files are created
using System/36 environment procedures (for
example, the BLDFILE or COPYDATA proce-
If the parent is a library, the authorization list Entering the System/36 Environment:
created for the library is used to secure each When an AS/400 job becomes a System/36 envi-
child. If the child is a library, the authorization list ronment job by entering the Start System/36
of the parent is used to secure the library and (STRS36) CL command or Start System/36 Proce-
each of the objects in the library. Authorization dure (STRS36PRC) CL command, or because the
lists created for parent-child relationships will be special environment value (SPCENV(*S36)) is
used for files and libraries instead of any GROUP specified in the user profile, the user must have
authorization lists that may have been defined. *USE authority to the following libraries:
The #LIBRARY library
Parent-Child after Migration: To continue using
The QSSP library
the parent-child concept to secure resources in
The System/36 environment files library
the System/36 environment, create an authori-
The current (*CURLIB) library
zation list (CRTAUTL command) and add authority
for each user to use the parent (ADDAUTLE If no current library exists when the System/36
command). When creating new children objects, environment is entered, #LIBRARY is made
use this authorization list to secure them. If the the current library.
child is a library, each of the objects within the
library must have a specific grant to the authori- Command Security: On the AS/400
zation list. system, CL commands themselves can be
Note: Library objects that are deleted and recre- secured, just as resources are. For example, the
ated without specifying an authority are created CL command CRTPF could be secured so that
with the create authority (CRTAUT) of the library only the system security officer is allowed to
they are created into. Libraries that are deleted create files. This can be done by using the
and recreated without a specified authority default GRTOBJAUT CL command to change the public
to the create authority of library QSYS. authority of the file to *EXCLUDE. When this type
of security is used on your system, System/36
environment commands and procedures are also
affected. For more information about securing
commands, see the Security – Reference book.
Check authority of user to files used Note: When a MRT program opens a file, the
by MRT program . . . . . . . . . . . 1 1=All users
2=First user user profile under which the MRT program is
Seconds to wait before ending a
non-NEP MRT . . . . . . . . . . . . . . 6ð ð-32767 running must always have authorization to that
file, or the open request will fail.
Bottom
Assign meaningful and standard field names to The high-level language you use to write your
make your program and the related application program determines the maximum length you can
clear and easy to use. specify for your field names. See the correct lan-
guage book for information about the maximum
Establish a list of standard abbreviations to use for length allowed for field names in the programming
field names because most high-level languages language you use.
(such as RPG II or COBOL) limit the number of
characters you can use for field names. For
example, you can abbreviate the word MASTER Using Numeric Fields
as MST, MAST, or MSTR. Choose one abbrevi-
ation and use it consistently. System/36 is a zoned decimal system. The
AS/400 system is a packed decimal system. If
When you use files containing fields that have the
you have numeric fields, determine whether the
same name, assign a prefix to the field name to
field is to be in zoned decimal format, packed
avoid confusion. For example, use MST as the
decimal format, or binary format. Packed and
prefix to all field names in your master file, or
binary formats reduce the amount of space
TRAN for transaction file, PAY for payroll file, and
needed to store numeric information.
INV for inventory file.
Allow the maximum length for amount fields to
Standardize the field description entries for your
prevent a high-order position from being lost.
files. Write a field description for each of your
In Figure 12-1, the zone portion of the farthest When the zone portion of the farthest right byte is
right byte represents a positive sign by changed to represent the sign, the farthest right
hexadecimal F (1111) or C (1100), and a negative byte becomes a character that cannot be printed
sign by hexadecimal D (1101). or displayed.
Bits 0 7 0 70 7 0 7 0 7
Zone Digit Zone Digit Zone Digit Zone Digit Sign Digit
Byte Bits
1101 = Negative
1111
or = Positive
1100
RSLW047-1
7 4 6 2
1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 01 1 0 1 1 1 1 0 0 1 0
RSLW048-0
Figure 12-2. Example of the Number 7462 Stored in Zoned Decimal Format
0 7 4 6 2
0 0 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 0 1 1 1 1
RSLW050-0
Figure 12-3. Example of the Number 7462 Stored in Packed Decimal Format
ð1 23 4F ð4 B1 2C 4F
However, if you define a numeric field with a value Internally, RPG II works in zoned arithmetic and
of −1234 as a signed packed decimal field, it is converts fields from packed to zoned when the
stored as: data is read from a file. In the conversion
process, the invalid digits are changed to zero for
ð1 23 4D
packed fields. RPG II in turn converts the field
from zoned format back to packed format before
To print or display a packed decimal field, you
writing it to the file. COBOL applications are able
must translate it into its zoned decimal equiv-
to define and manipulate fields in packed decimal
alents.
format without converting them to zoned. The
The maximum length of a packed decimal field is AS/400 system (including System/36 Environment
15 digits (8 bytes of storage). The following list programs) does not support operations with
shows the number of bytes of storage required to packed decimal format fields that contain invalid
store zoned decimal and packed decimal fields: digits. If the program detects a decimal data
error, an error message will appear. The user
should end the application, correct the data in
Digits Zoned Packed error, and change the program(s) that introduced
in Decimal Decimal the invalid digits.
Number Format Format
1 1 1 Binary Format
2 2 2
3 3 2 Data in binary format is represented in storage in
4 4 3
binary digits (as a number to the base 2). A binary
5 5 3
field occupies less storage than a zoned decimal
6 6 4 field and sometimes occupies less storage than a
7 7 4 packed decimal field. The following list shows
8 8 5
how many bytes of storage are occupied by binary
9 9 5
10 10 6
fields of various lengths:
11 11 6
12 12 7 Number of Bytes Required Bytes of
13 13 7 Digits to Represent Storage
14 14 8 in Field the Number Occupied
15 15 8
1 to 2 1 2
3 to 4 2 2
5 to 6 3 4
Note: System/36 allows a program to include
7 to 9 4 4
nonnumeric data in a numeric field. For example, 10 to 11 5 8
the number 12 preceded by two blanks would be
12 to 14 6 8
stored as:
15 to 18 7 8
4ð 4ð F1 F2
+ or − signs
A plus (+) or minus (−) sign is optional before
Sign
Position RSLW051-0
the mantissa and before the exponent. If no
sign is specified, the system assumes a posi-
tive mantissa or exponent. A plus (+) sign
If you define a binary field as signed, it is stored indicates positive values and a minus (−) sign
as a negative number. Negative binary fields are represents negative values.
stored in twos complement. To find the twos com-
plement of a binary field, follow these steps: mantissa
The mantissa can contain from 1 to 16 digits.
1. Change the setting of each bit in the binary The mantissa must contain one actual or
representation: assumed decimal point as a leading,
Change each 0 to 1. embedded, or trailing symbol.
Change each 1 to 0. E The letter E immediately follows the mantissa
2. Add 1 to the new binary representation. and indicates the exponent.
exponent
For example, in the following figure, the value
The exponent immediately follows the second
−1234 is stored as hex FB2E:
optional sign character. It can contain from 1
to 3 digits.
F B 2 E
1 23 45 9 10 34 35 59 60 81 82 83 84 88 89 90 91 128
RSLW035-0
RSLW061-1
RSLW062-0
-or-
RSLW096-3
Figure 13-1. System/36 ENABLE Statement and AS/400 VRYCFG Command Example
ENABLE MEMBS,LIBRX,2,,RMTLOC2
// SESSION SYMID-xx,LOCATION-RMTLOC2,etc.
RMTLOC1
Remote loc. info RMTLOC1 Note 1
RMTLOC2 RMTLOC1 Note 2
Remote loc. info
RMTLOC3
Remote loc. info RMTLOC2
etc. RMTLOC2
RMTLOC301
RMTLOC3 Note 3
RMTLOC302
RMTLOC3 Note 3
RMTLOC303
RMTLOC3 Note 3
RSLW089-5
A logical unit (LU) is one of three types of location defines three 3270 device emulation
network addressable units that serve as a port displays. However, a reference to the original
through which a user accesses the communica- remote location name is within each device
tions network. Because System/36 subsystem description. See the Remote Work Station
members alone contain little pertinent information Support book for more information about
(they are containers for remote locations), they remote location names.
have no counterpart on the AS/400 system.
Figure 13-2 does not show the relationship
Notes: between System/36 APPC session groups and the
AS/400 system counterparts for session groups
1. The name shown above each box is the
(mode descriptions). Advanced program-to-
device description name.
program communications (APPC) is a data
2. The name shown within each box is the communications support that allows programs on
remote location name (RMTLOCNAME) an AS/400 system to communicate with programs
defined in each device description. on other systems having compatible communica-
3. Some communications types require a tions support. APPC is the AS/400 method of
one-to-one relationship between device using the SNA LU session type 6.2 protocol.
description and remote location name. Advanced peer-to-peer networking (APPN*) is a
Figure 13-2 is an example of one remote data communications support that routes data in a
location resulting in multiple device network between two or more APPC systems that
descriptions. This occurs if the remote are not directly attached. See the APPC Pro-
gramming and the APPN Support books for infor-
On the AS/400 system, the remote location name In Figure 13-5 on page 13-8, if the line described
for APPC is a character string up to 8 characters by the System/36 line member is an X.25 line, the
long, of which the first character is uppercase A to general information part of the line definition refers
Z, $, #, or @. The remaining characters are to an X.25 virtual circuit configuration member
uppercase A to Z, $, #, @, or 0 to 9. This con- (located in the same library) that supplies specific
vention is enforced by AS/400 system configura- virtual circuit information for each remote system
tion (that is, you cannot enter any other in the line member. A virtual circuit is a logical,
characters) for the remote location name of all rather than a physical, connection that is estab-
communications types. lished and controlled by a managing network in a
packet-switching communications environment.
The System/36 convention for the remote location On the AS/400 system, the specific virtual circuit
name is more lenient for communications types information associated with a remote system is
other than APPC. Therefore, remote location defined in the controller description that corre-
names cannot be migrated from System/36 for sponds to the remote system information.
those cases where the names do not follow
AS/400 convention. On System/36, as Figure 13-6 on page 13-9
shows, the X.25 virtual circuit member refers to an
The AS/400 counterpart for each remote system X.25 member (always in library #X25LIB) that con-
definition is called a controller description. The tains X.25 network (PSDN) default values and
AS/400 counterpart for the general line information subsystem information.
in a line member is called a line description.
On System/36, as Figure 13-7 on page 13-10
In the System/36 SSP-ICF line member, each shows, for the line number specified on the
remote system accessed by a switched line or ENABLE statement, two sets of system configura-
X.25 switched virtual circuit can refer to a phone- tion information exist for each line:
or connection-list member in the same library.
A system-wide set of information
(X.25 defines the interface to an X.25, packet-
A set of information associated with each work
switching network.) It contains telephone or con-
station
nection numbers that automatically connect to the
remote system. The set associated with each work station allows
a job started at one work station to change the
As Figure 13-4 on page 13-7 shows, there is no
line characteristics without affecting the character-
AS/400 counterpart for the phone/connection list.
istics used by jobs started at other work stations.
ENABLE MEMBS,LIBRX,2,,RMTLOC2
// SESSION SYMID-xx,LOCATION-RMTLOC2,etc.
RMTLOC1
RMTLOC1
Remote loc. info
RMTLOC2 RMTLOC1
Remote loc. info
RMTLOC3 RMTLOC2
Remote loc. info
etc. RMTLOC2
RMTLOC301
RMTLOC3
RMTLOC302
RMTLOC3
RMTLOC303
RMTLOC3
(a)
(SSP-ICF line member) (b)
RMTSYS1
Line information
RMTSYS1
(Rmt sys info)
RMTSYS2 RMTSYS2
(Rmt sys info)
RMTSYS3
(Rmt sys info)
RMTSYS4 RMTSYS3
(Rmt sys info)
etc.
RMTSYS4
(c)
MEMBN
Others
RSLW090-6
Figure 13-3. Multiple Subsystems Can Communicate with a Single Remote System
ENABLE and VRYCFG Hierarchy On the AS/400 system, the System/36 hierarchy is
reversed. When the system activates a line
and Examples description, network elements that depend on the
description can be activated. However, you
On System/36, when a remote location is acti-
cannot activate a device description until you acti-
vated, both the specific remote system and the
vate a controller and line description.
line are activated.
Note: Also, a resource name associates the line
Note: The physical line used by the application is
description with the hardware. Therefore, if a line,
not specified until the ENABLE procedure is
controller, and device are to be used on a different
started. Therefore, one subsystem member and
line, you must change the resource name in the
one line member can be used on lines with the
line description (using a Change Line Description
same characteristics.
[CHGLINxxx] command) before activating it.
ENABLE MEMBS,LIBRX,2,,RMTLOC2
// SESSION SYMID-xx,LOCATION-RMTLOC2,etc.
RMTLOC1
Remote loc. info RMTLOC1
RMTLOC2 RMTLOC1
Remote loc. info
RMTLOC3 RMTLOC2
Remote loc. info
etc. RMTLOC2
RMTLOC301
RMTLOC3
RMTLOC302
RMTLOC3
RMTLOC303
RMTLOC3
(a)
(SSP-ICF line member) (b)
RMTSYS4
(b)
MEMBX
(c)
Phone list MEMBN
-or-
X.21 connection list
-or-
X.25 connection list Others
(c)
#IBSRID (BSCEL remote id list)
RSLW091-5
Figure 13-4. System/36 Remote ID List Mapped to the AS/400 Controller Description
ENABLE MEMBS,LIBRX,2,,RMTLOC2
// SESSION SYMID-xx,LOCATION-RMTLOC2,etc.
RMTLOC1
Remote loc. info RMTLOC1
RMTLOC2 RMTLOC1
Remote loc. info
RMTLOC3 RMTLOC2
Remote loc. info
etc. RMTLOC2
RMTLOC301
RMTLOC3
RMTLOC302
RMTLOC3
RMTLOC303
RMTLOC3
(a)
(SSP-ICF line member) (b)
RMTSYS1
Line information
RMTSYS1
(Rmt sys info)
RMTSYS2 RMTSYS2
(Rmt sys info)
RMTSYS3
(Rmt sys info)
RMTSYS4
RMTSYS3
(Rmt sys info)
etc.
RMTSYS4
(b)
MEMBX
(c)
Virtual circuit
MEMBN
configuration info
For RMTSYS1
For RMTSYS2
For RMTSYS3
etc. Others
RSLW092-5
See the Work Management book for information A search is made for a prestart job entry
about OS/400 subsystems. matching the program name passed on the
program start request. If a match is found,
Considerations for System/36 the program start request is attached to a pre-
start job.
Environment Program Start
Requests Note: A procedure name cannot be specified
on the prestart job entry.
When an OS/400 subsystem (such as QBASE) A search is made within file QS36PRC for a
receives a program start request, it attempts to procedure that matches the procedure or
determine whether the job should run in the program name passed on the program start
System/36 environment by checking the following: request. The OS/400 subsystem searches:
ENABLE MEMBS,LIBRX,2,,RMTLOC2
// SESSION SYMID-xx,LOCATION-RMTLOC2,etc.
RMTLOC1
RMTLOC1
Remote loc. info
RMTLOC2 RMTLOC1
Remote loc. info
RMTLOC3 RMTLOC2
Remote loc. info
etc. RMTLOC2
RMTLOC301
RMTLOC3
RMTLOC302
RMTLOC3
RMTLOC303
RMTLOC3
(a)
(SSP-ICF line member) (b)
RMTSYS1
Line information
RMTSYS1
(Rmt sys info)
RMTSYS2 RMTSYS2
(Rmt sys info)
RMTSYS3
(Rmt sys info)
RMTSYS4
RMTSYS3
(Rmt sys info)
etc.
RMTSYS4
(b)
MEMBX
(c)
Virtual circuit MEMBN
configuration info
For RMTSYS1
For RMTSYS2
For RMTSYS3 Others
etc.
#X25LIB
(b)
(Network configuration)
Network configuration
information
Virtual Circuit #1
Virtual Circuit #2
Virtual Circuit #3
etc.
RSLW093-5
Figure 13-6. X.25 Subsystem Information Defined in the AS/400 Line Description
– The library specified on the program start – The System/36 environment library
request (which becomes the current library (QSSP)
for the job)
If the subsystem finds a procedure, the job
– Library #LIBRARY runs in the System/36 environment. A proce-
dure is found if the name follows System/36
ENABLE MEMBS,LIBRX,2,,RMTLOC2
// SESSION SYMID-xx,LOCATION-RMTLOC2,etc.
(a)
(b)
Figure 13-7. Line Configuration Information Defined in the AS/400 Line Description
System/Work Station
Configuration Line 1 Line 2 Line 3 etc.
Information Info Info Info
Association with a
line is done at
ENABLE time
Associated with a
Line Member Information MEMBN Line Description MEMBN line (resource) at
CRTLINxxx time
Subsystem Member Information RMTLOC1 RMTLOC2 RMTLOC3 Device Descriptions RMTLOC1 RMTLOC2 RMTLOC3
(MEMBS)
The highlighted portion of the network is activated using The highlighted portion of the network is activated using
If all three remote locations are to be activated, and are all If all three remote locations are to be activated, use:
defined in MEMBS, they are activated by using
ENABLE MEMBS1,LIBRX,,2,RMTLOC1
ENABLE MEMBS2,LIBRX,,2,RMTLOC2
ENABLE MEMBS3,LIBRX,,2,RMTLOC3
RSLW095-4
502 Output queue was not All 714 Default user profile is All except finance
found. not valid.
503 Class was not found. All 715 Neither password nor All
user ID was provided,
504 Library on initial All and no default user
library list was not profile was specified
found. in the communications
entry.
On the AS/400 system, device I/O is done through Tying the Application to
a device file. For communications, an ICF device Communications Configurations
file is used to send and receive data between two
application programs, and describe how to present Each program that establishes a session includes
the data. at least one SESSION statement in the procedure
that loads your program. Place the SESSION
The ICF file is comparable in concept and use to statement between the LOAD and RUN OCL
a IDDU data dictionary’s communications file defi- statements for the program. Use the SESSION
nition on System/36. The ICF file contains record statement to specify three things:
formats used by the application in I/O applications.
Each record format describes the data layout and The LOCATION parameter of the SESSION
contains processing keywords that provide func- statement identifies the communications con-
tions similar to the SSP-ICF operations and IDDU figuration with which the program communi-
format definition communications functions. This cates. The LOCATION parameter identifies
information is described external to the application the remote location (specified as part of the
through data description specifications (DDS). device description) associated with the
session.
QICDMF File: Communications applications On the SYMID parameter, the SESSION
running in the System/36 environment that use the statement identifies the symbolic identifier of
specially defined SSP-ICF operations (such as the session. Your program uses this identifier
$$EVOK) automatically use a system-supplied ICF when it establishes the session and when it
file called QICDMF in library QSYS. This file is issues an operation to the session. The iden-
established with characteristics that affect your tifier must be 2 characters. The first character
application. For example: must be numeric (0 through 9). The second
character must be alphabetic (A to Z, $, #, or
The maximum record length of the system-
@).
supplied QICDMF file is 4096 bytes. If you
modify your System/36 environment applica- The SESSION can also specify one or more
tions to use a greater record length, the parameters that change the attributes of the
maximum record length of the file must be configuration for that session only.
increased. If all your applications use a
record length less than 4096 bytes, you can In other words, the SESSION statement identifies
also decrease the maximum record length of the session and remote location with which your
program communicates, and indirectly identifies
the communications type the application uses.
OS/400 ICF
Data Link
Source Program
Open ICF File
RSLW087-1
Remote Program
Procedure (start a program/procedure)
. Start Request
.
. Session and transaction
are started when the
remote program start
Target Program request is received.
RSLW088-1
Figure 13-12 shows how the remote system starts program does not issue an ACQUIRE or
the session by running a remote program start EVOKE. However, your program can
request. The following list explains the steps. acquire other sessions with the remote
system once your program is running.
.1/ A procedure or program starts when your
system receives the program start request .2/ The program must open the ICF file. The
from the remote system. If it is a procedure, QICDMF file is automatically used for appli-
the job started is a System/36 environment cations using the specially defined ICF oper-
job (see “Considerations for System/36 Envi- ations. In an RPG II program, the file is
ronment Program Start Requests” on opened implicitly.
page 13-8 for more information). This pro-
.3/ You can send two types of information with
cedure starts the application program that
the program start request:
communicates with the remote system. The
session and transaction also start when the Parameters for the procedure
program start request is received. Data for your program
Because the remote system started the Note: When you are creating a procedure
session and transaction, the application that has parameters sent to it with the
The following table shows the *STATUS values In COBOL, the communications operations are
returned in the RPG II INFDS for each major and done by the statements shown in the following list.
minor return code. Use the table to determine the See the System/36-Compatible COBOL User’s
ICF major and minor return code or group of Guide and Reference for additional information
codes that correspond to the *STATUS value. about statements used in a communications
program.
RPG II *STATUS ACQUIRE
Major Code Minor Code Value Use the ACQUIRE statement to specify the
00, 01, 02 All (except 10) 00000 session you are acquiring for the specified
00, 02 10 01321 TRANSACTION file. You must also specify
03 00 01311 the 2-character session identifier as a SYMID
03 01, 02, 03 01299 parameter on the SESSION OCL statement.
03 08 01275
03 10 01331 ACCEPT
03 14 01311 Use the ACCEPT statement to get the attri-
03 15 01299 butes of a session. You can issue the opera-
03 1C 01275 tion at any time during a session to determine
04 02, 11, 12 01299 the session’s status. The following table
08 00 01285 shows the fields contained in the status infor-
11 00 00011
mation received by the ACCEPT statement.
28 00 00000
34 01 01201
34 31 01201 Position Value Meaning
80, 81, 83 All 01251 1 A Session not yet
82 All 01281 acquired by the
program.
C Session initiated by
COBOL Statements Used for Commu- source program.
nications: Programs written in R Session initiated by
System/36-compatible COBOL use a TRANS- remote program.
ACTION file for communications operations. Use 2 N Input not invited.
the SELECT statement in the FILE-CONTROL I Input invited but not
available.
paragraph to define the TRANSACTION file. The
O Input invited and
ASSIGN clause associates the TRANSACTION
available.
Consider the following about System/36 environ- Send Fail (FAIL) function FAIL
Sends a fail indication to the
ment applications that refer to ICF files:
remote system.
The number of System/36 environment appli- Send Request to Write (RQSWRT) RQSWRT
cations is determined by the System/36 to function
AS/400 migration aid, which determines the Specifies that the program is
maximum number of sessions allowed by ICF requesting permission to write.
files created from migrating IDDU communica- Invite (INVITE) function INVITE
tions file definitions. Alternatively, the Specifies that the program is
maximum number of sessions is set at 6 when inviting input from the remote
the data dictionary is restored using the program.
RSTS36FLR command.
Evoke Process (EVOKE) function EVOKE,
When your application attempts to acquire Starts a program on the remote SECURITY,
more sessions than the ICF file allows, the system. and SYNLVL
application receives an 82A8 return code. If Confirm (CONFIRM) function CONFIRM
your application receives this code, increase Requests that the remote program
the maximum program device value for the file confirms receiving data.
Put End of Transaction (DETACH) DETACH See the ICF Programming book for a summary of
function the return codes supported by each communica-
Informs the remote program that
tions type. Each communications programming
the sending program is ending the
conversation. book provides detailed information about return
code communications types supported and the
necessary recovery actions.
DDS keyword support for ICF files is a superset of
System/36 IDDU support. See the DDS Refer- System/36 Environment Return Code
ence book for more information about the DDS Considerations: The following System/36
keywords. See the ICF Programming book for return codes are unique to System/36 applications
information about the use of DDS keywords with running in the System/36 environment of the
communications applications, and for more infor- AS/400 system. They are not documented in the
mation about ICF files. ICF Programming book.
For more information on OS/400 support of IDDU, 2800 Return code 2800 indicates a program
see the IDDU Use book. that previously released its requester
session is trying to use the released
session.
Return Codes and Messages
01xx A major return code of 01 indicates this is
When an error occurs that affects an AS/400 a new requester. This return code is
application program, the system sends a message used primarily by multiple requester ter-
to the program message queue of the program. minal (MRT) applications. The same
The messages are logged in the job log and you minor return codes supported with a 00
can use them to determine problems. On major return code are supported with the
System/36, comparable messages were given to 01 major return code.
the work station or system operator with several
options, including options 2 and 3. Answering the A major return code of 02 on System/36 indicates
messages with option 2 or 3 canceled the that a STOP SYSTEM or STOP SESSION has
program regardless of the error handling logic of been entered, or that communications is ending.
the program. Because the AS/400 messages A major return code of 02 on the AS/400 system
given in the job log do not affect the processing of indicates that the job or subsystem is ending. For
the application, an application that does not more information concerning error handling, see
handle error recovery properly can loop on error “Error-Handling Considerations” on page 19-8.
conditions.
APPC support for the AS/400 system differs from Use the Release (REL) ICF operation to
System/36 APPC support in the way it handles release the session after you send or receive
sessions that send or receive a detach function. a detach function.
Before you try to use the evoke function
The difference between these systems is the way again, you must acquire a new session. This
sessions are released. On the System/36, APPC causes the switch line to be dialed if discon-
support holds the session until the user releases it nected. Therefore, if a session is not avail-
by using the Release (REL) ICF operation. On able, you receive the same return code on an
the AS/400 system, APPC support allows the AS/400 system as you get on a System/36.
AS/400 SNUF: When BATCH-NO is specified on The timing of when an application will get
the SESSION statement, SNUF handles each notification of an SNA error will vary from
record from the application program as a complete System/36 to the AS/400 system, based on
chain. If you expect to receive data from an various factors, such as frame sizes.
IMS/VS application, and you are operating in On the System/36 when an application issued
forced terminal response mode, IMS/VS requires a put operation, SSP-ICF data management
that a change direction indication must also be sent the data to the SSP-ICF subsystem and
sent when a chain ends. This means that the then returned control to the application without
application program cannot issue multiple output waiting for the operation to complete. There-
operations consecutively. To assure that the fore, if the subsystem determined that the
change direction indication is sent, each output or operation was not valid based on the state of
evoke function must be accompanied by an invite the session, the application was not notified
or input operation (such as a write with invite). A until the next operation. On the AS/400
modifier of detach also causes a change direction system, the application is notified as soon as
if the secondary is not allowed to send an end- possible of the state error that occurred.
bracket indicator. Note that a standard evoke
function followed by either an invite or input opera-
Change Direction/EOT Processing: The
tion is not acceptable, because the change direc-
System/36 BSC/IMS subsystem was always one
tion indication will not accompany the evoke, and
record ahead of the user. A read for change
for that reason IMS/VS will reject it.
direction or EOT was done in background pro-
cessing so the line was free, in case the user did
When BATCH-YES is specified on the SESSION
not get back to read the EOT. Some application
statement, and you are operating in forced ter-
programs may have taken advantage of this
minal response mode, SNUF sends each record
action, and issued an output operation, instead of
from the application program as an element of a
a read, when the user knew that the data was
chain. Sending records in this manner allows the
complete. However, if you choose to migrate your
program to perform consecutive output operations.
application to the AS/400 environment, this
However, if you expect to receive data from an
support is not available. the user program must
IMS/VS application, and you are operating in the
continue to read until change direction or EOT is
forced terminal response mode, a change of direc-
indicated.
tion must still be indicated at the end of each
chain. Therefore, do not terminate a chain with an
end-of-group function. The last output operation
should include an invite, input, or detach modifier,
Using CL Override Commands
or the output operation should be followed by an
The Override Intersystem Communications Func-
invite or input operation.
tion File (OVRICFF) command may be used to
override the name or attributes of the file specified
in a System/36 application program. If you specify
OVRICFF in a System/36 procedure or from the
System/36 Command Entry display in a
System/36 environment job, it affects that job step
and succeeding job steps in that System/36 job
System/36 Environment
Action Result on AS/400 System
HELP <Procedure If you specify a System/36
á ñ or Menu Name> environment procedure
name, the $HELP prompt
The menu shows: for the procedure appears.
If you specify a System/36
The name of the menu system menu name, the
A descriptive title of the menu equivalent AS/400 menu
The option numbers appears.
A brief description of what each option does // HELP <Proce- If you specify a System/36
Prompts describing other functions that can be dure or Menu environment procedure
done using this menu Name> name, the $HELP prompt
for the procedure appears.
Menus simplify the work of an application user If you specify a System/36
and reduce errors. The user does not need to environment system menu
know operation control language (OCL) state- name, the equivalent
ments, procedures, or control commands needed AS/400 menu appears
to run a job. when the outermost proce-
dure ends.
You can use menus to group jobs by application. <CL command> Displays information about the
For example, all accounts receivable jobs are <Help-key> specified system CL command.
<Option-number> Displays menu help for the The Cmd 7 function to end the displaying of
<Help-key> specified option number if sup- system menus is not supported. Use F12 to
plied in the menu definition. see the previous menu.
See “Creating and Displaying
Online Help Information for The Cmd 11 function to display menu actions
Menus” on page 14-7. is not supported. This function is not
replaced.
<Procedure or CL If you specify a System/36
command> Cmd 4 environment procedure The Cmd 12 function to display user support
name, the $HELP prompt and education information is now F13.
for the procedure appears.
If you specify an AS/400 CL The Cmd 23 function to change the user
command, the prompt for menu name in the user profile is supported. A
the CL command appears. single name replaces the user and help menu
Cmd 3 Exit.
names.
Cmd 9 Retrieve previous requests. The Cmd 24 function to change the system
menu name is now F23. A single name
Cmd 12 Cancel.
replaces the user and help menu names.
Cmd 13 Display user support menu.
Use Cmd 9, instead of the DUP key, to
Cmd 16 Display system main menu. display the last command you ran from the
Cmd 23 Change menu name in user command line, and any parameters you
profile. selected. If you press this key once, you see
Home key Display Home menu. the last command you ran. If you press this
key twice, you see the next-to-last command
Dup key Retrieve previous requests.
you ran, and so on.
When the System/36 environment is not active, 1. Tell the system the name of the menu and
statements that result from selecting a menu which option numbers to use.
option are not logged to the job log. When the 2. Give the descriptive text for each option.
System/36 environment is active, statements that 3. Supply the procedure to be run for each
result from selecting a menu option are logged to option.
the job log, except in the following cases:
In the following screen, the programmer supplied
1. Option from system menus that are handled the name of the menu, and the text and proce-
by the menu driver directly are not logged. dures for option numbers 1 through 9 only.
For example, an option to go to another menu
would not be logged.
Ready for option number or command Ready for option number or command
á ñ á ñ
Although all 24 option numbers appear on a fixed-
form menu, the user can select only the option
Designing Menus
numbers that have procedures or commands A well-organized and descriptive menu increases
defined for them. user productivity. Consider the following when
you design menus:
Free-Form Menus: A free-form menu is a
The menu’s use
menu for which the programmer defines the
The types of jobs you want the menu to
format of lines 3 through 20. A free-form menu
control
contains only the option numbers you want to use.
The level of experience or responsibility of the
You determine how the menu appears. A large
user
portion of the display is available to supply
descriptive text.
Use the following guidelines when you design your
menus:
When you create a free-form menu you can:
Use free-form menus as much as possible.
Define up to 24 option numbers and
Free-form menus do not have unused option
descriptions.
numbers.
Define the procedure, control commands or
OCL statements associated with each option Avoid mixing free-form and fixed-form menus
number. within the same application.
Decide the placement of the option numbers
Results cannot be predicted if you do the fol-
and their descriptions, and all other text.
lowing:
The following screen is an example of a free-form – Specify the 27 x 132 character attribute
menu. The options on this menu are the same as for menus.
the options on the fixed-form menu shown in the – Put any fields with user-supplied data on a
last screen, but the programmer provides the menu.
numbers and their descriptions and supplies a – Move the input field on a menu.
descriptive title and information about online help
Write your menus in uppercase and lowercase
information and function keys.
letters. Text written only in uppercase letters
is difficult to read.
Number your options beginning with 1.
Place frequently selected options near the top
of the menu, place the options in the
sequence they are to be selected, or arrange
the options alphabetically.
Make the menu title and option descriptions
meaningful and descriptive. For example,
Release orders is a more meaningful option
RSLW069-3
3. Maintain Files
4. Print Reports
5. List Files
RSLW076-0
Option 2 displays item balance detail for goods located at the warehouse.
Color, used properly, is more pleasing to the eye
Option 3 displays item balance detail for goods located on the than monochrome data. Use color to draw atten-
manufacturing floor.
If the user types an option number and press the Some display stations, depending on the model,
Help key, more detailed menu online help informa- show the following colors:
tion about the menu option appears. For
example, if the user selects option 1 on the inven- Green Turquoise
tory management application menu and presses Red Pink
the Help key, the information in the following White Yellow
screen appears: Blue
COMMAND/FUNCTION KEYS: Cmd7 ends the program. The data you type on the
menu. You cannot use the Menu option to
display is ignored, and INVINF reappears.
add highlighting or color to a menu. Do not
NOTES: When you press the Enter key to continue, the Item Master File
Record display appears, showing information about the file number add, move, or delete fields on the menu.
you entered.
You use a display station to communicate with the The following sections describe how your pro-
system and to run application programs. grams, and the system, use displays and display
formats.
The information shown on the display station is
called a display. You define that information in a
display format. Using the display defined in a Display Data Management
display format, a program can prompt the user to
Programs that communicate with display stations
type information or show requested information to
are called interactive programs. Interactive pro-
the user.
grams use a system function called display data
The following screen is a sample display. management to write data to and read data from
a display station. Display data management com-
municates with the interactive programs by using
à@ ð display formats to write data to and get data from
DISPLAY ITEM MASTER FILE
Displays are useful for the following reasons: The program must be able to accept data
typed on the display. That data is the input
They make it easier for the user to type and needed by the program. The accepting of
get data. data typed by the user is often called an input
They improve productivity. read, invite, or read operation.
They are defined separately from the program
or procedure that uses them, therefore: In addition to the operations listed above, the
– One set of display formats can be used by program must be able to control other functions
different procedures or programs. such as indicators and the command and function
keys.
– You can usually change display formats
without recompiling your programs. Figure 14-3 on page 14-11 shows examples of
output, input, and input/output fields as described
in the following sections.
Item number:
Item description:
5ðð1123ð
Storage Cabinet with Doors
Input/Output Fields: Input/output fields
Item type: E Cost per unit: 25ð.ðð
allow the user to type data, and allow data to
Item class:
Warehouse location:
5ð
H1
Selling price per unit: 325.ðð
appear to the user. The user can type new data
Unit weight: 115
in a blank input/output field, or change existing
Date record last maintained: 12/15/88
data in an input/output field. Data displayed to the
Press the Enter key to see the next record in the file
Cmd1 to change the information in the record that is displayed user can be supplied by the program or specified
Cmd7 to end this program and return to the previous menu
by the display format. Data contained in an
input/output field returns to the program when the
á ñ user presses the Enter key.
Figure 14-3. Sample Output, Input, and Input/Output For example, when the user typed the item
Fields number 5ðð1123ð on Figure 14-3 and pressed the
Enter key, the item description appeared. Item
Output Operations and Output Fields: description is an input/output field because the
For output operations, display data management user can type over the description.
prepares a data stream to transmit to the display
station by merging data supplied by the program Data Types
with the display format.
If you define a particular field as an input or
Output fields contain information that the user input/output field, you must also define the type of
cannot change on the display. The contents of data the user can type. For example, you can
output fields are not returned to the program. specify that an input field is to accept numeric
Output fields can contain data supplied by the data only (0 through 9, commas, decimal points,
program, or they can be prompts or constants, plus signs (+), and minus signs (−)). This defi-
defined by the display format. A prompt is a nition is useful if a field requires information such
request for information or action from the user. A as inventory amounts or account balances.
prompt can tell the user what type of information
to type, the form in which to type that information, You can specify that a field is to accept alphanu-
and the options or values allowed as input for that meric data only (characters A through Z, special
data field. characters, and any numeric data). This definition
is useful for a field that requires alphabetic charac-
Figure 14-3 shows examples of output fields. In ters and numeric digits, such as a customer’s
this figure, all the output fields are prompts address.
defined by the display format. An example of an
output field on the display is the prompt Item Other data type definitions include:
number.
Alphabetic data. Only the letters A through
Z, and certain special characters, are allowed.
Input Operations and Input Fields:
Input fields are fields in which the user can type Digits. Only the numbers 0 through 9 are
data on the display. When a program shows a allowed.
display, input fields are blank or contain a default Signed numeric. Only the numbers 0
value. The user can type data into the input field. through 9 are allowed. The sign is deter-
The contents of the input field are sent to the mined by the key pressed, Field+ or Field−,
program when the user presses the Enter key. after entry of the numbers.
This data is used by the program to do an opera-
Right-to-left field. If the correct national lan-
tion, such as a calculation or a file update.
guage PRPQs are installed, the cursor moves
from right to left within this field as the user
types in data.
Document: 1.ðð
Title: 5.ðð
Registration: 13.ðð
Choose the correct form for your application. Total: 19.ðð
Tag no.: LAG535
Type the inventory code and the sales code and press Enter.
fields, specify the suppress input operation for all
Inventory code: but the last display format. The last format must
Sales code:
define at least one input field if all of the following
Press Cmd7 to end program. are true:
A value other than 24, 27, or blanks is speci-
fied as the number of lines to clear.
á ñ The format replaces or clears a line that con-
tains an input field created by a previous
Using Color or Highlighting on Dis- format displayed with input fields defined.
plays: “Using Color or Highlighting on Menus” Suppress input is not specified (the user can
on page 14-9 describes how to use color to high- enter data on the display).
light data.
Designing Displays for Remote Display
If you use SDA to create and update displays, you
Stations: Remote display stations communi-
can select colors for each field from the Color
cate with the system at a slower rate than do local
Attributes for Field display. The ADTS/400:
display stations and can decrease overall system
Screen Design Aid and the ADTS/400: Screen
activity. Use one of the following techniques to
Design Aid for the System/36 Environment books
improve performance when using remote display
have more information about highlighting data with
stations:
color on your display.
Consider the following system actions to avoid Public Authority to Use SFGR
accidentally deleting files: Display Files
$SFGR replaces only a *FILE of subtype
The system creates all objects with the create
DSP. It does not replace any other type of
authority (CRTAUT) of the library they are created
AS/400 *FILE object.
into, unless another authority is specified. The
The System/36 environment puts all database $SFGR and other System/36 environment utilities
files in one library (usually called QS36F). provide an SSP keyword which allows you to
The only source members that you can refer create a library member with *USE authority. If
to directly through the System/36 environment SSP-YES is specified, the library member can be
OCL are in source files named QS36SRC or deleted only by a user with security officer
QS36PRC. Do not place display files in authority, and users without security officer
library QS36F and do not use names such as authority are not allowed to change the display
QS36SRC or QS36PRC for System/36 load formats. If SSP-NO is specified, the library
members. member is created with the create authority
(CRTAUT) of the library the member is created
Do not create display files in library QTEMP
into.
because temporary (RETAIN-S or RETAIN-J)
The NUMBER Parameter: System/36 uses When a HELP format name contains unsupported
the NUMBER parameter value to calculate the characters, use of either name applies to
size of a work space that it must allocate. The System/36 HELP format names used by
$SFGR on an AS/400 system does not use a System/36 as well. If the format name referred to
work space and therefore does not need this in the H-specification (columns 7 through 14) is
number. The AS/400 system accepts a valid defined in the display file being created (columns
NUMBER parameter and passes it to $SFGR. 16 through 23 of the H-specification are blank),
$SFGR checks it for proper syntax and valid the corresponding DDS that is built refers to the
range of values. An error message appears if the valid DDS format name created by $SFGR.
value is invalid.
If the HELP format name referred to contains
Differences between System/36 characters not allowed by DDS, and columns 16
through 23 of the H-specification are not blank
SFGR and AS/400 DDS (indicating the HELP format is in some other
display file), the valid DDS format name created in
The following sections describe differences
the other display file is not known to $SFGR, so
between System/36 SFGR and AS/400 DDS.
that H-specification is ignored. To use this
H-specification, you must change the HELP format
Format Names: On System/36, the SFGR name in that H-specification and the corre-
for each format (S-specification columns 7 through sponding format name in the other display file, to
14) assigns the names of the format being a valid DDS format name.
defined. The first character of the display format
name must be alphabetic: characters A through
Right-to-Left Cursor between Input
Z, or the characters #, $, or @. The other charac-
ters can be any combination of characters except Fields: On System/36, column 40 of the SFGR
commas (,), single quotation marks ('), and blanks. for each format (S-specification) defines whether
There must be 8 or fewer characters in the display the cursor moves from one input field to another in
format name, and it must be left-justified in the a right-to-left direction. On the AS/400 system,
field. the Check Right-to-Left (CHECK(RLTB)) keyword
is a file-level keyword that applies to all formats in
Names for DDS formats on the AS/400 system the display file. There can be only one such
must begin with an alphabetic character (A keyword.
through Z, @, $, and #). All other characters can
be alphanumeric (A through Z, 0 through 9, @, $, $SFGR takes the right-to-left definition from the
#, and _). Embedded blanks are not allowed. first format (S-specification) encountered during
the create function and uses that definition as the
$SFGR substitutes a valid DDS format name in default for all other formats in the display file for
place of an SFGR format name that does not the AS/400 system.
If an application writes information that must be The FRCDTA keyword temporarily overrides the
displayed immediately and does not require any DFRWRT(*YES) attribute whenever this format is
user input, the application should specify the written. The FRCDTA keyword starts in column
FRCDTA keyword in the format or specify 45. Since a *DDS comment is an SFGR
DFRWRT (*NO) for the display file. If the data is comment, the SFGR source can still be installed
allowed to be buffered by the system, the data is and compiled on System/36. See Appendix B,
not immediately displayed by the system. “$SFGR Specification Forms,” for more informa-
Common examples of these applications are: tion about *DDS comments.
Continuously update a time-of-day display
Send status messages, such as: Recompile the display file specifying
Running application DFRWRT(*YES). Specify DFRWRT(*YES) on the
Please wait CRTS36DSPF command or in the source attribute
Starting final pass in the member containing the SFGR source. The
resulting display file provides improved perfor-
Some display files can contain a mixture of mance for those formats without the FRCDTA
DFRWRT(*YES) and DFRWRT(*NO) formats. keyword, while those formats with the FRCDTA
You can use each format when appropriate in keyword are displayed when required by the appli-
cation.
displayed again and the cursor is positioned at the field where the
error occurred. You can then correct the error and continue
your job.
TESTMSG
This is the first informational message
This is the second informational message
Bottom Enter required parameter to continue
The allowed options are listed in parentheses. -
Option . . . . . . : _
TESTMSG
This is the first informational message
This is the second informational message
Enter required parameter to continue
ABCD
This is the third informational message
á ñ
Opt Message
Messages needing a reply
Operator intervention messages and messages - SYS1631 Options ( 123)
Empty slot or picker failure during DELETE.
from noninteractive jobs in the System/36 environ- - Controller CTLð2 contact not successful. Probable remote station
problem. (C R)
ment are sent to the system operator message Messages not needing a reply
- Subsystem QSNADS ended.
queue (QSYSOPR). -
-
Subsystem QSNADS ending in progress.
Device DSP25 no longer communicating.
- Device DSP12 no longer communicating.
- Controller CTLð2 failed. Automatic recovery started.
More...
F1=Help F3=Exit F5=Refresh F16=Remove messages not needing a reply
F17=Top F18=Bottom F24=More keys
á ñ
To view the Additional Message Information
display and reply to the message shown on the
Work with Messages display, type a 5 in the Opt
column and press the Enter key. The following
á ñ
The Display Messages display initially appears
when the Intermediate Assistance level is being When you press F16 on either the Work with Mes-
used: sages display or the Display Messages display, all
messages on the message queue are removed
à@ ð except unanswered inquiry messages. The dis-
Display Messages
System: RCHSX33 plays appear again with the unanswered inquiry
Queue . . . . . : QSYSOPR Program . . . . : \DSPMSG
Library . . . :
Severity . . . : 9ð
QSYS Library . . . :
Delivery . . . : \HOLD
messages.
Type reply (if required), press Enter.
Writer ð55228/QSPLJOB/PRTð1 started.
Device PRTð2 no longer communicating. When no unanswered messages are on the
Controller CTLð2 no longer communicating. Automatic recovery started.
Device DSP12 no longer communicating.
Device DSP25 no longer communicating.
message queue and you press F16, all messages
Subsystem QSNADS ending in progress.
Subsystem QSNADS ended.
are removed and the displays appear with the
Controller CTLð2 contact not successful. Probable remote station
problem. (C R) phrase No messages available.
Reply . . . _____________________________________________________
SYS1631 Options ( 123)
Empty slot or picker failure during DELETE.
Reply . . . _____________________________________________________ When you press F13 (Remove all) on the Display
Bottom
F3=Exit F11=Remove a message F12=Cancel Messages display, the Display Messages display
F13=Remove all F16=Remove all except unanswered F24=More keys
appears again with the phrase No messages
á ñ
available.
To view the Additional Message Information
display for this display, position the cursor at a Embedding Messages: In the preceding
message and press the Help key. The following example, the message actually sent to the
display appears when the Intermediate Assistance QSYSOPR message queue is SSP0335 not the
level is being used: SYS1631 message. This is because messages
sent to the system operator from the System/36
environment are sent as replacement text in other
à@ Additional Message Information
ð messages in the QSSPMSG file. This concept is
Message ID . . . . . . :
Message type . . . . . :
SSPð337
Inquiry
Severity . . . . . . . : 99
called message embedding, and the messages
Date sent . . . . . . : 11/14/91 Time sent . . . . . . : 14:29:14
used are:
Message . . . . : SYS1631 Options ( 123)
Empty slot or picker failure during DELETE.
Cause . . . . . : You were running the DELETE procedure or the $DELET
utility to delete information from a diskette when one of the following
SSP0303 and SSP0305 for informational mes-
conditions occurred:
-- The diskette drive was empty. sages
-- The diskette was not properly inserted into the diskette drive.
-- A hardware problem exists.
Recovery . . . : Do one of the following:
SSP0311 through SSP0313 for prompting
-- Enter option ð, and continue the operation with the next diskette slot
through the specified end location.
messages
More...
Type reply below, then press Enter. SSP0335 through SSP0357 for error mes-
Reply . . . . ______________________________________________________________
Use the programming development manager After the response source member is created, use
(PDM) or source entry utility (SEU) to create the the RESPONSE procedure to assign the default
new source members. responses and severity levels to the message
member. You must run the NOHALT procedure
If you want to change or add messages: or OCL before the RESPONSE procedure is effec-
tive.
The system supports the following types of pro- The number of requesters affects the application
grams that restrict the number of users: design because it affects the operation control lan-
guage (OCL) statements and procedures you use
One-user programs to call the programs in the application. If a
Multiple-user programs program has more than one requester, you must
No-user programs use a MRT procedure to call that program. The
system supports the following types of programs:
One-User Programs: A one-user program is an
interactive program that communicates with only SRT programs
one user at a time. A one-user program has a MRT programs
display file that is limited to one display station or Nonrequester terminal (NRT) programs
an ICF file for a single ICF session.
Single Requester Terminal Programs:
When a one-user program is a SRT program, the A single requester terminal (SRT) program is a
requester is the only display station or ICF session program that can process requests from only one
with which the program can communicate. display station or ICF session from each copy of
the program. A SRT program can interact with
Multiple-User Programs: A multiple-user only one requesting user. If multiple users
program is an interactive program that can com- request the same SRT program, the system uses
municate with more than one user at a time. A the same copy of the program for all users but
multiple-user program, like a one-user program, creates a separate area for variables used by the
may have a display station file or an ICF file or program for each user.
both. However, the display station file and ICF file
for a multiple-user program allow two or more Specifying a SRT Program: A program not
users. Those users can be requesting display called as a NRT program, or specified as a MRT
stations, ICF sessions, acquired display stations, program, is a SRT program. No coding is
or acquired ICF sessions. required to specify that a program is a SRT.
No-User Programs: A no-user program is a Difference between a SRT Program and a One-
batch program because it does not have a display User Program: In a SRT program, the user is
file or ICF file. An example of a no-user program always a requester. In a one-user program, the
is a program that prints a disk file.
MRTMAX Value: Use the MRTMAX value to The NUM value is defined on the continuation line
specify the maximum number of requesters that for the WORKSTN file on an RPG file description
can be active at once for a MRT program. When specification. In other programming languages,
the number of requesters equals the MRTMAX you must code the logic in your source program if
value, a subsequent requester must wait until a you want to check the number of users.
current requester is finished using the program.
If the MRTDLY attribute indicates that the MRT Acquiring a Display Station or ICF Session: A
should not delay ending, the program immediately display station must be active (powered on and
receives a return code instructing it to go to the varied on) and signed off to be acquired. A
end of the program. When the program ends, the program can acquire a display station by:
MRT is no longer an active MRT. If another Using the WORKSTN OCL statement with
device requests the MRT, a new MRT is started. REQD-YES and a display station identification
specified
You can change the attributes of the MRT proce-
dure by using the Change System/36 Procedure Using the programming language statement
Attributes (CHGS36PRCA) command, the Edit that acquires a display station
System/36 Procedure Attributes (EDTS36PRCA)
command, or the Work with System/36 Procedure The following table lists the appropriate statement
for each programming language:
File Sharing: When a file is shared, you must You can design your transaction file by:
prevent two problems:
Using a single file for all transactions
Loss of data. You can lose data when two or Using a separate file for each device
more users update the same record of a file
shared within a single copy of a program. If you use a single file for all your transactions,
When the program writes the second updated you can put all the transactions in the file in the
record back to the file, it writes that record order in which the transactions arrive, or you can
over the first updated record, losing the first put the transactions for each device in a separate
update. part of the file. For example, you allocate 3000
File deadlock. Files deadlock when two or records for the file, partitioned as follows:
more programs try to update records in two or Record 1 Control record for W1
more files at the same time. Take the fol- (display station 1)
lowing steps to prevent file deadlock:
Records 2-1000 Data records for W1
– Do not own more than one record at a
time. Each time you read a record from a Record 1001 Control record for W2
file shared for update, write the record (display station 2)
back to the file before you read a record Records 1002-2000 Data records for W2
from another file shared for update.
An advantage of an interactive environment is that You must save the transaction files periodically,
operators always have access to up-to-date infor- usually each day. You can save the master files
mation in the master files. For example, an oper- frequently if the files are constantly being updated.
ator enters a transaction that reduces the quantity You can recover by reloading the master files and
of an item on hand in an inventory master file. processing all subsequent transactions. (For infor-
When another operator inquires for the quantity of mation about file recovery, see Chapter 19, “Error
that item on hand, the value shown reflects pre- Prevention, Detection, and Recovery.”) To bring
vious changes made to it. the memo balance field to its current value, run a
program that updates the memo balance field with
Note: Do interactive updates to files carefully the transactions. After the memo balance field
because recovery from a system or program has been updated, all current activity has been
failure is difficult if you do not know which updates accounted for and normal operations can con-
are reflected in the file and which updates need tinue.
repeating.
1 10 30 40 50
Duplicates
RSLW038-0
Matching Fields or
Record Name
Decimal Positions
Changing Fields
** or DS
1 2 3 RPG
Number (1/N), E
Form Type
Field Name
Zero
Character
Character
Character
Data Structure Plus Minus or
P/B/L/R
Stacker
Not (N)
Not (N)
Not (N)
Position Position Position Blank
C/Z/D
C/Z/D
C/Z/D
Data O R
Occurs
Structure Length
A N D n Times
Name
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
01
I
02 I
03 I
04 I
05 I
06 I
O
Stkr #/Fetch (F)
or End
Form Type
And And
Record Name R Position No Yes 3 C L
Line
Before
in No No 4 D M
After
D E L Output
B/A/C/1-9/R
A D D Edit Codes Record
P/B/L/R
O R Constant or Edit Word
Not
Not
Not
*
AUTO
A N D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 7171 72 73 74
01 O
02
O
03
O
04
O
RSLW077-0
A variation of the memo updating technique is to The memo balance field reflects the day’s activity
set the memo balance field to 0 at the start of the for that item. If no transactions for the item
day, rather than to the value of the balance field. occurred, the memo balance remains 0. To deter-
Interactive updates are made only to the memo mine the current balance, an inquiry program
balance field. would have to add or subtract the memo balance
from the balance in the master file.
Matching Fields or
Record Name
Decimal Positions
Changing Fields
** or DS
1 2 3
Number (1/N), E
From To
Form Type
Field Name
Zero
Character
Character
Character
Data Structure Plus Minus or
P/B/L/R
Stacker
Not (N)
Not (N)
Not (N)
Position Position Position Blank
C/Z/D
C/Z/D
C/Z/D
Data O R
Occurs
Structure Length
A N D n Times
Name
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
01
I
02 I
03 I
04 I
05 I
06 I
Decimal Positions
Plus Minus Zero
Not
Not
01 C
02 C
03 C
O
Stkr #/Fetch (F)
or End
Form Type
And And
Record Name R Position No Yes 3 C L
Line
Before
in No No 4 D M
After
D E L Output
B/A/C/1-9/R
Edit Codes
A D D Record
P/B/L/R
Not
Not
*
AUTO
A N D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 7171 72 73 74
01 O
Note that these
02
O balances are set
03
O equal to one
04
O another.
RSLW078-0
A MRT procedure can call a MRT program. The How to Access External
system checks the procedure name to see Programming Language Switches
whether the MRT is already active.
COBOL 74 IF and SET statements
When you create a procedure, you can specify RPG II U1-U8 or SUBR 20
that the data following a procedure name is data
for the program or parameters for substitution in The following example uses the SWITCH OCL
the OCL statements. For MRT procedures, the statement to affect how the system processes an
procedure can be called only with data, not with input stream. An input stream is a group of
parameters for substitution. Anything following the records submitted as a batch job that contains CL
MRT procedure name is saved until the MRT commands for one or more jobs and data from
program does its first input operation. See the one or more inline data files. In the example, the
appropriate language manual for information about SWITCH1 statement sets switch 1 to 1 (on).
calling the procedure with data. Use the Edit Switch 1 determines whether the program is a
System/36 Procedure Attributes (EDTS36PRCA), daily or weekly run. In the procedure, a FILE OCL
the Change System/36 Procedure Attributes statement for the daily run differs from the FILE
(CHGS36PRCA), or the Work With System/36 statement for the weekly run.
Procedure Attributes (WRKS36PRCA) CL com-
mands to change the PGMDTA attribute. The // IF SWITCH1-1 FILE NAME-A
// ELSE FILE NAME-A,LABEL-B
PGMDTA attribute is described in “Procedure
Attributes” on page 16-21.
When switch 1 is on, file A is used. When it is off,
file B is used.
Read-Under Format: The RUF technique allows
an operator to enter information on a display while
For a MRT program, a separate copy of the switch
the program that uses the display is starting.
settings is kept for each requester’s input stream,
When you use RUF, a program or procedure dis-
and control is passed to the next job step when
plays the format, and the program called next in
the requester is released. Also, the switch set-
the procedure reads it. The format is displayed
tings are normally the first requester’s settings.
by a program or a PROMPT OCL statement with
Some high-level languages allow you to access a
PDATA-YES specified. While the next program is
specific requester’s switch settings.
being started, the operator enters information for
Beginning of Program
Read input for All Subsequent
Requesters
Yes
End of
session
No
Process
Reinitialize
for next step
Output
RSLW059-0
As shown in Figure 16-4, a MRT program has the Figure 16-5 on page 16-17). The input stream
same flow, except: consists of a series of steps, each step including
LOAD and RUN OCL statements, typically FILE
All requesters start by reading input.
statements, and possibly other OCL statements.
All requesters end by being released from the
When a step is a MRT, the MRT is normally
application program.
already active, so the system attaches to the MRT
SRTs can interact with more than one display program rather than going through the program
station or ICF session , but only one can be the start-up required for a non-MRT. When the step
requester. There is a separate input stream for is complete for that input stream, the MRT
each display station attached to a MRT (see releases the requester rather than going through a
time-consuming program end.
Multiple-User File
W1 Release
W2
Multiple-User File
Release
Multiple-User File
Release
LDA indicates No
there is an
order to print
Yes
// ATTR RELEASE-YES
Step 4
ORDPRINT
Program (NRT)
RSLW040-2
The first and third parameters are separated by One procedure can call another procedure. A pro-
two commas, which indicates that the second cedure called by another procedure is a nested
parameter is omitted. procedure. Use nesting when the same proce-
dure is called several times in a job. The proce-
Use substitution expressions to define parameters dure can be entered and stored only once, and
in your own procedures. The System/36 Environ- then called as often as necessary.
ment Reference book has more information about
using parameters with procedures. Deleting a file your program creates is a good
example of using a procedure to call another pro-
The following example shows how two parameters cedure. Your procedure can include the DELETE
are entered and substituted in a procedure. Pro- procedure command. For example:
cedure PROCA contains the following statements: \ Delete work file FILE1, if it exists
// LOAD PROGRAM1 // IF DATAF1-FILE1 DELETE FILE1,F1
// FILE NAME-INPUT,LABEL-?1? \ Run program
// FILE NAME-OUTPUT,LABEL-?2? // LOAD PROGRAM1
// RUN // FILE NAME-FILE1,RECORDS-25ð
// RUN
When you enter the procedure command PROCA
FILE1,FILE2 to start PROCA, the first parameter
(FILE1) and the second parameter (FILE2) are Considerations for Multiple
substituted for the expressions ?1? and ?2? as Requester Terminal Procedures
shown in the following example:
// LOAD PROGRAM1 You can attach to a MRT program with MRT pro-
// FILE NAME-INPUT,LABEL-FILE1 cedures. A MRT program allows several
// FILE NAME-OUTPUT,LABEL-FILE2 requesting display stations or requesting ICF ses-
// RUN sions to attach to one copy of a program at a
time.
The substitution is done when the initiator function
processes the procedure. The initiator function is You specify a MRT procedure using the Change
described in Chapter 18, “Jobs and Job System/36 Procedure Attributes (CHGS36PRCA),
Processing.” the Edit System/36 Procedure Attributes
(EDTS36PRCA), or the Work with System/36 Pro-
cedure Attributes (WRKS36PRCA) CL commands,
Procedures with Menus or by specifying the MRT parameter of the
$MAINT utility.
Application users generally do not need to know
the procedure’s name or parameters because you If you enter a MRT procedure and the MRT is not
supply menus for them. The user selects an already active, the system processes the OCL
option from a menu and the system runs the pro- statements in the MRT procedure, including the
cedure you assigned to the option. The procedure LOAD and RUN of the MRT program, as part of
then loads and runs the program to do the task starting the MRT. If you enter a MRT procedure
that the application user specified. with the MRT already active, and the number of
requesters using the program is less than the
maximum number of devices that can be attached
to the MRT (MRTMAX), the requester is attached
directly to the MRT program. If the MRT is active
and has reached the maximum number of
requesters, the requester waits for the MRT to
release one of the other requesters.
A non-NEP MRT with a MRTDLY procedure attri- You can use the Work with Active Jobs
bute indicating that the MRT should wait for a new (WRKACTJOB) CL command to determine what
requester before terminating will stay active longer MRT jobs are currently running on the system.
than a non-NEP MRT with a MRTDLY procedure MRT jobs are identified by the value MRT in the
attribute indicating that the MRT should terminate Type field of the WRKACTJOB display. For MRT
immediately after releasing its last device. jobs, the following conditions apply:
MRT jobs continue to own system resources, such The Subsystem/Job field contains the name of
as files, during the MRT delay period, which the MRT procedure.
affects other applications waiting for those The Function field identifies the MRT as a
resources. NEP MRT program or non-NEP MRT. If the
Function field contains NEP, the MRT is a
If you do not want a certain non-NEP MRT to NEP MRT. If the Function field does not
delay termination after releasing its last device, contain NEP, the MRT is not a NEP MRT.
use the Change System/36 Procedure Attributes
(CHGS36PRCA) command, the Work with The Function field also displays the maximum
System/36 Procedure Attributes (WRKS36PRCA) number of requesters (MRTMAX) and the
command, or the Edit System/36 Procedure Attri- current number of requesters. For example, if
the Function field is MRT-2/ 5, this indicates
When a MRT job is started the AS/400 Work Man- Avoid using the following characters in member
agement function sets up the attributes of the job names since they have special meanings in proce-
based on the information in the QS36MRT job dures: comma (,), apostrophe ('), question mark
description in library QGPL. Information such as (?), slash (/), greater than sign (>), equals sign
output priority, output queue, printer device, and (=), plus sign (+), period (.), and hyphen (-). Do
message logging levels are initialized for the MRT not use names that begin with Q because the
job, based on the information in the QS36MRT job system creates procedures with these names.
description. You can change the QS36MRT job
description with the Change Job Description Procedure Performance and
(CHGJOBD) CL command to change the attri-
butes of all MRT jobs. You can use the Change Coding Techniques
Job (CHGJOB) CL command in a MRT procedure
This section describes techniques you can use to
to change the attributes of a single MRT job. For
help improve the performance of your procedures.
example, you can specify LOG(4 0 *SECLVL) for
The System/36 Environment Reference book has
the keyword on the CHGJOBD or CHGJOB
more information.
command to create a job log for a MRT job.
However, the following values are not taken from Use GOTO and TAG statements rather than
the QS36MRT job description: several IF expressions. IF expressions in the
System/36 environment are expressions within
Job queue
a procedure that are used to test for a condi-
Job queue QS36MRT in library QGPL will
tion. Use one IF expression and a GOTO
always be used for MRT jobs.
expression to reduce the time needed to eval-
Routing data uate several IF expressions. The statements
Routing data of QS36MRT will always be skipped by the GOTO and TAG expressions
specified for MRT jobs. are not processed.
Use ELSE statements if you have more than
one IF expression and only one of the
expressions can be true. All ELSE statements
are skipped after a true IF or a false IFF
expression.
If you enter a CL command when a System/36 job If a CL command requires more than one line in
step is not active, the job ends in an error, an the procedure, it can be continued with a plus sign
error message is displayed at the bottom of the (+). The minus sign (−) is not valid as a continua-
display, and the command remains on the tion character for commands entered in a proce-
command line. dure.
If you enter a CL command when a System/36 job Unlike OCL statements, it is not possible to condi-
step is active, and the job ends in an error, a tion parts of a CL command by placing each part
System/36 halt is issued. You can select option 0 on a separate line with a comma continuation
to ignore the error and continue entering state- character. If you want to condition part of a CL
ments for the job step, or option 3 to cancel the command, you can do so by setting a procedure
job step. parameter to either a null value or to the value to
be included on the command.
Adding AS/400 CL Commands to
The System/36 environment allows a number of
System/36 Procedures special characters in names. The AS/400 system
requires that names that contain special charac-
You can use CL commands in procedures, and
ters be enclosed in quotation marks ("). When
generally wherever an OCL statement is valid.
you specify a name that contains special charac-
AS/400 commands are not allowed where a utility
ters on a System/36 statement, you do not specify
control statement or source statement is required
the quotation marks. When you specify a name
(after a // RUN and before a // END or /*).
that contains special characters on a CL
Note: If a CL command, issued during a proce- command, you must specify the quotation marks.
dure, requires a file it is processing to be closed, You may also specify quotation marks for a name
the System/36 environment closes the automatic that does not contain special characters; in this
shared open for the file. If the file (or member) is case, the quotation marks are ignored. The
deleted, renamed, moved or restored by the CL AS/400 naming rules are described in the CL Ref-
command, the System/36 environment removes erence book.
any // FILE statements for the file (or member).
Any locks that were held through these // FILE This is shown in the examples below. The fol-
statements are released. If a job file is renamed, lowing two statements set the current library to be
moved, or restored by a CL command, the a library named "AB%CD". The quotation marks
System/36 environment will not release the disk are not specified on the // LIBRARY OCL state-
space occupied by the job file when the job ends. ment, but are added by the System/36 environ-
The System/36 environment will not close an auto- ment to create a correct AS/400 name.
matic shared open of an alternative indexed or // LIBRARY NAME-AB%CD
logical file which is based on the file being pro- CHGCURLIB CURLIB("AB%CD")
cessed by the CL command. See “Shared File
If your installation uses special characters in Determine the AS/400 10-character device
names, it is recommended that you put quotation name of a System/36 environment 2-character
marks around a substitution expression used as a device name (?DEV'unit'? substitution
name on a CL command. This ensures that the expression).
name is valid if the substitution expression con- Use the following statement in a System/36
tains special characters. Quotation marks are not environment procedure to store the AS/400
included in the value of a substitution expression 10-character device name used for the
that returns the name of an object. For example, System/36 environment 2-character device
if the current library is named "AB%CD", the name for printer P1 in the local data area:
?CLIB? substitution expression returns the value
// LOCAL OFFSET-1,DATA-'?DEV'P1'?',AREA-USER
AB%CD.
For more information on the ?DEV'unit'? substi-
In the following example, an error occurs if either
tution statement, see the System/36 Environment
the files library name or parameter number 1 con-
Reference book. This book also has information
tains special characters:
on using substitution expressions and CL com-
CLRPFM FILE(?FLIB?/F?1?) MBR(\LAST) mands in procedures.
The next example shows how this statement can All substitution expressions on a CL command are
be changed to work correctly if either value con- processed before the command is processed.
tains special characters. This means that it is not possible to use a CL
CLRPFM FILE("?FLIB?"/"F?1?") MBR(\LAST) command to modify the value of a positional
parameter. For example, the following statement
Quotation marks are not removed from substi- can be used to call a program and pass the value
tution expressions that return the value of a posi- of positional parameter 1 to the program.
tional parameter or retrieve a value from a However, if the program changes the value of the
message member or the local data area. In the parameter passed to it, the change is not reflected
following example, positional parameter 1 is set to in the value of the positional parameter.
a value with quotation marks. This value is then CALL PGM(PGM1) PARM('?1?')
used on a CL command to set the current library
name. Use the IBM-supplied program QEXCVTDV to
// EVALUATE P1="AB%CD" convert device names, as described in the
CHGCURLIB CURLIB(?1?) Sets current library to "AB%CD"
System/36 Environment Reference book.
SLIB ?1? Error because quoted name not
allowed on System/36 statement.
Handling Errors on CL Commands in
Substitution Expressions on CL Com- Procedures: Handling errors on CL com-
mands: To facilitate mixing OCL statements mands in a procedure is controlled by the default
and CL commands in a procedure, you can use message action set in the System/36 environment
System/36 substitution expressions on any part of configuration and by the CHGS36MSGL
a CL command, including the command name and command. The initial setting of the default
keyword names. In addition, new substitution message action is to issue a halt message with
expressions have been added to the System/36 options 0 and 3 allowed. You can use the
environment to assist the programmer who wants CHGS36MSGL command to change the default
to add CL commands to a procedure. The substi- message action for that job. The System/36 Envi-
tution expressions allow a programmer to: ronment Reference book has more information on
using the CHGS36MSGL command.
If the AS/400 program opens the file that was AS/400 programs can process these program-
kept open from the System/36 program, but it described files, which are created by System/36
is not opened shared, then the AS/400 environment functions. This is done by declaring
program receives a new open of the file.
//LOAD
In this scenario, the first program can issue a write //RUN
operation to the requester, and the second
program can issue the read.
RPG III
call
Consider the following items when coding applica-
tions in which only System/36 programs are used:
RPG II
A RUF operation may be started using the
most recently opened file.
RV2W103-0
In the example above, when control returns to
the first program, RUF may not be initiated
unless the considerations outlined in “Read- In the preceding figure, the RPG III program writes
Under Format Considerations with AS/400 to the requester and the RPG II program reads
Programs” are followed. from the requester.
A blank record or program data is returned
AS/400 programs can also make use of the
only if the first I/O operation issued in a job
shared open performed by the System/36 environ-
step is a read and RUF is not in progress.
ment. For example:
This is done only once per job step.
If a device is released by single requester ter- //LOAD
//RUN
minal (SRT) program, it is not available until
another display file or ICF file is opened.
RPG II
call
Read-Under Format Considerations
with AS/400 Programs: AS/400 programs
RPG III
may perform RUF-type operations through the use
of shared opens. For example, consider the case
where one AS/400 program calls another AS/400
RV2W107-0
program, as shown in the following figure:
//LOAD If both programs use the same file, and the RPG
//RUN III program performs a shared open, then the RPG
III program can complete a RUF operation started
RPG III by the RPG II program.
call
In the System/36 environment, a job is a unit of The statements in a procedure control the files,
work done by the system. It is composed of one display stations, printers, and other resources
or more programs. A job step is a unit of work used by a program. For example:
done by one program. A job that runs two pro- // LOAD PROG3
grams has two job steps. // FILE NAME-CUSTOMER
// RUN
The concept of an interactive job is different from
the System/36 concept of an interactive job. On The statements in the preceding example have
System/36, when you sign on to the system, you the following meaning:
are not running a job. When you start a proce-
dure, you are running a job. On the AS/400 LOAD The program run is named PROG3.
system, as soon as you sign on to the system, FILE PROG3 uses a disk file named CUS-
you are running a job. Because of this difference, TOMER.
commands that end jobs, hold jobs, and so on
RUN The program is run. This statement
affect the interactive session. For example, if you
also indicates the end of the operation
end an interactive job, the user is signed off the
control language (OCL) statements for
system. For more information about the AS/400
this job step.
system, see the Work Management book.
Note: In this chapter, the term job refers to the
System/36 concept of a job and not the AS/400 Starting and Ending Jobs
concept of a job.
This section describes how jobs are started and
You start a job from your display station. The ended.
system names and processes a job. You can
manage how your jobs use system storage, and
you can schedule the order in which they run.
Starting Jobs
You can start a job by doing any of the following:
Jobs and Job Steps Entering OCL at a display station.
Entering procedures at a display station.
A job is a unit of work done by the system. For
example, an order-entry job runs one program to Entering menu options that run procedures.
process orders and another program to print Using the JOBQ control command, or OCL
reports about the orders. statement, to place a procedure on the job
queue. The job queue is a list of jobs waiting
A job step usually begins with a LOAD OCL state- for the system to process them. The user can
ment and ends with a RUN OCL statement. The place batch jobs, which require no interaction
following procedure contains one job step because with a user, on the job queue.
only one program is loaded and run:
Using the EVOKE OCL statement to start a
// LOAD PROG1
procedure.
// RUN
Using the SBMJOB CL command.
Job Request
from Operator
Operator
Control
System/36 Command System/36
Environment Environment
Command Operator Control
Processor Command Processor
OCL Statement
or
or
Procedure
Job Request
from Operator
System/36 System/36
Environment Environment OCL
Command Command
Processor Processor
or
User Program
RSLW043-4
System/36
Environment Command
Command Processor OCL
Processor
or
User Program
End
of
Job
System/36
or Environment
Ending Function
RSLW044-4
input processing:
System input processes a statement one field Because the system made a substitution,
at a time, from left to right. Fields are delim- system input goes back to the beginning of
ited by blanks. field 3 and starts processing it again.
Each time the system evaluates a substitution 4. Examines the third field and determines that
expression, system input goes back to the the field contains a substitution expression.
beginning of the field and begins processing System input does the substitution. In this
again (allowing for nested substitution case, parameter 1 does not have a value, and
expressions). the value AR is substituted. The statement
now looks like the following:
After the system does the substitutions, the
length of the created statement must not // IF DATAF1-ARFILE SWITCH X1XX00XX
exceed 512 characters (including spaces).
The actual length of the statement before sub- Field 1 Field 2 Field 3 Field 4 Field 5
stitution can be up to 512 characters RSLW075-0
(including spaces).
The system input function does the following: Field 1 Field 2 Field 3
RSLW066-0
1. Identifies the first field as //.
2. Identifies the second field as IF, a valid proce- After checking each field and determining that the
dure control expression. statement requires no further substitution or
3. Examines the third field and determines that system input processing, the system passes the
the field contains a nested substitution statement back to the requester.
expression. The innermost substitution is
evaluated first. Therefore, system input sub- If the file ARFILE does not exist on disk (that is,
stitutes the value of parameter 2, AR, in the the conditional expression in the original third field
is false), system input discards the remainder of
the statement and processes the next statement.
The last step in a job ends. Frees any system resources the job used
Use the Change Job (CHGJOB) CL command to Submitting Jobs to Run Later
change the run priority of a job running or a job
queue. You can submit a job to start at a later time using:
The job queue
The WAIT OCL statement
Evoking Other Jobs
Use the EVOKE OCL statement to start a new job Using Job Queue to Run Jobs
from a job that is running. For example, a proce- Later
dure with one or more job steps is similar to the
job shown below: See “Using the Job Queue” on page 18-8 for
\ Start order entry program more information about using job queues. Use
// LOAD ORDENT the JOBQ control command, or the JOBQ OCL
// FILE NAME-ORDFILE statement to place a job on the job queue. For
// RUN more information, see the System/36 Environment
\ Start order summary listing program Reference book.
// LOAD PRTLIST
// FILE NAME-ORDFILE The JOBQ OCL statement allows you to place a
// RUN job on the job queue from within a job that is
already running. Use the HOLD and RELEASE
The first program, ORDENT, uses the display commands to hold and release jobs on the job
station to enter new orders into the system. The queue. Use the START and STOP commands to
orders are stored in a disk file. The second start and stop the processing of jobs from the job
program, PRTLIST, reads a disk file and prints the queue, or to start and stop the processing of job
information on an order form. Because the queue priority levels. To immediately start a job
PRTLIST program does not require a display on the job queue, use the CHGJOB command and
station, you could use the display to do other work specify JOBQ(QGPL/QS36EVOKE).
while PRTLIST runs. However, the display station
remains attached to the procedure while the Note: Procedures placed on the QS36EVOKE
PRTLIST job step is running, thus preventing the job queue by the // EVOKE OCL statement com-
display station from doing other work. plete abnormally if the job is held on the job
queue. When this occurs, an IPL is performed
If you create two procedures, and you use the and the job is released after the IPL.
EVOKE OCL statement to start the second proce-
dure, your display station can do additional work WAIT OCL Statement
while the PRTLIST program runs. For example:
\ Start order entry program The WAIT OCL statement causes a job to wait
// LOAD ORDENT until a specified time, or until a specified period of
// FILE NAME-ORDFILE time has passed. Once the system processes a
// RUN WAIT OCL statement, the job does not resume
\ Start order summary listing procedure processing until it meets the specified condition.
// EVOKE PRTLIST The System/36 Environment Reference book
describes the WAIT OCL statement.
The following PRTLIST procedure is started:
\ Start order summary listing program If you use the WAIT OCL statement, consider the
// LOAD PRTLIST following points:
// FILE NAME-ORDFILE You can use the ?TIME? substitution
// RUN expression, along with the WAIT OCL state-
ment, to see whether the job has waited until
Because users of applications are not always Testing and Debugging Programs
aware of how their system works, they may not
know when an error occurs. As a result, users Thoroughly test and debug your programs to mini-
may be unfamiliar with the consequences of the mize programming errors.
error.
As you test your programs and procedures, use
Common user errors include the following: the LOG OCL statement or the LOG procedure to
Inadvertently powering off a display station ensure that all OCL statements in your procedures
Entering inaccurate data are recorded to the job log. Logging OCL state-
ments to the job log allows you to trace the
To reduce the occurrence of errors, restrict the activity of your procedures and programs.
user to running options from an assigned menu. If
a problem occurs, allow the program to detect the The DEBUG OCL statement allows you to follow
problem and stop the user from going further. the logic of your procedures as you run them.
You or the program (not the user) should handle Using the DEBUG OCL statement, you can
the recovery. Recovery from user errors should specify whether procedure control expressions
be treated in the same way as recovery from and OCL statements in your procedures should be
system operator errors. listed as they are evaluated, and whether the pro-
cedures should stop after each job step. Like the
LOG statement or procedure, the DEBUG state-
Error Prevention ment enables you to evaluate your procedures
and programs as you test them. The System/36
This section describes how to prevent some fail- Environment Reference book has more informa-
ures and errors. tion about the LOG OCL statement, the LOG pro-
cedure, and the DEBUG OCL statement.
Using the Automatic Response Many programming languages allow you to debug
Function operations during compile time. Some program-
ming languages allow you to override debugging
Use the RESPONSE and NOHALT procedures to operations, preventing the debugging information
automatically respond to system messages. from being added to your source code. However,
When you use these procedures, the system auto- the debug option is a good way to detect program
matically responds instead of displaying an error errors before they occur. For more information
message. So, you can define a specific response about the problem analysis and program debug-
that will be used automatically, rather than having ging capabilities of the programming language you
an operator enter a response. use, see the corresponding language manual.
If a program needs to use a file or resource, and Your error-handling code performs functions such
that file or resource is being used by another as correcting problems and stopping the program.
program or procedure, an error can occur. The A message should alert your users to the situ-
WAIT parameter of the FILE OCL statement can ation. You can define the message, severity
prevent other programs from waiting for the levels, and various procedures the display station
resources owned by another job. The System/36 operator should perform when an error occurs.
Environment Reference book has more informa-
tion about the WAIT and FILE OCL statements. When a routine detects an error, the program
must determine what to do. Consider the fol-
See “Extendable Files” on page 7-23 for informa- lowing:
tion about correctly extending files.
Try the display station operation again. If your
program cannot read a display format, the
Allocating the Diskette or Tape program can continue trying to read the
Drive to a Job display format.
You can use the ALLOCATE OCL statement to Save the data the program uses and end the
dedicate the diskette or a tape drive to a job. For program. If you do this, you must be able to
example, you normally do not keep control of the use the saved data and start the program
drives between SAVE procedures. After FILE1 is again.
saved, but before FILE2 is saved, another proce- End the program without saving the data, or
dure on the system uses the drive. Because of end the program and discard previously-saved
this, your SAVE FILE2 procedure must wait until data. You must load the program and enter
the other procedure is done. the data again.
To avoid allocating the drive longer than neces- Release the display station from a multiple
sary, use the DEALLOC OCL statement to deallo- requesting terminal (MRT) program.
cate the drive. For example, your procedure
For more information, refer to “Error-Handling
saves three files and runs another type of job that
Considerations” on page 19-8.
did not use the drive. You could use the
DEALLOC OCL statement to allow other jobs on
the system to use the drive. The System/36 Envi-
ronment Reference book has more information
Program Language Error
about these statements. Detection
Each programming language supplies ways to
Error Detection detect errors as they occur. The following
sections describe some of these error detection
Errors can occur in the system functions or the capabilities. For more information about the error
input data that your program uses. Try to antic- detection capabilities and the error return codes
ipate these problems by putting code in your pro- for programming languages, see the appropriate
grams to handle them. If such code is not in your language manual.
programs, output data and files can contain errors
you are not aware of.
User-Coded Error Detection Most backup procedures used for batch systems
Routines also apply to interactive systems. However, there
are additional backup considerations in interactive
You can create your own detection routines for systems. In interactive applications, the entire
errors unique to your computer system. The business can become dependent on the system.
design and purpose of such coding depends on Therefore, the system must have reliable backup
your particular application. and recovery procedures.
RSLW079-1
the sequence in which the batches have been This method prevents the reentering of trans-
saved. Also, the operator lists the names of actions required in the first method.
the procedures in the order that they were
The third method requires the most planning
run.
and programming, but it provides the quickest
The recovery method requires the operator to way to recover data because the operator’s
do the following: involvement is minimized. Code must be
included in an application’s procedures to do
– Delete the files from disk.
the following:
– Restore the backup copies from diskettes
or tapes to establish a point from which to – Periodically save the master files and their
recover. related files.
– Reprocess the application’s procedures in – Automatically save batches of transactions
their original order using the saved copies on disk, diskette, or tape at logical break-
of the transaction batches. The operator points in the application.
uses the information labeled on the – Assign names and sequence numbers to
diskettes or tapes to ensure that the trans- these batches of transactions.
action batches are restored in the correct – Keep a log of all procedures the operator
order. runs after the previous backup.
– Provide a common recovery procedure.
There are several possible values for the device ICF Error Considerations
recovery action job attribute and each results in a
different device recovery action in the System/36 On the System/36, if a permanent communication
environment: error occurs when two programs are communi-
*MSG cating using a System Support Program-
The application program requesting the Interactive Communications Function (SSP-ICF)
input/output operation receives an error session, the session is released by SSP-ICF data
message indicating the input/output operation management.
If the DBCS job attribute indicates the job is Creating System/36 data files
capable of handling DBCS data and a This can be done by running any System/36
Message ID Character (MIC) of A000 procedure or utility program that creates a
appeared in the source member before the System/36 data file or any user application
messages, the following actions take place: program that creates a System/36 data file.
– The third character of the message prefix If the DBCS job attribute indicates the job is
is changed to a Z (that is, USZ). capable of handling DBCS data, the file is
– Shift-out (SO) and shift-in (SI) characters created allowing DBCS data.
are inserted when a IGC string is con-
If the DBCS job attribute indicates the job is
tinued on another line.
not capable of handling DBCS data, the file is
– The source file created for the Create
created not allowing DBCS data.
System/36 Message File (CRTS36MSGF)
command allows DBCS data. Updating the Auto Response value for
messages
If the DBCS job attribute indicates the job is
not capable of handling DBCS data, the fol- This can be done by running the RESPONSE
lowing actions will take place: procedure or loading the $ARSP utility
program.
– The third character of the message prefix
is not changed to a Z (that is, USR). If the DBCS job attribute indicates the job is
– The scanning of shift-out (SO) and shift-in capable of handling DBCS data, the DBCS
(SI) characters is not done. messages are updated. An example would be
For information on job descriptions, see the Work 2. Type 2 in the S/36 printer IDs field of the
Management book. Change S/36 Environment Configuration
display.
3. Press the Enter key when the Change S/36
System/36 Environment DBCS Printer IDs display appears.
Printer Support 4. When the Change S/36 Environment Config-
uration display appears again, press the Enter
For every printer defined in the System/36 envi- key to update the System/36 environment
ronment, the system creates a print file with the print files.
same name as the System/36 environment printer.
If P1 is a System/36 environment printer ID, library The CHGS36 command updates the System/36
#LIBRARY contains a print file named P1. When environment print files to match the IGC attribute
a System/36 environment application creates in the printer device descriptions. If you cannot
printed output, the System/36 environment support change a System/36 environment print file, an
uses these print files to define some of the attri- error message appears. The message describes
butes of the spooled file. the reason you cannot change the print file and
the action you need to take to correct the problem.
If the printer can print double-byte characters and After you correct the problem, run the CHGS36
the AS/400 system value indicates the job is command again to update the print files.
capable of handling DBCS data, the system
creates the print file in #LIBRARY with the
IGCDTA parameter specified as *YES. This Writing Applications for
allows DBCS data to be printed.
Translating Considerations
If the printer cannot print double-byte characters
or the AS/400 system value indicates the job is Consider the following guidelines if you are writing
not capable of handling DBCS data, the IGCDTA applications that will be translated into several lan-
parameter is not specified when the print file is guages:
created. Thus, DBCS data cannot be printed and Information the user sees should be separated
DBCS characters sent to the printer are inter- from the programming statements. Messages
preted as single-byte characters. a user sees should be in a message member
rather than literals in programming language
If the system created a spooled file with the statements.
IGCDTA parameter of *YES and you move this file
to a printer that cannot print DBCS data, the Each translation of IBM-supplied data should
system sends a message to the message queue be in a separate language library.
Use a control field in each record as its relative Handling Synonym Records
record number. For example, use loan number
3456 without change as relative record number You can handle synonyms in many ways. Fol-
3456. Use a control field directly as a relative lowing are two common ways:
record only if a large number of unused values are
not within the range of values for the control field. Place synonyms in a separate part of the file.
If there are many unused values and record posi- Place synonyms in the next available blank
tions, define an algorithm to reduce the size of the location.
file.
The record must contain a pointer to the synonym
record. If two or more synonyms exist, the first
Choosing an Access Algorithm synonym contains a pointer to the second
synonym, and so on.
An access algorithm is the method you use to
For example, the control field for a file is the first
determine the position each record will occupy.
five characters of the customer’s name. The file
The algorithm must supply a positive, whole
contains space for 40 000 records and allowance
number as a relative record number.
for three synonyms for each home record. The
Use a formula as an algorithm to determine the customer’s name is converted to a decimal value,
record number. For example, if loan numbers as shown in the following figure:
start with 1001, loan number 3456 could be rela-
SMITH
tive record number 2456 (3456 minus 1000). The
formula can be as complex as you need to make
it. Refer to “Examples of Access Algorithms” on
page A-2 for more information and examples. E2 D4 C9 E3 C8 (EBCDIC code)
(494ð x 4) + 1 = 19761
1
12 Months’
Examples of Access Algorithms Growth
bytes larger than the old record and that the file
also accommodates 12 months of growth before RSLW054-0
RSLW056-0
Consider the following: The file should be loaded, and the synonyms
added in a second run. As the synonyms are
Item 1031 is placed after position 34.
added in the next available higher-numbered posi-
Item 1037 occupies a higher-numbered posi- tion, a synonym pointer in the record has to be
tion than item 1031. updated to point to the synonym record position.
File positions 7 and 17 are unused.
After accessing a record, the program has to
Indexed File with Keys
verify that the record is the one requested. If
In this example, a customer master file contains
it is not, the program must access a synonym.
three types of records (A, B, and C) for three
No more than two items have the same rela- types of customers. These records are in an
tive record number. Thus, most records indexed file with keys. Type A records have cus-
require no more than two disk accesses. tomer numbers from 10000 to 49999. Type B
records are numbered from 60000 to 79999.
Note: In this example, records are loaded into
Type C records are numbered from 90000 to
locations before synonym records are loaded in a
99999. Each type of record is arranged alphabet-
second run, and few records are added. If
ically by customer name.
records are added after the synonyms are loaded,
the locations for the added records can be occu-
The file was first loaded with approximately 500
pied by synonyms. Thus, the added record
alphabetized type C records, followed by 1000
becomes a pseudosynonym. If many records
alphabetized type B records, and finally by about
are added, most have to be handled as syno-
3000 alphabetized type A records.
nyms. In this situation, the technique described
here can be less useful because performance is Records were added at the end of the file as
degraded as records are added. follows:
In this synonym-handling technique, the average The added record type is determined (A, B, or
synonym should be close to the first position C).
searched. Thus, a second access is necessary The added record is assigned an unused cus-
approximately 15% of the time, and this access tomer number that corresponds to the alpha-
should find the record not too distant from the ori- betic sequence of the customer name
ginal location. according to a printout of the file.
Right-to-Left Display
Format ID (WSU Only)
Sequence
Override Fields
Number of Lines
Sequence Indicators Indicators Reserved Key Mask
Reset Keyboard
Suppress Input
Entry Required
Name
Blink Cursor
Number
Return Input
Sound Alarm
Preprocess
WSU Only
132 Column
Lowercase
Reserved
Reserved
to Clear
Null Fill
Priority
Repeat
1 2 3 1 2 3
Start
End
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
RSLW082-0
The name must be left-justified in the field. for an 80-column display, 27 for a 132-column
display). The number of lines to clear must
The name must be unique.
be right-justified. A leading zero is not
An asterisk (*) in column 7 identifies this required.
record as a comment statement.
Be careful when you partially cover a second
Note: See *DDS in column 1 for a special
display format. You lose the help areas in any
exception.
portion of the display cleared by a display format.
See “Format Names” on page 14-24 for additional Input fields covered by a new display format still
considerations. allow data entry. When you show a display format
that does not define input fields, do not clear the
lines that contain an existing input field or fields.
Start Line Number (Columns 17 and
18): Select one of the following entries for Figure B-2 on page B-3 shows the use of the
columns 17 and 18: start line number and the lines to clear entries to
blank show one display format over another.
Line 1 is the start line number.
Lowercase (Column 21): Select one of the
1 through 24/27
following entries in column 21 to allow lowercase:
This number must be less than or equal to
the number of lines on a display (24 for an N (or blank)
80-column display and 27 for a 132-column The system displays all alphabetic characters
display). This number must be right-adjusted. typed by the operator and sends them to the
A leading zero is not required. application program in uppercase.
V The start line number is variable. The appli- Y The system displays all alphabetic characters
cation program using this display format typed by the operator and sends them to the
defines it. If you specify V and the application application program in lowercase or upper-
program does not define a start line number, case. Lowercase is ignored for fields with an
the system uses line 1 as the start line X data type.
number. Note: If you specify Y (lowercase allowed) in
column 21 of the S-specification, but you specify
Number of Lines to Clear (Columns 19 N (uppercase only) in column 51 of the
and 20): Select one of the following entries for D-specification for an input field, the operator can
columns 19 and 20: type only uppercase alphabetic characters in the
input field.
blank
All lines of the current display clear before
this display format appears. Return Input (Column 22): Select one of
the following entries for column 22:
0 through 24/27
The number of lines to clear before this Y (or blank)
display format appears must be less than or The contents of all input fields return to the
equal to the number of lines on a display (24 application program when the operator
presses Enter. If you specify mandatory entry
Display B (starts at
Line 12 and clears
Display A + Lines 12 through 24 = Result
of Display A)
RSLW097-0
Figure B-2. Use of Start Line Number and the Lines to Clear Entries
in column 29 of the D-specification for any Enable Function Keys (Column 27):
input field in the display format, the operator Use column 27 to enable function keys. When a
must type data in that field. An error function key is enabled, the key performs a
message appears if the operator presses a special function and must be handled by the appli-
function or command key or the Enter key cation program. When a function key is disabled,
and does not type data in the mandatory the key either has no special function in the
entry field. The operator must press the Error program or is handled by the system. Specify one
Reset key and type data in the mandatory of the following values in column 27:
entry field.
blank
N The contents of all input fields return to the All function keys are enabled. All numbers
application program only if the operator types listed in the key mask are ignored.
in data. If no data is entered in any input
field, RPG II program record input specifica- Y The function keys identified by numbers listed
tion indicators dependent on display constants in the key mask are enabled, while all others
do not turn on because the input fields do not not listed are disabled. If the key mask con-
return to the application program. tains no numbers, all the function keys are
disabled.
Note: You can improve response time for display
formats shown at a remote display station if you N The function keys identified by numbers listed
specify N (No) for return input. in the key mask are disabled, while all others
not listed are enabled. If the key mask con-
tains no numbers, all the function keys are
Sound Alarm (Columns 25 and 26):
enabled.
Select one of the following entries for columns 25
and 26: R (retain)
The function keys previously enabled remain
N (or blank) enabled, and those previously disabled
If you specify N (No) or leave these columns remain disabled. All numbers in the key
blank, the alarm does not sound when the mask are ignored.
operator looks at this display format.
Y If you specify Y (Yes), the alarm sounds when Notes:
the operator looks at this display format. 1. An error message appears if the operator
01 through 99 presses an inactive function key. The oper-
The alarm sounds if the specified indicator is ator can then press the Error Reset key, fol-
on when this format is displayed. lowed by the correct function key. You
identify the function keys to be turned on or
off by numbers in the key mask (columns 64
through 79).
If the operator has pressed the Enter key Note: If an indicator specified in the protect-field
without typing in data, data contained in entry (columns 37 and 38 of the D-specification) is
the input fields is not erased, including on, that indicator is ignored during the override
mandatory entry input fields. operation.
If the operator has typed data in any input Select one of the following entries for columns 33
field, then only those input fields in which and 34:
the operator has typed in data are erased.
If the operator types data in any of the N (or blank)
input fields, the operator must type data in The application program does not do an over-
all mandatory entry input fields; data in the ride operation for this display format. The
mandatory entry fields is also erased. system shows a normal output operation.
01 through 99
The first erase-input-fields operation erases data An override operation does not occur if this
from all input fields. The second erase-input-fields indicator is off when the display format
operation erases data from only those input fields appears.
in which data has been typed since the first erase-
The following occur during an override opera-
input-fields operation, if the following occur:
tion when the indicator in columns 33 and 34
1. A display format with return input specified is on:
appears.
The data does not change in a field for
2. An erase-input-fields operation is done.
which you specified an indicator for the
3. Another erase-input-fields operation is done.
output data entry in columns 23 and 24 of
the D-specification, and that indicator is
Override Fields (Columns 33 and 34): off. Data the operator typed is
An override operation allows you to change (over- unchanged. Any field with a Y (Yes), an
ride) fields in a display format without showing the N (No), or a blank specified for the output
same display format again. If the application data entry does not change.
program determines the operator typed incorrect
The program displays the field with data
data into a field, turn this indicator on to override
supplied by the application program if the
the entry and display the same display format
indicator for the output data entry is on.
again. If the indicator specified in the output data
entry for a field in columns 23 and 24 of the Y If Y is specified in column 33, an override
D-specification is off, the incorrect data does not operation is performed every time this format
change. Once the operator corrects the error, turn is displayed. Generally, Y should not be
the indicators off and display the display format specified. If an override operation must be
again using an override operation to remove any performed for this format, an indicator should
highlighted fields or error messages. be used.
Field attributes may be changed if the Figure B-3 on page B-7 summarizes the effects
D-specification contains one or more of the fol- of indicators on output data during an override
lowing: operation.
OFF ON
Enter a help format name in columns 7 through 14 If the help text label is fewer than 8 characters
exactly 8 characters long, in the form axxxxxnn, long, you must left-justify it in this field (it must
where: start in column 7). An asterisk (*) in column 7
identifies this record as a comment statement.
a An alphabetic character (one of the
characters A through Z).
Reserved (Columns 15, 24, 33, 38, 43,
46, 49, 52, 54–80): The FORMAT procedure
does not use these columns. Leave them blank.
Restore Application
Suppress Selection
Online Document
Column Number
Lower Right
Reserved
Reserved
Reserved
Reserved
Boundary
Reserved
Reserved
Reserved
Reserved
Indicator
Indicator
Format
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
RSLW081-0
Help Display File Name (Columns 16 Cannot be ALL, SYSTEM, NEW, or DIR
through 23): Use the help display file name
You must left-justify the document name (starting
to specify the name of the display file that con-
in column 16) in this field if it is fewer than 8 char-
tains the help format specified in columns 7
acters long.
through 14. The display file can contain more
than one help format for a help area, but all help
formats for one help area must be in the same Help Library Name (Columns 25
display file. Help formats for different help areas through 32): Use the help library name to
need not be in the same display file. specify the name of the library that contains the
display file specified in columns 16 through 23 of
If the display file name is fewer than 8 characters, this H-specification. You cannot specify a library
you must left-justify it in the field. name if you do not specify a display file name.
The operator must be able to reach the specified
If you do not enter a display file name in columns library name if resource security is active. See
16 through 23, the help format or display format the Security – Reference book for information
for this help area must be in the display file cur- about restricting library use.
rently used by the application program. If you do
not enter a display name, you cannot specify a You must left-justify a library name fewer than 8
library name in columns 25 through 32 of the characters long.
H-specification.
If you specify a library name, the system looks in
Help Document Name (Columns 16 that library for the display file specified in columns
16 through 23. If the system does not find the
through 23): Use the help document name if
display file in the specified library, an error
you specify online document in column 53 of the
message appears when the operator presses the
H-specification. The help document name speci-
Help key.
fies the name of the help document to appear
when the operator presses the Help key while the
If you do not specify a library name, the system
cursor is in this help area. An error message
looks for the display file in the user’s library list.
appears if the system does not find the document
An error message appears if the system does not
in the specified folder when the operator presses
find the display file in either library when the oper-
the Help key.
ator presses the Help key.
Enter an online document name that meets the
following requirements: Folder Name (Columns 25 through
32): Use the folder name if you specify online
Must be from 1 to 8 characters long
document in column 53 of the H-specification.
Must not contain a question mark (?), single The folder name specifies the name of the folder
quotation mark ('), slash (/), period (.), hyphen containing the document specified in columns 16
(-), equal sign (=), greater than sign (>), through 23 of the H-specification. An error
comma (,), asterisk (*), or blank message appears if the system does not find the
Upper Left Row and Column (Columns For example, if you specify an upper left row
34 through 37): Use this field to specify the number of 5 in columns 34 and 35 of the
location, in the form rrcc, of the upper left corner H-specification, and a start line number of 10 in
of the rectangular help area. The row number, rr, columns 17 and 18 of the S-specification, the
must be a number from 1 through 24 for an actual row number would be 14, as shown by the
80-column display format, or 1 through 27 for a following calculation:
132-column display format. Leading zeros are not
required, but you must right-justify the value in 10 + 5 − 1 = 14
columns 34 and 35. The column number, cc, is a
2-digit number (if below 100), or alphanumeric If the resulting upper left row number is greater
(100 through 132) character that represents than the number of lines on the display (24 for an
columns from 1 through 80 for an 80-column 80-column display station or 27 for a 132-column
display and from 1 through 132 for a 132-column display station), one of the following occurs:
display.
If you specify a numeric value for the start line
Columns 100 through 132 are represented by number, the system reports a terminal error
alphanumerics, as shown in the following table: when you compile the display format.
If you specify V for the start line number and
Figure B-5. Alphanumeric Row and Column Numbers the resulting row number is greater than 24 for
for 100 through 132 an 80-column display station or 27 for a
100=A0 110=B0 120=C0 130=D0
132-column display station, the application
101=A1 111=B1 121=C1 131=D1 program ignores this H-specification when the
102=A2 112=B2 122=C2 132=D2 display format appears.
103=A3 113=B3 123=C3
104=A4 114=B4 124=C4 If you do not specify the upper left row and
105=A5 115=B5 125=C5 column numbers, you must also leave the lower
106=A6 116=B6 126=C6 right row and column numbers entry blank in
107=A7 117=B7 127=C7 columns 39 through 42 of the H-specification.
108=A8 118=B8 128=C8
109=A9 119=B9 129=C9 You can define a null help area by omitting all row
and column entries. An operator cannot see the
Note: Values beyond D2 are not permitted. help formats of a null help area by pressing the
Horizontal Positions
Location
Space Factor
Column Separators
Elements per
Fill Direction
Horizontal Position
Specification Type
Field Name
Mandatory Entry
Constant Data
Position Cursor
Reserved
Reverse Image
Constant Type
Sequence
Mandatory Fill
High Intensity
Input Allowed
Continuation
Protect Field
Line Number
Number
Enable Dup
Output Data
Self-Check
Nondisplay
Lowercase
Blink Field
Data Type
Adjust/Fill
Underline
Reserved
Field
Field Name 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Length
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
D
RSLW080-0
inserted at this position in the DDS generated by if a message identified by a message identification
$SFGR. See “Sequence Number (Columns 1 code and a message member identifier appear in
through 5)” on page B-1 for a more complete column 56.
description and warnings.
Note: If you are using the double-byte character
set (DBCS) version of the OS/400 operating
Specification Type (Column 6): The system and you defined the field as data type E,
character D identifies this record as a field defi- F, or X in column 27, the field length must be an
nition. This entry is required and is preprinted on even number equal to or greater than 4.
the D-specifications form.
Line Number (Columns 19 and 20):
Field Name (Columns 7 through 14): The line number entry specifies the line number at
The field name entry specifies the name of the which the field begins, relative to the start line
field being defined. The field name can have a number specified in columns 17 and 18 of the
maximum of 8 characters. Use it for reference S-specification. You must right-justify the line
only; it is not included in the display format. number entry. A leading zero is not required.
An asterisk (*) in column 7 identifies this record as The start line number specified in columns 17 and
a comment statement. If it is a continuation of the 18 of the S-specification affects the actual line
previous record, you must specify the character X number at which the application program displays
in column 80 of the previous record. the field. Use the following equation to determine
Note: The system uses the first 6 characters of the actual line number at which a field is dis-
the screen design aid (SDA) field names to create played:
RPG field names. The first 6 characters of the Start line number Line number specified
Actual specified for for line number
SDA field names must be unique if you use option line = start line number + (columns 19 and 2ð of – 1
4 (Edit source and procedure members) on the number (columns 17 and 18 the D-specification)
of S-specification)
SDA Main Menu because RPG field names
cannot be copied. For example, if you specify 5 as the start line
number and 6 as the line number, the field actu-
Field Length (Columns 15 through ally begins at line 10, as shown by the following
18): The field length entry specifies the length equation:
of the field defined by the D-specification. The
field length can be any number from 1 through 5 + 6 − 1 = 10
1919 (1 through 3563 for terminals that support
132 columns). The field length value must be If you do not specify a start line number in the
right-justified. Leading zeros are not required. S-specification, the application program uses a
start line of 1.
Self-check fields cannot be longer than 32 posi-
tions. Fields must be 6 characters long or longer
If the application program does an override opera- this field. See “Override Fields (Columns 33 and
tion and the specified indicator is on, data sup- 34)” on page B-5 for information about override
plied by the application program or the message operations.
identified by the application program appears in
This duplicate character has a hexadecimal value Y When the operator types data into the input
of X'1C'. The operator can type data into the fields on the display, the system automatically
first record and press the Dup key for following returns to the application program when one
records to contain the same data. For each fol- of the following occurs:
lowing record, the program removes the duplicate You type the last character in this input
characters and replaces them with the actual data. field and specify N (No) or blank for con-
trolled field exit.
The first dot of a column separator appears in the A similar situation occurs when the field ends in
character cell of the field starting attribute. The the farthest right column of the display.
last dot of a column marked Field appears in the Figure B-9 shows the results of specific attribute
character cell of the field ending attribute. The fol- combinations.
Blank N Y
Blank lowercase or
uppercase only uppercase only uppercase
Entry in Column 51 N
uppercase only uppercase only uppercase only
of the D Specification
lowercase or lowercase or lowercase or
Y uppercase
uppercase uppercase
RSLW098-1
Figure B-10. Entries to Specify What the Operator Can Use in the Input Field
Depending on the length of the output field, – If the PROMPT OCL statement is used to
the system fills the message text with blanks display a screen, the system looks at the
or shortens it to the length of the field when value of the parameter that corresponds
the display format appears. with the output field of the display file. If
that value is a MIC number, the message
The message member identifier identifies the
text for that MIC number is shown on that
message member that contains the message.
line of the display file. If the value is
The message member identifier can be one of
blank, the line on the display file is left
the following:
blank.
U1 or blank
For example, if you specify M in column
User-1 message member
56 of the D specification for the third
U2 User-2 message member output field on a display file, leave
P1 Program-1 message member columns 57 through 79 blank, and the
third parameter of the procedure that con-
P2 Program-2 message member tains the PROMPT statement is 0001, the
M1 System/36 environment level-1 message message text for MIC number 0001 is dis-
member (##MSG1) played in the third output field. If the
value for the third parameter of the proce-
M2 System/36 environment level-2 message dure is not given, the third output field is
member (##MSG1) left blank.
If you specify a MIC, but do not specify a If the MIC is not found, or if the message
message member identifier, the system member is not found, then the MIC, fol-
assumes U1 as the message member. A lowed by ?? is shown on the display file
user or procedure can redirect the system to where the message text would normally
the proper message member and library by be shown. For example, if you specify
using the //MEMBER OCL statement, or by MIC 1234, but this MIC has not been
using the Override Message File (OVRMSGF) defined in the message member, 1234??
CL command. The // MEMBER OCL state- would be shown on the display file. The
ment takes precedence over the OVRMSGF job log for the job would also contain diag-
CL command. nostic message CPF2419, with more infor-
If you leave columns 57 through 79 blank, the mation about the MIC and the message
following happens: file. If the message member could not be
found, escape message CPF2407 would
– If an application program is used to show
be in the job log with the message file and
the display and the program passes a MIC
library name identified.
number, the message text for that number
is shown on the line of the display file. If the MIC is not numeric or not between A
and F, then the MIC followed by the
– If an application program is used to show
message member identifier is shown on
the display and the program does not
the display file where the message text
pass a MIC number, the line on the
would normally be shown. For example, if
display is left blank.
This function allows a user to include a graph any- Consider the following when using the
where in the data that is printed by any program #$@INCLGRPH control record:
(for example, AS/400 word processing, COBOL, or
Parameters x, y, w, and l define the area on
RPG). You can create the graphics file by using
the page where the graphics file will print.
such utilities as the Business Graphics Utility
Parameters x and y define the upper left
(BGU) or the IPDS Advanced Functions.
corner of the graphics area, and parameters w
and l define the size of the graphics area.
For more information about the BGU, see the
There must be only one space between the
BGU User’s Guide and Reference book. For
command word and the parameters.
more information about word processing, see the
The #$@INCLGRPH control record should be
Getting Started with OfficeVision/400 book or the
in a print record by itself, because any other
Using OfficeVision/400 Word Processing book.
data along with it may be considered as
For more information about the IPDS advanced
parameters.
functions, see Appendix D, “Intelligent Printer
Actual parameters should immediately follow
Data Stream (IPDS) Advanced Function Support.”
one another, separated by commas, using no
To include graphics with other program output, blanks.
use a special control record. The format for this The specified values for width (w) and length
control record is: (l) should be equal, since the printer will scale
the graphic to fit a square area.
#$@INCLGRPH filename,x,y,w,l Parameters x, y, w, and l can be specified in
decimal numbers of any combination of xx.xx,
The parameters are described as follows: where x is any number from 0 through 9. The
filename specified value cannot be more than 22.75
Is the name of the graph object file to include. and, if a 0 value is specified, the result is the
The file with the latest date will be used. This default value for that parameter.
function also supports remote files. The characters #, $, and @ must be given as
defined in code page 500. That is, they must
x Is the distance in inches from the left edge of
be X'7B', X'5B', and X'7C' respectively.
the page to the left edge of the graphics area
on the page. The default is 0. If there is anything wrong with the control record
y Is the distance in inches from the top of the or an error occurs while processing the graphics
page to the top edge of the graphics area on file, the control record will print as normal text
the page. The default is 0. data.
w Is the width of the graphics area in inches.
The default is the width of the current page Example of an Included Graphics
you are using. File
The following figure is an example of a graphics
file that is included with other output:
10% Discount
On All Orders Over
STNO -A . . . B . . . C O B O L S O U R C E S T A T E M E N T $500.00 . . . IDENTFCN SEQ/NO S
Wholesale
Tire & Supply
Company
Account Number
1 IDENTIFICATION DIVISION
2 PROGRAM-ID.175 R14 Tire Drive
D10105.
3 Radial- City,
AUTHOR. LL HIRSCH MI
FUT TESTER FOR DEPT 48X.
4 INSTALLATION ROCHESTER.
5 DATE-WRITTEN
6 DATE-COMPILED. 85/11/20.
7 SECURITY.
COBOL TEST PROGRAM - D10105 Bill To:
THIS PROGRAM IS USED FOR TESTING THE GRAPHICS/TEXT MERGE USING
THE #$@INCLGRPH CONTROL RECORD. IN THIS TEST CASE, THE CONTROL
RECORD STRING APPEARS TOGETHER ON THE COMPILED OUTPUT; SO THAT
THE GRAPH WILL BE MERGED AT THE TIME OF THE COMPILER OUTPUT AS
WELL AS ON THE PROGRAM OUTPUT.
8 ENVIRONMENT DIVISION.
9 CONFIGURATION SECTION.
10 SOURCE-COMPUTER. Item Description
IBM-S36, Qty Unit Price Total
11 OBJECT-COMPUTER, IBM-S36.
12 SPECIAL NAMES.
13 C01 IS TO-NEW-PAGE, Graphic Overlays
14 UPSI-0 IS Compiler Output
15 LOCAL-DATA IS LOCAL-DATA-AREA.
16 INPUT-OUTPUT SECTION.
17 FILE-CONTROL.
18 SELECT PRINT-FILE ASSIGN TO PRINTER-CBLPRT.
19 SELECT CUST-FILE ASSIGN TO DISK-CUSTFILE.
20
SELECT PART-FILE ASSIGN TO DISK-PARTFILE.
21
DATA DIVISION.
22
FILE SECTION.
23
FD PRINT-FILE
LABEL RECORDS ARE OMITTED.
RECORD CONTAINS 80 CHARACTERS,
DATA RECORD IS PRINT-RECORD.
01 PRINT-RECORD PIC X(80).
24
25 FD CUST-FILE
LABEL RECORDS ARE STANDARD,
RECORD CONTAINS 90 CHARACTERS,
DATA RECORD IS CUST-RECORD.
01 CUST-RECORD.
26 02 CUST-NAME-IN
27 02 STREET-IN Subtotal $
28 02 CITY-IN PIC X(28).
29 02 STATE-IN PIC X(20). Less Discount $
30 02 ZIP-IN PIC X(15).
Total $
31 PIC X(2).
02 ACCT-NUM-IN
32 PIC X(5).
02 FILLER
33 PIC X(11).
PIC X(9).
Divided Word
WORKING-STORAGE SECTION.
01 INCLUDE-RECORD.
02 FILLER PIC X(3) VALUE ’#$@’.
02 FILLER PIC X(28) VALUE ’INCLGRPH FORM, 0, 0, 8, 5, 11 ’.
02 FILLER PAC X(53) VALUE SPACES.
RSLW000-1
Figure C-1. Output Example when the Control Word (#$@INCLGRPH) in the Source Program is Not Divided
1 2 75 76 77 78 79 80
Program Graphic Card Electro Number
Keying Page of Program
Instruction Identification
Programmer Date Key
Decimal Positions
Plus Minus Zero
Not
Not
01 C
02 C
03 C
04 C
05 C
06 C
07 C
RSLW001-1
4245 yes no no no no no no no no no no no
5256 yes no no no no no no no no no no no
5262 yes no 6, 8 no no no no no no no no no
6262 yes no no no no no no no no no no no
RSLW109-0
IPDS Advanced Function Support When the record length of the printer file is
greater than 132, the printer OCL statement
Printer Options and the AS/400
must set characters per inch to 15, even
Printers: Not every printer option can be used though the IPDS advanced function support
by all AS/400 printers. Figure D-2 shows the
may set characters per inch to 12, 15, or 16.7
options that you can use with each AS/400 printer
within the program.
or its equivalent.
When you change the characters per inch
Note: In this figure, IPDS means intelligent
option for the 5219 Printer, the font ID that
printer data stream printers.
normally corresponds with this characters per
inch value display on the 5219. Press the
You must be sure that the options you specify are
Start key on the 5219 to start printing. You do
valid for the printer that you use. Otherwise, an
not need to change the print wheel to the font
error occurs. If you specify printer options in a
that is displayed.
spool file, the file could be sent to a printer that
does not support these options, and an error could
occur. Character Style Option: You can specify
any character style (FONT) ID of up to 4
hexadecimal characters from 01 to FFFE.
Characters per Inch Option: The charac-
ters per inch (cpi) option lets you specify the
You must specify a parameter value because
number of characters to be printed per inch. Valid
there is no default for this option.
values are 5, 10, 12, 15, and 16.7. There is no
default for this option. A parameter value must be Consider the following when specifying character
specified. style:
Consider the following when specifying characters Selection of an F0 through F9 character style
per inch: results in double-wide characters on IPDS and
3812 printers.
When you specify 5 cpi for the 4214 Printer,
the printed characters are double-wide.
Appendix D. Intelligent Printer Data Stream (IPDS) Advanced Function Support D-3
On IPDS printers, print quality and character GREEN WHITE (no color)
style selections interact with one another. To PINK (magenta)
get the best results, print quality should be set
first, then the character style. See “Print The default is BLACK.
Quality Options” on page D-6 for information
on setting print quality. Consider the following when specifying the color
option:
Printing OCR Characters: To print optical char- If the specified color cannot be printed by the
acter recognition (OCR) characters on the 3812 ribbon currently on the printer, black is printed.
printer, you must set the code page to 340 (hex The color option WHITE does not print a char-
0154), using the transparent (TRANS) option. For acter, but allows the printer to advance (print
information on the TRANS option, see “Trans- a blank) for each character printed.
parent Option” on page D-5. The parameter for
the TRANS option is:
Drawer Selection Option: Select the
2BD1ð6ð1ððððð154 printer source drawer for paper using the drawer
selection (DRAWER) option. Valid values are 1,
After setting the code page, select either of the 2, and 3. You must specify a parameter value
character styles OCR-A or OCR-B, using the char- since there is no default.
acter style option (FONT). The parameters are:
Hex Value Character Style When you specify the DRAWER option, you auto-
0013 OCR-A matically start a new page of printing. If you are
0003 OCR-B not currently printing a page, a blank page may be
fed from the current drawer.
Before changing back to another non-OCR char-
acter style, use the TRANS option to set the code Emphasis Option: The emphasis
page to your default value. (EMPHASIS) option causes bold characters to
print on IPDS printers by using a double-strike
Printing Mathematical Symbols: To print math- character style (FONT). The parameters are:
ematical symbols on the 3812 printer, perform the
same steps as above for printing OCR characters, Parameter Description
except use the math symbols font code (hex ON Begin emphasis printing
001E) for the character style option parameter and OFF End emphasis printing
code page 259 (hex 0103) for the transparent
You must specify a parameter value for this option
option parameter. At the start of the next job, the
because there is no default for this option.
code page is set to the value selected at the
printer operator panel.
Forms Characters Option: The forms
characters (FORMS) option downloads to the
Color Option: The color (COLOR) option is
printer, a set of 11 characters used for drawing
only valid for the color models of IPDS printers.
boxes. Valid values for this option are a blank, 22
This option sets the color for the printed output.
hexadecimal characters, or RESET.
The parameters are:
You can use a set of default values for these
BLACK RED
characters by leaving the PARM field blank. The
BLUE TURQ (turquoise, also cyan)
following figure shows the default values for the
BROWN YELLOW
box characters:
Note: The default character values in the pre- Consider the following when using the transparent
ceding figure are for the U.S. character set. If you option:
use a character set other than U.S., the default
hexadecimal values remain the same, but the The data must be left-justified in the param-
default characters that they represent may be dif- eter field, otherwise you will get return code
ferent. 42. (The specified parameter is not valid.)
The parameter must contain an even number
When you use the FORMS values to print box of characters.
characters, the box or forms characters replace The data in the parameter field must be in
the characters that would normally be printed. EBCDIC.
The printer documentation contains a list of A blank (hex 40) anywhere in the parameter
hexadecimal code point values for normal opera- field indicates the end of the data stream.
tion. Do not use the TRANS option for vertical posi-
tioning.
If you do not want to use the default value for one
or more of the box characters, you can specify a IPDS Transparent Options: Two trans-
different hexadecimal value for that character. parent options, IPTRANS and IHTRANS send an
This value should be greater than hex 40. You IPDS data stream to a printer.
must specify a hexadecimal value for each box
character, even if only one of the hexadecimal The IPTRANS option sends page state commands
values is different from the default values. For to the printer. The IHTRANS option sends home
example, if you do not want the less than (<) char- state commands to the printer.
acter to be used as a box character, you could
specify hex 6C or the percent sign (%), for that The only parameter consists of a data stream of
EBCDIC-coded, 2-character hexadecimal
Appendix D. Intelligent Printer Data Stream (IPDS) Advanced Function Support D-5
numbers, followed by a blank (hex 40) to denote Text Option: You can set the print quality on
the end of the data stream. 4214, 5219, and IPDS printers by using the text
(TEXT) option. Valid values are YES or NO. If
Consider the following when specifying trans- you specify TEXT YES, the printer always prints in
parent options: final quality. If you specify TEXT NO, the printer
The data must be left-justified in the param- setting determines print quality.
eter field; otherwise, you will get return code
For example, suppose that the 4214 printer is set
42. (The specified parameter is not valid.)
for draft quality (using the operator control panel).
The parameter must contain an even number
If you specify TEXT YES, the printer prints in best
of characters.
quality. If you specify TEXT NO, however, the
The data in the parameter field must be in
printer setting determines print quality, so it prints
EBCDIC.
in draft quality.
A blank (hex 40) anywhere in the parameter
field indicates the end of the data stream.
For a 4214 printer that is set to 5, 15, or 16.7 cpi,
Do not request an acknowledgment from the
the printer always prints draft quality, even if you
printer, because there is no facility provided to
have specified TEXT YES. If you want best
handle such acknowledgement, and the
quality, you must specify 10 or 12 cpi.
results are unpredictable.
TEXT NO is not supported on 3812 and 5219
Lines per Inch Option: The lines per inch printers.
(lpi) option lets you set the lines per inch to print.
Valid values are 3, 4, 6, or 8. Quality Option: The quality (QUALITY) option is
similar to the text option, except that it always sets
You must specify a parameter value for this the print quality to the specified value. It does not
option, since there is no default. use the quality setting on the printer operator
panel. It is used with printers that have two or
If you are using cut forms on the 5219 or 4214 more quality levels. The parameters are:
Printer, the lines per page set on the printer OCL
statement in a procedure should correspond with Parameter Description
the lines per inch value. For example, if the form 1 Best quality
length is 11 inches and the lines per inch is 8, 2 Good quality
then the lines per page should be 88. 3 Draft quality
For the best printing results, do not change the Page Rotation Option: The page rotation
lines per inch setting more than once within a (ROTATE) option, used with the 3812 printer,
page. rotates the printed output on the page, or prints a
computer output reduction (COR), which means
For a 5262 printer, the actual number of lines per printing 11 by 14 inch computer output on an 8.5
inch depends on which was set last: the lines per by 11 inch page, rotated 90 degrees. The param-
inch switch on the printer, or the lines per inch eters are:
value in this subroutine. For example, if you set
Parameter Description
lines per inch to 6 in this subroutine but change
0 No rotation
the lines per inch switch to 8, the line spacing will
90 90 degree clockwise rotation
be 8 lpi. The default lines per inch value is not
180 180 degree clockwise rotation
reset for a 5262 printer at the start of the next
270 270 degree clockwise rotation
print job. You must reset it at the end of your
COR Computer output reduction
program.
The ROTATE option overrides the rotation
Print Quality Options: There are two ways selection at the operator’s panel on the printer.
to set print quality on a printer, one is to use the The default for this option is the printer default
TEXT option and the other is to use the QUALITY rotation at the printer control panel.
option.
w=6
The parameters for these options are specified in
80-byte fields, left-justified. The unused bytes
should be blank. When specifying more than one
parameter, separate the parameters with a comma
or one or more blanks. Figure D-3 lists the avail- 11
able options with short descriptions. For more BEGSEG 1.5, 2, 6, 6
detailed information on the options, see the (x, y, w, l) RSLW121-0
Appendix D. Intelligent Printer Data Stream (IPDS) Advanced Function Support D-7
current position for drawing the graphic is located Begin Graphics Area (Segment)
by using the Position (POSITION) option. Option: The begin graphics area (BEGSEG)
option defines the size and location of the area
Once you begin to define a graphic area with the
containing the graphic output. It must be the first
BEGSEG option, only the options listed in
option used. The parameters are:
Figure D-3 on page D-7 should be used until you
have closed the current graphic area with the Parameter Description
ENDSEG option. The BEGSEG option sets the x The distance in inches from the left
printer for printing graphics only. Any attempt to edge of the page to the left edge of
print something else during the time between the graphics area on the page. The
BEGSEG and ENDSEG causes a printer error. default is 0.
The graphics area definition is ended by the
ENDSEG option. y The distance in inches from the top of
the page to the top edge of the
The ENDSEG option causes all the other options graphics area on the page. The
to return to their default value. default is 0.
w The width of the graphics area in
Begin Filled Area Option: The begin filled inches. The default is 8.5 inches.
area (BEGAREA) option defines an area that can
l The length of the graphics area in
be filled with the current shading function, or fill
inches. The default is 11 inches.
pattern. The filled area itself must be drawn by
using the line and circle options.
Consider the following when using the begin
graphics area option:
There are no parameters for this option.
Parameters x, y, w, and l can be specified in
You can draw approximately 36 lines in the filled decimal numbers of any combination of xx.xx,
area specified by BEGAREA and ENDAREA (end where x is any number from 0 through 9.
filled area). You can use a maximum of 221 bytes All xx.xx values should be less than 22.75.
to define the filled area specified by this option If the size of the graphic is larger than the size
and ENDAREA. If you exceed the 221-byte of the page, an error message issues.
maximum while defining the area, or if an The printer may not print graphics that are
ENDAREA or ENDSEG (End graphics area) less than 0.1 inch from the edge of the
option is missing, an error message issues. graphic area or that extend beyond the
graphic area. No error message issues.
Do not use the following options between the
BEGAREA and ENDAREA. If you use these
Character Orientation Option: The set
options within a filled area, you will get an error.
character orientation (CHARORI) option defines
Character orientation (CHARORI) the angle on the page that the characters defined
Character size (CHARSIZE) by the text option are printed. The parameters
Marker (MARKER) are:
Marker type (MARKTYPE)
Parameter Description
Fill pattern type (PATTYPE) (See note)
Text (TEXT) 0 Characters print as normal, across the
page. This is the default.
Note: You must use the PATTYPE option just
prior to the BEGAREA option for the fill area being 90 Characters are rotated 90 degrees
specified. counterclockwise from normal.
180 Characters print upside down across
the page.
270 Characters are rotated 270 degrees
counterclockwise from normal.
Appendix D. Intelligent Printer Data Stream (IPDS) Advanced Function Support D-9
You can specify parameters x and y in decimal Parameter
numbers of any combination of xx.xx, where x is
any number from 0 through 9. CROSS
LDASH (Long Dash) Pattern Type Option: Use the pattern type
(PATTYPE) option to select the fill pattern for
DASHDD (Dash Double Dot) filling the space defined by circle and line options
between a BEGAREA and ENDAREA.
DBLDOT (Double Dot)
The fill patterns are shown in the following figure.
INVIS (Invisible)
Select a parameter value from 1 to 16. The
RSLW123-0
default is 16 (solid).
2 6 10 14
Marker Option: Use the marker (MARKER)
option to print a marker at the current position.
See “Position Option” for more information on the
position option. There are no parameters for this 3 7 11 15
option.
Note: You can use this function only with an Columns 1 through 8, the option name
IPDS printer. Column 9, leave blank
Columns 10 through 89, the parameters
The utility provides two procedures: one for for the option
printing graphics (PRTGRAPH) and one for Note: This utility supports comment records.
building a graphics object file (BLDGRAPH). Place an asterisk (*) in column 1 of the
source records containing the comment.
Print Graphic Procedure: Use the print
libraryname
graphic (PRTGRAPH) procedure to print the form
Is the library name that contains the source
or graphics data by itself.
member. If not specified, only the current
To print the graphics data from a disk file, the library is searched.
format is:
Build Graphics Object File Procedure:
PRTGRAPH prtid,FILE,graphics file name,width
Use the build graphics object file (BLDGRAPH)
prtid procedure to build a graphics object file containing
Is the ID of the IPDS printer to print the form the graphic options and parameters for printing
or graphics file. The default is the current with other data print files.
session printer.
The format for this procedure is:
FILE
BLDGRAPH membername,libraryname,filename
Specifies that the graphics data is in a disk
file.
Appendix D. Intelligent Printer Data Stream (IPDS) Advanced Function Support D-11
membername Note: This utility supports comment records.
Is the name of the library source member that Place an asterisk (*) in column 1 of the source
contains the graphic options and parameters. records containing the comment.
Each record in the source member must be in
the following format: See section “Sample Form” on page D-14 for a
sample source member.
Columns 1 through 8, the option name
Column 9, leave blank
Columns 10 through 89, the parameters Printing Bar Codes
for the option
This bar code function provides two subroutines
libraryname for printing bar codes: SUBR52 for RPG II pro-
Is the library name that contains the source grams and PRTBAR for COBOL programs.
member. If not specified, only the current
library is searched. Note: You can use this function only with an
IPDS printer.
filename
Is the name of the graphics object file to be The options and parameters valid for this function
created. are described in Figure D-6.
Figure D-6 (Page 1 of 2). Valid Options and Parameters for the Bar Code Function
Option Description
BARCODE This option causes the data specified in the parameter field to print as a bar code. The charac-
teristics are set by the BARSIZE, BARTYPE, HRI, and POSITION options. The following param-
eter is available:
Parameter Description
Bar code data The length of the data is from the beginning of the parameter field to the last
nonblank character. There is no default. Data must be specified in the param-
eter field. The BARTYPE option specifies the type of data allowed.
BARSIZE Set bar code size. This option is used to specify the height of the bar code in inches. The
following parameter is available:
Parameter Description
A The height of the bar code in inches. The default is 1 inch. Specify parameter A in
decimal numbers of any combination of xx.xx, where x is any number from 0
through 9.
Appendix D. Intelligent Printer Data Stream (IPDS) Advanced Function Support D-13
LINE 7,5.21
Sample Form POSITION .5,5.ð4
LINE 7,5.ð4
The following is a sample source member that you POSITION .5,4.87
can use with the PRTGRAPH procedure to create LINE 7,4.87
a form: POSITION .5,4.7
LINE 7,4.7
BEGSEG ð,ð,8.5,11
POSITION .5,4.53
CHARSIZE .1ð,.1ð
LINE 7,4.53
\
POSITION .5,4.36
\ DRAW BIG OUTSIDE SQUARE
LINE 7,4.36
\
POSITION .5,4.19
POSITION .5,1.5
LINE 7,4.19
LINE 8,1.5
POSITION .5,4.ð2
LINE 8,1ð.5
LINE 7,4.ð2
LINE .5,1ð.5
POSITION .5,3.85
LINE .5,1.5
LINE 7,3.85
\
POSITION .5,3.68
\ DRAW 2 SQUARES IN UPPER RIGHT CORNER
LINE 7,3.68
\
POSITION .5,3.51
PATTYPE 7
LINE 7,3.51
BEGAREA
POSITION .5,3.34
POSITION 5,9.5
LINE 7,3.34
LINE 7,9.5
POSITION .5,3.17
LINE 7,1ð.25
LINE 7,3.17
LINE 5,1ð.25
POSITION 4.5,2.75
LINE 5,9.5
LINE 6,2.75
ENDAREA
POSITION 4.5,2.44
POSITION 5,8.5
LINE 7,2.44
LINE 7,8.5
\
LINE 7,9.25
\ DRAW REST OF VERTICAL LINES
LINE 5,9.25
\
LINE 5,8.5
POSITION 4.5,6.3
POSITION 5,9
LINE 4.5,2
LINE 7,9
POSITION 5,6.3
\
LINE 5,3
\ DRAW ALL THICK HORIZONTAL LINES
POSITION 6,6.3
\
LINE 6,2
LINEWDTH THICK
POSITION 7,6.3
POSITION .5,6.3
LINE 7,2
LINE 7,6.3
POSITION 5.8ð,5.72
POSITION .5,5.72
LINE 5.8ð,3
LINE 7,5.72
POSITION 6.8ð,5.72
POSITION .5,3
LINE 6.8ð,2
LINE 7,3
\
POSITION 6,2.75
\ ALL TEXT FOR THE FORM FOLLOWS
LINE 7,2.75
\
POSITION 4.5,2
CHARSIZE .2ð,.2ð
LINE 7,2
POSITION 1.5,9.5
\
TEXT Wholesale
\ DRAW REST OF HORIZONTAL LINES
POSITION 1.1,9.35
\
TEXT Tire & Supply
LINEWDTH NORMAL
POSITION 1.65,9.2
POSITION .5,5.55
TEXT Company
LINE 7,5.55
CHARSIZE .1,.1
POSITION .5,5.38
POSITION 1.4,8.7
LINE 7,5.38
TEXT 175 R14 Tire Drive
POSITION .5,5.21
POSITION 1.65,8.55
Appendix D. Intelligent Printer Data Stream (IPDS) Advanced Function Support D-15
10% Discount
On All Orders Over
$500.00
Wholesale
Tire & Supply
Company
Account Number
Bill To:
Subtotal $
Less Discount $
Total $
RSLW002-0
Figure E-1 (Page 1 of 19). Authorities Required for System/36 Procedures on the AS/400 System
System/36 Utilities OS/400 Additional Authorities
Procedure Called Commands Required
#ERR $CPPE/#ERR *USE, to the message files specified on the
USER1 and USER2 keywords of the MEMBER
OCL statement.
*USE, to the library specified on the LIBRARY
keyword on the MEMBER OCL statement.
#FORMAT $SFGR/LOADMBR CRTDSPF, CPYF *ALL, to the display file if it exists and
$SFGR/INOUT and RMVM REPLACE is specified.
$SFGR/DELETE
*CHANGE, to the library to contain the display
$SFGR/END
file.
*USE, to the library containing the QS36SRC
source file.
*USE, to the source file QS36SRC.
AUTOC $UASF/SPOOL CHGS36MSGL *USE, to library #RPGLIB and all objects
$UASC therein.
QEXSETLB
*USE, for message file QRPG2MSGE in library
#RPDD
QSSP.
#AUTO
*USE, to message file #RP#CPL1 and
#RP#CPL2 in library #RPGLIB.
*USE, to the library containing the source
program.
*USE, to the source file QS36SRC in the library
containing the source program.
*CHANGE, to the library to contain the compiled
program.
CATALOG $LABEL/DISPLAY CHKDKT *USE, to the device description and the device
DSPDKT file for the diskette or tape drive, if specified.
CHKTAP
*USE, to the device description and print file for
DSPTAP
the output printer.
DSPLIB
DSPOBJD *USE, to the System/36 files library.
DSPFD *USE, to the file being cataloged.
Note: You must be enrolled in the system dis-
tribution directory to list any folders.
CHNGEMEM $MAINT/CHANGE RNMOBJ *ALL, to the QS36PRC or QS36SRC files if pro-
RNMM cedure or source members are to be renamed.
CHGS36SRCA
*ALL, to any other object to be renamed.
CHGS36PRCA
CHGS36PGMA *CHANGE, to the library that contains the object
to be renamed.
*CHANGE, to the QS36PRC or QS36SRC files
and *USE, to the library, if the subtype or refer-
ence number of a procedure or source member
is to be changed.
Figure E-2 (Page 1 of 3). Authorities Required for System/36 Commands on the AS/400 System
System/36 OS/400
Commands Commands Authorities Required
ASSIGN Not supported
CANCEL
jobname WRKUSRJOB
JOBQ,ALL CLRJOBQ *JOBCTL, if ALL is specified.
PRT DLTSPLF Owner of the spool file.
If printer id, ALL, FORMS, or USER are specified, one of the following
authorities:
*SPLCTL
*JOBCTL and output queue containing spool file is defined OPRCTL
(*YES).
*READ, *ADD and *DTL authority to the output queue containing the
spool file and the queue is defined AUTCHK(*DTAAUT).
Owner of the output queue containing the spool file and the queue
is defined AUTCHK(*OWNER).
SESSION WRKUSRJOB
CHANGE
COPIES CHGSPLFA See CANCEL PRT command.
DEFER CHGSPLFA
FORMS CHGSPLFA See CANCEL PRT command.
ID CHGSPLFA See CANCEL PRT command.
JOBQ WRKJOBQ *JOBCTL
JOBS CHGJOBQE *JOBCTL
PRT CHGSPLFA *JOBCTL
PRTY CHGJOB *JOBCTL
SEP CHGWTR *JOBCTL
See CANCEL PRT command.
CONSOLE CHGMSGQ *USE and *DELETE, to the message queue
*READ, to the library containing the message queue.
HOLD
JOBQ WRKJOBQ
PRT HLDSPLF *JOBCTL and output queue containing spool file entry is
defined OPRCTL (*YES), if parameter ALL is specified.
INFOMSG
JOBQ SBMJOB *USE, to job queue QBATCH in library QGPL.
MENU GO *USE, to menu.
*USE, to library, if specified.
MODE Not supported.
Figure E-3 (Page 1 of 3). Authorities Required for System/36 OCL Statements on the AS/400 System
OCL OS/400
Statements Commands Authorities Required
ABEND
ALLOCATE ALCOBJ *USE, for the device description of the allocated device.
ASSIGN Supported for compatibility only.
ATTR *CHANGE, for job queue QS36EVOKE in library QGPL.
RELEASE-YES
CANCEL DLTSPLF Owner of spool file. If printer id, ALL, FORMS or USER are specified, one
of the following authorities:
1. *SPLCTL
2. *JOBCTL and output queue containing spool file is defined
OPRCTL(*YES).
3. *READ, *ADD and *DLT authority to the output queue containing the
spool file and the queue is defined AUTCHK(*DTAAUT).
4. Owner of the output queue containing the spool file and the queue is
defined AUTCHK(*OWNER).
CHANGE Owner of the spool file. If printer id, ALL, FORMS or USER are specified,
COPIES CHGSPLFA one of the following authorities:
FORMS CHGSPLFA
1. *SPLCTL
ID CHGSPLFA
2. *JOBCTL and output queue containing spool file is defined
OPRCTL(*YES).
3. *READ, *ADD and *DLT authority to the output queue containing the
spool file and the queue is defined AUTCHK(*DTAAUT).
4. Owner of the output queue containing the spool file and the queue is
defined AUTCHK(*OWNER).
COMM Not supported.
Figure E-4 (Page 1 of 3). Authorities Required for OS/400 Commands in the System/36 Environment
OS/400
Command Referenced Object Authorities Required to Referenced Object
CHGS36 Configuration object QS36ENV *CHANGE, to configuration object QS36ENV
Library #LIBRARY *USE, to Library #LIBRARY
CHGS36A Configuration object QS36ENV *CHANGE, to configuration object QS36ENV
Library #LIBRARY *USE, to Library #LIBRARY
CHGS36PGMA Program *OBJMGT, to the program
Library *USE, to the library
CHGS36PRCA Source file QS36PRC *CHANGE, to source file QS36PRC
Source file library *USE, to source file library
CHGS36SRCA Source file QS36SRC *CHANGE, to source file QS36SRC
Source file library *USE, to source file library
CRTMSGFMNU Message file with command messages *USE, to message file with command messages
Message file library *USE, to message file library
Message file with option messages *USE, to message file with option messages
Message file library *USE, to message file library
Source file QS36DDSSRC *ALL, to source file QS36DDSSRC
Source file library *USE, to source file library
Source file if TOMBR not *NONE *ALL, to source file if TOMBR is not *NONE
Source file library *CHANGE, to source file library
Display file if it already exists *ALL, to display file if it already exists
Display file library *CHANGE, to display file library
CRTDSPF command *USE, to CRTDSPF command
CRTS36CBL Library #COBLIB and its contents *USE, to library #COBLIB and its contents
Source file with COBOL source *USE, to source file with COBOL source
Source file library *USE, to source file library
Program if it already exists *ALL, to the program if it already exists
Program library *CHANGE, to the program library
CRTS36DSPF Source file with SFGR source *USE, to source file with SFGR source
Source file library *USE, to source file library
Source file QS36DDSSRC *ALL, to source file QS36DDSSRC
Source file library *USE, to source file library
Source file if TOMBR not *NONE *ALL, to source file
Source file library *CHANGE, to source file library
Display file if it already exists *ALL, to the display file if it already exists
Display file library *CHANGE, to display file library
CRTDSPF command *USE, to CRTDSPF command
CRTS36MNU Source file with command text *USE, to source file with command text
Source file library *USE, to source file library
Source file with option text *USE, to source file with option text
Source file QS36DDSSRC *ALL, to source file QS36DDSSRC
Source file if TOMBR not *NONE *ALL, to source file
Source file library *CHANGE, to source file library
Display file if it already exists *ALL, to display file if it already exists
Display file library *CHANGE, to display file library
Message file if it already exists *ALL, to message file if it already exists
Message file library *CHANGE, to message file library
CRTDSPF command *USE, to CRTDSPF command
CRTMSGF command *USE, to CRTMSGF command
ADDMSGD command *USE, to ADDMSGD command
Bibliography H-3
H-4 OS/400 System/36 Environment Programming V3R6
Index
APPC
Special Characters See advanced program-to-program communication
// IF LOAD 6-9 APPN
// IF SUBR 6-9 See advanced peer-to-peer networking
$SFGR ARCHIVE procedure 8-2
See screen format generator AS/400 CL commands in the System/36 environment
*NONE 2-1 error handling 17-3, 17-4
*S36 2-1, 3-2 in procedures
*SYSVAL 2-1 special characters 17-3
#$@INCLGRPH C-1 substitution expressions 17-4
#LIBRARY 5-4, 6-1 syntax 17-3
used interactively 17-2
AS/400 system
Numerics Client Access/400 1-5
3270 device emulation 3-2
device identification 3-3
general environment values 3-9
A ICF files 13-17
library QSSP 5-3
abnormal ending 18-6
ACCEPT statement 13-24 objects 5-1
access algorithms office
choosing A-1 tasks 1-4
defining A-2 word processing 1-4
direct files A-1 program start request errors 13-11
examples A-2 programming languages 1-5
handling synonym records A-1 securing files 7-3
indexed file with keys A-4 subsystem considerations 13-7
randomizing techniques A-6 System library (QSYS) 6-1
accessing folders 8-1 ASP
ACQUIRE statement 13-24 See auxiliary storage pool
acquired session 13-37 assigning libraries 6-3
Add Authority List Entry (ADDAUTLE) asynchronous communications 13-34
command 11-7 attention key 2-5
ADDAUTLE ATTR OCL statement 2-4
See Add Authority List Entry command attributes
addressing 5-1 special environment (SPCENV) 2-1
advanced peer-to-peer networking (APPN) 13-4 values 2-1
advanced program-to-program communication audit (AUDIT) 11-4
(APPC) authority
definition 13-4 all object (*ALLOBJ) 11-3
ICF support 13-16 assigning 11-2
mapping 13-19 audit (AUDIT) 11-4
output support 13-45 data 11-5
procedures 13-4 defined 11-3
programming considerations 13-45 files 7-3
reason codes 13-11 holders 11-7
System/36 to AS/400 13-40, 13-41 input/output system configuration (IOSYSCFG) 11-4
using SESSION OCL statement 13-19 job control (*JOBCTL) 11-3
all object special authority 11-3 lists 11-7
ALLOCATE OCL statement 9-6, 10-5 object 11-5
alphanumeric fields 12-5 public 11-7
alternative indexed files 7-9, 7-12 save system (*SAVSYS) 11-3
security administrator 11-3
Index X-3
commands (continued) communications (continued)
RSTS36F (Restore System/36 File) 2-6 intrasystem communications 13-16, 13-39
RSTS36FLR (Restore System/36 Folder) 2-6, 8-3 line description 13-5
RSTS36LIBM (Restore System/36 Library override commands 13-44
Member) 2-6, 6-10 OVRICFDEVE command 13-18
RTVS36A (Retrieve System/36 Environment Attri- procedures examples 13-2
butes) 2-6 program start request errors 13-11
SAVDLO (Save Document Library Object) 8-2 QICDMF file 13-17
SAVLIB (Save Library) 6-3 receiving objects 13-47, 13-48
SAVOBJ (Save Object) 6-3 resource name 13-6
SAVS36F (Save System/36 File) 2-6, 9-7 retail 13-39
SAVS36LIBM (Save System/36 Library return codes 13-28, 13-30
Member) 2-6 sending objects 13-47
SBMJOB (Submit Job) 2-3 SESSION OCL statement 13-18
SETATNPGM (Set Attention Program) 2-5 SNA distribution services (SNADS) 13-46
SIGNOFF 2-4 SNA upline facility (SNUF) 13-16, 13-41, 13-42
START PRT 4-6, 4-7 subsystems 13-15
STATUS 4-5 testing applications 13-28
STATUS SESSION 4-2 VRYCFG hierarchy/example 13-6
STATUSF 4-5 compress, definition 9-3
STOP PRT 4-6 computer output reduction (COR) D-6
STRS36 (Start System/36) 2-1, 2-2, 2-6, 11-11 configuration menus 3-4
STRS36PRC (Start System/36 Procedure) 2-2, 2-6, configuring
11-11 asynchronous considerations 13-34
STRSEU (Start Source Entry Utility) 6-2 communications environment 13-1
WRKOBJLCK (Work Object Lock) 6-5 consecutive processing method 7-14
WRKS36 (Work with System/36 Configuration) 2-6 console, definition 2-3
WRKS36 (Work with System/36 Environment CONTINUE parameter 4-8, 17-11, 17-12
command) 3-13 control command, definition 1-1
WRKS36PGMA (Work with System/36 Program Attri- control language commands
butes) 2-6 See commands
WRKS36PRCA (Work with System/36 Procedure control language, definition 1-1
Attributes) 2-6 controlling print spooling 4-4
WRKS36SRCA (Work with System/36 Source Attri- Copy from Diskette (CPYFRMDKT) command 9-7
butes) 2-7 Copy to Diskette (CPYTODKT) command 9-7
communications COPYDATA procedure 7-1, 7-3, 7-24
APPC (advanced program-to-program communica- copying files 7-3
tions) 13-16, 13-40 copying information 9-4
asynchronous 13-16, 13-31, 13-34 copying libraries 6-7
autodial and telephone number list support 13-45 COPYPRT procedure 4-6, 4-7
BSC/CICS 13-41 cpi
BSC/IMS 13-42 See characters per inch
BSCEL 13-36, 13-37 CPYFRMDKT
configuring environment 13-1 See Copy from Diskette command
controller description 13-5 CPYTODKT
debugging 13-30 See Copy to Diskette command
ENABLE hierarchy/example 13-6 Create Authority List (CRTAUTL) command 11-7
file transfer 13-30, 13-31, 13-33 Create Device Printer (CRTDEVPRT) command 2-3
files 17-12 Create System/36 COBOL Program (CRTS36CBL)
finance communications 13-16, 13-38 command 2-5
ICF Create System/36 Display File (CRTS36DSPF)
COBOL 13-24 command 2-5
files 13-17 Create System/36 Menu (CRTS36MNU)
IDDU data dictionaries 13-27 command 2-5
operations 13-20 Create System/36 Message File CRTS36MSGF
RPG II 13-23 command 2-5
system-supplied formats 13-25
Index X-5
disk (continued) display (continued)
preparing 9-4 public authority 14-23
removing a file from 7-3 self-check digits 14-17
restoring 9-7 station device error considerations 19-8
space 7-21 suppressing input 14-13
storage 1-2, 5-1 system operator 15-9
system information 5-3 work station 15-8
types and storage capacities 9-1 display IDs
types of files 9-2 removing 3-14
user information 5-4 Display Job Log (DSPJOBLOG) command 16-28
diskette Display Message (DSPMSG) command 2-4
exchange formats Display Object Authority (DSPOBJAUT)
basic data 9-1 command 11-5
H-data 9-2 Display System Value (DSPSYSVAL) command 2-1
I-data 9-2 Display System/36 (DSPS36) command 3-2
files 9-2 displays
I/O device 17-14 Change S/36 Diskette IDs 3-7
information Change S/36 Display IDs 3-5
copying 9-4 Change S/36 Environment Configuration 3-5
listing 9-5 Change S/36 Environment Values 3-9
removing 9-6 Change S/36 MRT Security and Performance 3-11
restoring 9-5 Change S/36 Printer IDs 3-6
saving 9-5 Change S/36 Tape IDs 3-7
storing 9-2 Change System/36 3270 Device Emulation
DISP-NEW keyword 5-5 Values 3-8
DISP-NEW parameter 7-1 Display System/36 Environment Configuration 3-13
display DLTOVR
adjacent-form 14-14 See Delete Override command
attributes 14-12 document, definition 1-2
code-link form 14-15 double-byte character set (DBCS) support 20-3
color or highlighting 14-15 downloading forms and box characters D-4
control (S) specifications B-1 drawer selection (DRAWER) option D-4
copying output from output queue 4-6 DROP statement 13-25
creating formats 14-17 DSPJOBLOG
data management 14-10, 14-12 See Display Job Log command
data types 14-11 DSPMSG
description 1-3, 14-10 See Display Message command
designing 14-13 DSPOJBAUT
enhancements 14-25 See Display Object Authority command
erase input fields operation 14-12 DSPS36
files 7-4, 14-26, 17-12 See Display System/36 command
fixed-form 14-14 DSPSYSVAL
FORMAT procedure 14-18 See Display System Value command
formats dual-routed messages 15-13
programming languages 14-19 DUPKEY parameter 7-11
with COBOL 14-19 duplicate keys 7-11
with RPG II 14-19
within a procedure 14-20
free-form 14-14 E
input operations and fields 14-11 Edit Object Authority (EDTOBJAUT) command 11-5
maximum number of devices 14-23 Edit System/36 Procedure Attributes (EDTS36PRCA)
menu-form 14-14 command 2-6
multiple formats 14-15 Edit System/36 Program Attributes (EDTS36PGMA)
online help information 14-18 command 2-6
output operations and fields 14-11 Edit System/36 Source Attributes (EDTS36SRCA)
overriding fields 14-13 command 2-6
Index X-7
files (continued) files (continued)
displaying 7-4 record sharing protection 7-28
dynamically created 5-5 record-mode 6-6
EXCHANGE 10-2 relative record number 7-7
exchanging with other systems 10-3 releasing locked records 7-29
expiration dates 9-3, 10-3 remote 7-38
extendable 7-23 removing 7-3
extending 7-35 renaming 7-3
externally-described 17-10 resident 7-21
group 7-2 restoring multiple-index 7-11
indexed 7-5, 7-14, 7-17 Save/Restore 10-3
job 7-21 SAVEFLDR 10-3
label definition 7-1 SAVELIBR 10-3
library 5-2, 7-31 saving multiple-index 7-10
library QSSP 5-3 scratch 7-21
LIBRFILE 10-2 searching 6-10
loading program 7-5 sector-mode 6-5
locked records 7-29 securing 7-3
logical 7-9 sequential 7-5, 7-14, 7-17
master 7-19 sharing
members 7-34 considerations 7-26
multiple file libraries 7-31 deadlock conditions 7-29
multiple indexes 7-9, 7-10 levels 7-26, 7-36
multiple names 7-30 record protection 7-28
naming conventions 5-4, 7-1 releasing locked records 7-29
organization WAIT parameter 7-28
activity 7-20 waiting for files to become available 7-27
application 7-20 within the same job 7-37
choosing 7-19 specifying in a program 7-3
description 7-5 storage 5-1, 7-4
direct 7-5, 7-7 synonym records 7-8
disk space 7-21 transaction 7-19
indexed 7-5, 7-8 use 7-19
master 7-19 user 5-4
processing 7-20 fill pattern D-10
sequential 7-5 fill pattern, definition D-8
transaction 7-19 finance communications support 13-38
physical 7-9 first-level message, definition 15-1
placing data in 7-3 fixed-form displays 14-14
printing 7-4 fixed-form menu 14-3
processing flag parameter 14-21
consecutive method 7-14 FLIB procedure
current record pointer 7-12 See File Library (FLIB) procedure
generalized method 7-17 floating-point format 12-5
in System/36 environment 17-8 folders
keyed 7-13 accessing 8-1
methods 7-13 coexistence considerations 8-3
nonkeyed 7-13 creating 8-1
programming considerations 7-31 deleting 8-1
random by key 7-17 description 8-1
random by relative record number 7-16 listing information 8-1
sequential by key 7-15 members 8-1
with deleted records 7-25 migration considerations 8-1, 8-3
with duplicate keys 7-12 naming conventions 5-4
program-described 7-33, 17-10 programming considerations 8-2
record blocking 7-25 removing 8-1
Index X-9
interactive programs, definition 16-1 jobs (continued)
intersystem communications function (ICF) preventing (continued)
additional considerations 13-30 interruption 18-13
APPC (advanced program-to-program communica- procedure control expressions 18-4
tions) 13-16 processing 18-1
asynchronous communications 13-16 processing OCL statements 18-4
BSCEL 13-16 queue
COBOL statements for communications 13-24 changing priority levels 18-9
communications operations 13-20 definition 18-8
debugging programs 13-30 priority 18-8, 18-10
definition 2-3 processing priorities 18-9
description 13-16 running jobs later 18-11
finance communications 13-16 types 18-8
IDDU data dictionaries 13-27 unattended system operation 18-12
intrasystem communications 13-16 using 18-8
mapping SESSION OCL to OVRICFDEVE 13-18 WAIT OCL statement 18-11
OS/400 files 13-17 running
QICDMF File 13-17 during initial program load (IPL) 18-13
retail communications 13-16 without operators 18-14
return codes 13-28 scheduling 18-7
RPG II 13-23 security classification 18-12
SNA upline facility (SNUF) 13-16 starting 18-1, 18-4
system-supplied formats 13-25 submitting to run later 18-11
testing applications 13-28 system input processing example 18-5
tying application to configuration 13-17 using 18-1
intrasystem communications journal files 5-4
APPC 13-45
programming considerations 13-39, 13-45
using CL override commands 13-44 K
IPDS key
See intelligent printer data stream attention 2-5
IPTRANS D-5 definition 12-5
duplicate
checking for 7-12
J processing a file 7-12
job control (*JOBCTL) 11-3 sequence 7-12
JOB-YES parameter 7-23 sorting 7-38
jobs specifying 7-11
command processor 18-2 function differences 14-1
concepts 18-1 index 7-11
date 18-14 random processing 7-17
definition 1-3 sequential processing 7-15
description 18-2 system request 2-4
end-of-day processing 18-14 using 7-11, 12-6
ending keyed processing 7-13
abnormal 18-6 KEYSORT procedure 7-38
description 18-6
function 18-6
normal 18-6 L
evoking other jobs 18-11 LABEL parameter 7-2
job priorities 18-7 LDA
job steps 1-3, 18-1 See local data area (LDA)
library 6-3 LEAVE parameter for tape files 10-5
managing 18-7 libraries
preventing application 6-1
cancellation 18-13 assigning 6-3
informational messages from appearing 18-13
Index X-11
local data area (LDA) 16-13 message members (continued)
LOG OCL statement 16-28 programming guidelines 15-14
logical unit, definition 13-2 required parameters 15-17
severity levels 15-14
uses 15-1
M with displays 15-17
magnetic tape storage 1-2 with programs 15-17
managing jobs 18-7 within a procedure 15-15
mantissa, definition 12-5 messages
MARKER option D-10 automatic reply handling 15-13
marker type (MARKTYPE) option D-10 changing 15-3
MARKTYPE command text file 14-7
See marker type option concepts 15-1
mathematical symbols D-4 console 15-13
MAXDEV attribute 14-23, 14-26, 16-29 converting text 15-4
MAXPGMDEV attribute 16-29 creating 15-2
menus default responses 15-5, 15-7
BLDMENU procedure 1-3, 14-7 displaying 15-8
chaining 14-5 dual-routed 15-13
color or highlighting 14-9 embedding 15-10
command text message file 14-7 enhancements 15-13
configuration 3-4 file considerations 15-15
creating and changing 14-7 files 15-2
description 14-1 formatting with control characters 15-9
designing 14-4 from procedures 15-16
differences handling 2-3, 15-11
from System/36 14-2 handling defaults 15-11
help 14-3 identification 13-33
user 14-3 inserting variable data 15-3
display file 14-7 nondisplayed errors 15-12
fixed-form 14-3 problems 15-12
form displays 14-14 prompting 15-8
formats 14-3 restrictions 15-13
free-form 14-4 sending 15-9, 15-11
function key processing 14-1 severity levels 15-5
online help information 14-7 types 15-1
screen design aid (SDA) 14-7 with displays 15-17
security 11-4, 14-3 with programs 15-17
system request 2-4, 18-6 work station displays 15-8
user 14-2 mixed mode applications
merging graphics and text architectural restrictions 17-1
description C-1 AS/400 application in a System/36 environment
examples C-1 job 17-10
printer storage limitations C-3 AS/400 program followed by a System/36
printing a graphics file along with other output C-2 program 17-9
printing a graphics file only C-1 definition 17-1
programming considerations C-3 file processing
message members communications 17-12
application design 15-2 database 17-8
concepts 15-1 display 17-12
creating or changing source 15-14 externally-described 17-10
default responses 15-14 printer 17-11
definition 1-3 program-described 17-10
displaying from procedures 15-16 program control 17-5
file considerations 15-15 System/36 program followed by a System/36
migrating 15-17 program 17-10
Index X-13
parameters (continued) printer control guidelines (continued)
DISP-NEW 7-1 description 4-4
DUPKEY 7-11 printer data management 1-1, 4-1
EXTEND 7-23 printer files
FORMAT 9-1 attribute processing 17-11
FORMAT2 9-1 CONTINUE-YES processing 17-11
HALT 14-24 naming conventions 17-12
JOB-YES 7-23 open time processing 17-11
LABEL 7-2 PRINTER OCL statement 4-1, 4-8
LEAVE 10-5 PRINTKEY procedure 4-5
NAME 7-2 priority, definition 18-7
NUMBER 14-24 procedure member, definition 6-2
PRT 4-5 procedure members, definition 6-2
RETAIN-S 7-10 procedures
REWIND 10-5 // IF 6-9
RPG II printer D-1 ARCHIVE 8-2
SPCENV 2-1, 3-1 attributes 16-21
UNLOAD 10-5 BLDFILE (Build File) 7-1, 7-23
WAIT 7-28 BLDGRAPH (Build Graphics Object File) D-11
parent-child concept 11-11 BLDINDEX 7-9
pattern type (PATTYPE) option D-10 BLDLIBR (Build Library) 6-6
PATTYPE BLDMENU (Build Menu) 1-3, 14-7
See pattern type option calling 16-22, 16-23, 16-29
PDM CATALOG 5-5, 8-1, 10-5
See programming development manager changing printer information 4-5
POSITION option D-10 CHNGEMEM (Change Member) 6-7
positional parameter, definition 13-1 commands 2-5
print file, definition 4-7 concepts 16-21
Print Graphic (PRTGRAPH) procedure D-11 controlling 16-27
print graphics subroutines D-7 COPYDATA 7-1, 7-3, 7-24
print spooling COPYPRT 4-6, 4-7
commands 4-5 creating and changing 16-27
controlling 4-5 debugging 16-28
description 4-3 DELETE 7-2, 8-1
printed output description 1-3
assigning priorities 4-8 designing 16-1, 16-26
attributes 4-9 FLIB (File Library) 5-2, 6-10, 7-1
combining files 4-7 FORMAT 1-3, 14-18
controlling or displaying print spooling 4-3, 4-4, 4-5 FROMLIBR 9-7
creating and controlling 4-1 functions 16-22
data management 4-1 IDDUDCT 8-2
delayed status 4-8 IDDUDFN 8-2
forms number 4-7 IDDUDISK 8-2
printer control guidelines 4-4 IDDULINK 8-2
procedures 4-1 IDDUPRT 8-2
spool writer messages 4-4 INIT 2-4, 9-1
system list 4-3 job log processing 16-28
using output queues 4-3 KEYSORT 7-38
printer control guidelines LIBRLIBR (Library to Library) 6-7
change List File (LISTFILE) 7-4
Print key printer 4-5 LISTDATA 7-4
printer configuration information 4-5 LISTFILE (List File) 6-6
printer information in a procedure 4-5 listing 16-27
session printer 4-4 LISTLIBR (List Library) 6-6
system list device 4-5 members 1-3, 6-2, 16-22
system printer 4-5 migration utility 16-29
Index X-15
QSSP 6-1 RENAME procedure 7-3, 8-1
QSSP library 5-3 renaming a folder 8-1
QTEMP 7-31 renaming libraries 6-7
QUALITY option D-6 Reorganize Document Library Object (RGZDLO)
Query 1-4 command 8-2
resource ownership 11-8
RESTART PRT command 4-6
R RESTLIBR
random processing 7-16 See Restore Library procedure
randomizing techniques A-6 Restore Document Library Object (RSTDLO)
RCLSTG command 8-2
See Reclaim Storage command Restore Library (RESTLIBR) procedure 6-3, 6-4
READ statement 13-25 RESTORE procedure 7-1, 7-2, 7-3, 7-11
read-under-format (RUF) technique Restore System/36 File (RSTS36F) command 2-6
external calls 17-12 Restore System/36 Folder (RSTS36FLR)
programming considerations 16-12 command 2-6, 8-3
using 14-20 Restore System/36 Library Member (RSTS36LIBM)
with AS/400 programs 17-13 command 2-6, 6-10
Reclaim Storage (RCLSTG) command 6-4 restoring information 9-5
record blocking restoring multiple-index files 7-11
blocking factors 7-26 restoring the AS/400 System to System/36 9-7
DBLOCK value 7-26 retail communications support 13-39
sharing files 7-26 RETAIN-S parameter 7-10
record-mode files 6-6 RETRIEVE procedure 8-2
records Retrieve System/36 Attributes (RTVS36A) 3-2
deletion of records 12-6 Retrieve System/36 Environment Attributes
description 12-1 (RTVS36A) command 2-6
fields REWIND parameter for tape files 10-5
alphanumeric 12-5 RMVAUTLE
naming 12-1 See Remove Authority List Entry command
new 12-6 ROTATE
numeric 12-1 See page rotation option
required 12-1 RSTDLO
size 12-6 See Restore Document Library Object command
format RSTS36F
binary 12-4 See Restore System/36 File command
floating-point 12-5 RSTS36FLR
packed decimal 12-3 See Restore System/36 Folder command
zoned decimal 12-2 RSTS36LIBM
keys 12-5 See Restore System/36 Library Member command
layout 12-6 RUF
length 12-6 See read-under-format (RUF) technique
menus 14-4 RUN OCL statement 17-5, 17-6
related printed information H-1 run priority, description 18-10
relative record number 7-7
RELEASE PRT command 4-6
remote files 7-38 S
remote location name 13-1 S-Spec
Remove Authority List Entry (RMVAUTLE) 132-column format B-7
command 11-7 alarm B-3
removing blink cursor B-4
a folder 8-1 command keys B-4
display IDs 3-14 comment B-1
information from diskette 9-6 erase input fields B-4
libraries 6-7 format name B-1
function keys B-3
Index X-17
sharing files 7-26 statements (continued)
sharing libraries 6-3 SESSION OCL 13-18
sign-on library 6-3 WAIT OCL 18-11, 19-3
SIGNOFF command 2-4 WORKSTN OCL 4-5
single requester terminal program, definition 16-2 WRITE 13-25
SNA STATUS command 4-5
See Systems Network Architecture (SNA) STATUS SESSION command 4-2
SNA distribution services (SNADS) 13-46 STATUSF command 4-5
SNA upline facility (SNUF) 13-41 STOP PRT command 4-6
SNADS STRS36
See SNA distribution services See Start System/36 command
SNUF STRS36PRC
See SNA upline facility (SNUF) See Start System/36 Procedure command
Source Entry Utility (SEU) procedure 1-4, 6-2 STRSEU
source file, definition 6-2 See Start Source Entry Utility command
source members, definition 6-2 subconsoles 2-3
SPCENV Submit Job (SBMJOB) command 2-3
See special environment (SPCENV) parameter SUBR50 D-1, D-2
special characters 12-5, 17-3 SUBR51 D-1, D-7
special environment (SPCENV) parameter 2-1, 3-1 SUBR52 D-1, D-12
special user authority 11-2 subroutine members, definition 6-2
specifications subroutines
display control (S) B-1 COBOL D-1, D-2
field definition (D) B-13 printing graphics D-7
help definition (H) B-8 PRTAPI D-1, D-2
SPLCTL PRTBAR D-1, D-12
See spool control PRTGRC D-1, D-7
spool control (SPLCTL) 11-4 RPG II D-2
spool files 4-3 SUBR50 D-1, D-2
spool writer messages 4-4 SUBR51 D-1, D-7
spooling, print 4-3 SUBR52 D-1, D-12
SRT 16-2 substitution expressions 17-4
START PRT command 4-6, 4-7 subsystem, definition 2-1
Start Source Entry Utility (STRSEU) command 6-2 synonym records 7-8, A-1
Start System/36 (STRS36) command 2-1, 2-2, 2-6, SYSLIST
11-11 See System List procedure
Start System/36 (STRS36PRC) procedure 2-6 system
Start System/36 Procedure (STRS36PRC) date, definition 7-2
command 2-2, 11-11 library, definition 5-2
statements list device, definition 4-3
ACCEPT 13-24 list output 4-3
ACQUIRE 13-24 program, definition 2-3
ALLOCATE OCL 9-6, 10-5 request menu 2-4, 16-6, 16-11, 18-6
ATTR OCL 2-4 security 11-1
CALL 17-8 System List (SYSLIST) procedure 4-5
DEALLOC OCL 9-6, 10-5 system printer, changing 4-5
DEBUG 16-28 System Request menu 2-4, 16-6, 16-11, 18-6
DROP 13-25 system-defined authority
FILE OCL 7-1, 19-3 All (*ALL) 11-6
FILELIB OCL 6-10, 7-1, 7-31 Change (*CHANGE) 11-6
LIBRARY OCL 6-4 Exclude (*EXCLUDE) 11-6
LOAD OCL 17-5 Use (*USE) 11-6
LOG OCL 16-28 system-supplied formats 13-25
PRINTER OCL 4-1, 4-8 System/36 application, definition 17-1
READ 13-25 System/36 environment
RUN OCL 17-5, 17-6 access levels 11-8
Index X-19
tape (continued)
files U
COPYFILE 10-2 UNLOAD parameter for tape files 10-5
EXCHANGE 10-2 UPSI
exchanging with other systems 10-3 See user program status indicator switch
expiration dates 10-3 user
LIBRFILE 10-2 class 11-2
Save/Restore 10-3 files 5-4
SAVEFLDR 10-3 folders 5-4
SAVELIBR 10-3 libraries 5-4
formats profile attribute 2-1
IBM standard label 10-1 profiles 11-2
nonlabeled 10-2 user program status indicator switch 16-22
header labels 10-1
I/O device 17-14
LEAVE processing 10-5
V
values
listing information 10-7
changing 3-9
marks (TM) 10-1
QSPCENV 2-1, 3-1
preparing 10-5
system 3-1
programming considerations 10-4
virtual circuit, definition 13-5
removing information 10-7
virtual printer support 1-5
restoring information 10-7
VTAM 13-41
REWIND processing 10-5
saving information 10-6
securing read/write access 10-4 W
security WAIT OCL statement 18-11, 19-3
access 10-4 WAIT parameter 7-28
other systems 10-4 word processing 1-4
read/write access 10-4 work file, definition 6-4
write access 10-4 Work Object Lock (WRKOBJLCK) command 6-5
storage 10-1 work station id, definition 2-3
trailer labels 10-1 work station, definition 1-1
UNLOAD processing 10-5 Work with System/36 Configuration (WRKS36)
using multiple drives 10-7 command 2-6, 3-2
volume label 10-1 Work with System/36 Procedure Attributes
TAPECOPY procedure 7-1, 7-3 (WRKS36PRCA) 2-6
TAPEINIT procedure 10-5 Work with System/36 Program Attributes
telephone number list support 13-45 (WRKS36PGMA) 2-6
TESTFLDR procedure 8-2 Work with System/36 Source Attributes
testing communications applications 13-28 (WRKS36SRCA) 2-7
Text (TEXT) option D-11 WORKSTN OCL statement 4-5
TEXT option D-6 WRITE statement 13-25
text rotation D-6 WRKOBJLCK
TEXTDOC procedure 8-1 See Work Object Lock command
TEXTFLDR procedure 8-1
To Library (TOLIBR) procedure 6-4, 9-7
TOLIBR X
See To Library procedure X.21 13-46
TRANS X.25 13-5
See transparent option
TRANSFER procedure 7-1, 7-3, 9-2, 9-7
transparent (TRANS) option D-5
Very
Very Dissatis-
Satisfied Dissatis-
Satisfied fied
fied
Overall satisfaction
How satisfied are you that the information in this manual is:
Accurate
Complete
Easy to find
Easy to understand
Well organized
Applicable to your tasks
THANK YOU!
Note that IBM may use or distribute the responses to this form without obligation.
Name Address
Company or Organization
Phone No.
Cut or Fold
Reader Comments—We'd Like to Hear from You! Along Line
SC41-4730-00
IBM
NO POSTAGE
NECESSARY
IF MAILED IN THE
UNITED STATES
Cut or Fold
SC41-4730-00 Along Line
IBM
SC41-473ð-ðð
Spine information:
IBM AS/400 Advanced Series System/36 Environment Programming Version 3