HP RPG/iX Reference Manual : COPYRIGHT NOTICE [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation
HP RPG/iX Reference Manual
HP RPG/iX Reference Manual
Printed in U.S.A.
900 Series HP 3000 Computers
HP Part No. 30318-90003
Edition E1193
NOTICE
The information contained in this document is subject to change without
notice.
HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS
MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard
shall not be liable for errors contained herein or for incidental or
consequential damages in connection with the furnishing, performance or
use of this material.
Hewlett-Packard assumes no responsibility for the use or reliability of
its software on equipment that is not furnished by Hewlett-Packard.
This document contains proprietary information which is protected by
copyright. All rights are reserved. No part of this document may be
photocopied, reproduced or translated to another language without the
prior written consent of Hewlett-Packard Company.
Copyright (c) 1993 by HEWLETT-PACKARD COMPANY
Printed 1993
Printing History
New editions are complete revisions of the manual. Update packages,
which are issued between editions, contain additional and replacement
pages to be merged into the manual by the customer. The dates on the
title page change only when a new edition or a new update is published.
No information is incorporated into a reprinting unless it appears as a
prior update; the edition does not change when an update is incorporated.
The software code printed alongside the date indicates the version level
of the software product at the time the manual or update was issued.
Many product updates and fixes do not require manual changes and,
conversely, manual corrections may be done without accompanying product
changes. Therefore, do not expect a one-to-one correspondence between
product updates and manual updates.
First Edition December 1988 30318A.00.00
Second Edition October 1989 30318A.00.04
Third Edition November 1993 30318A.00.10
Preface
The HP RPG/iX Reference Manual explains all of the language features of
RPG. It is written in a reference style, assuming the reader is familiar
with RPG.
This manual is directed to experienced RPG programmers, who may or may
not be familiar with Hewlett-Packard computers. The manual discusses the
language features available with the MPE iX operating system.
This manual is organized as follows:
Chapter 1 Explains the general steps involved in writing and
testing an RPG program.
Chapter 2 Describes the fields that are used in all RPG
Specifications.
Chapter 3 Describes the fields in the Header Specification.
Chapter 4 Describes the fields in the File Description
Specification.
Chapter 5 Describes the fields in the File Extension
Specification.
Chapter 6 Describes the fields in the Line Counter
Specification.
Chapter 7 Describes the fields in the Input Specification.
Chapter 8 Describes the fields in the Calculation
Specification.
Chapter 9 Describes the fields in the Output Specification.
Chapter 10 Explains how to use VPLUS with RPG. VPLUS is a forms
management product that lets you create screens and
process them in an RPG program.
Chapter 11 Explains how to use the RPG Screen Interface (RSI) in
an RPG program. RSI is a forms management facility
unique to RPG. You can use it to create and process
screen forms in an RPG program.
Chapter 12 Discusses the RPG compiler and compiler subsystem
commands.
Appendix A Lists the RPG compiler messages.
Appendix B Lists the run-time error messages.
Appendix C Lists the ASCII and EBCDIC character sets.
Related Documentation
Refer to the following documents for further information on features
available in the RPG programming language:
HP RPG/iX Programmer's Guide (30318-90001) - This manual describes
how to use the RPG language elements to contruct an RPG program.
This manual contains many examples and programs.
HP RPG/iX Utilities Reference Manual (30318-90006) - This manual
explains how to use these RPG utilities: XSORT, RISE, SIGEDITOR,
and RPGINIT.
HP RPG Pocket Guide (30318-90002) - This guide is a template
showing the meaning and placement of each column and line for all
RPG/iX specifications.
Data Entry and Forms Management System VPLUS/3000 (32209-90001) -
This manual includes a complete discussion about the screen
management software product, VPLUS. You can use this product
within RPG programs when using a terminal.
EDIT/3000 Reference Manual (03000-90012) - This manual explains
how to use the text processor software product, EDITOR.
KSAM/3000 Reference Manual (30000-90079) - This manual explains
how to use KSAM disc files and how to access them.
TurboIMAGE/iX Database Management System (30391-90001) - This
manual discusses the TurboIMAGE database software product.
MPE iX Intrinsics Reference Manual (32650-90028) - This manual
discusses the operating system routines that can be used by
external subroutines in an RPG program.
Native Language Programmer's Guide (32650-90022) - This manual
discusses how to create and use Native Language Support message
files.
Message Catalogs Programmer's Guide (32650-90021) - This manual
discusses how to create and use non-Native Language Support
message files.
FCOPY Reference Manual (03000-90064) - This manual explains how to
use the FCOPY file utility.
SORT-MERGE/iX Programmer's Guide (32650-90080) - This manual
explains how to use the SORT/MERGE file utility.
Accessing Files Programmer's Guide (32650-90017) - This manual
discusses the ways MPE/iX files can be processed.
MPE/iX General User's Reference Manual (32650-90002) - This manual
discusses file, group, and account structures.
MPE/iX Commands Reference Manual (32650-90003) - This manual
describes the MPE/iX commands, such as FILE.
Example Conventions
Throughout this manual, examples of RPG program code are shown using
figures similar to the one below. The first two lines are a ruler to
help you quickly see the column positions for the code. The shaded
numbers on the left are not sequence numbers. Rather, they are used as
reference numbers for comments in the text. Lines are referenced only to
highlight specific concepts. Additionally, some examples show lines
containing dots only. Dots indicate that, to clarify examples, code has
been omitted.
___________________________________________________________________________________
| |
| 1 2 3 4 5 6 7 |
| 678901234567890123456789012345678901234567890123456789012345678901234|
| _______________________________________________________ |
| |
| 1 C MESSAGE DSPLY |
| C . |
| C . |
| 2 C DSPLY FIELD1 |
| C . |
| C . |
| 3 C FIELD2 DSPLY FIELD3 |
| |
| |
| |
___________________________________________________________________________________
Figure 8-42. Using the DSPLY Operation
Syntax Conventions
NOTATION DESCRIPTION
UPPERCASE Within syntax statements, characters in uppercase
must be entered in exactly the order shown, though
you can enter them in either uppercase or lowercase.
For example:
SHOWJOB
Valid entries are: showjob ShowJob SHOWJOB
Invalid entries are: shojwob Shojob SHOW_JOB
italics Within syntax statements, a word in italics
represents a formal parameter or argument that you
must replace with an actual value. In the following
example, you must replace filename with the name of
the file you want to release:
RELEASE filename
punctuation Within syntax statements, punctuation characters
(other than brackets, braces, vertical parallel
lines, and ellipses) must be entered exactly as
shown.
{ } Within syntax statements, when several elements
within braces are stacked, you must select one. In
the following equivalent examples, you select ON or
OFF:
{ON }
SETMSG {OFF}
[ ] Within syntax statements, brackets enclose optional
elements. In the following example, brackets around
,TEMP indicate that the parameter and its delimiter
are not required:
PURGE filename[,TEMP]
When several elements within brackets are stacked,
you can select any one of the elements or none. In
the following equivalent examples, can select
devicename or deviceclass or neither:
[devicename ]
SHOWDEV [deviceclass]
NOTATION DESCRIPTION
[...] Within syntax statements, a horizontal ellipsis
enclosed in brackets indicates that you can
repeatedly select elements that appear within the
immediately preceding pair of brackets or braces. In
the following example, you can select itemname and
its delimiter zero or more times, each instance of
itemname preceded by a comma:
[,itemname][...]
If a punctuation character precedes the ellipsis, you
must use that character as a delimiter to separate
repeated elements. However, if you select only one
element, the delimiter is not required. In the
following example, the comma does not precede the
first instance of itemname:
[itemname][,...]
|...| Within syntax statements, a horizontal ellipsis
enclosed in parallel vertical lines indicates that
you can select more than one element that appears
within the immediately preceding pair of brackets or
braces. However, each element can be selected only
one time. In the following equivalent examples, you
must select ,A or ,B or ,A,Bor ,B,A :
{,A}
{,B}|...|
If a punctuation character precedes the ellipsis, you
must use that character as a delimiter to separate
repeated elements. However, if you select only one
element, the delimiter is not required. In the
following example, you must select A or B or A,B or
B,A (the first element is not preceded by a comma):
{A}
{B}|,...|
... : Within examples, horizontal or vertical ellipses
indicate where portions of the example are omitted.
_ Within syntax statements, the space symbol _ shows a
required blank. In the following example, you must
separate modifier and variable with a blank:
SET [(modifier)]_(variable);
The symbol indicates a key on the terminal's
keyboard. For example, RETURN indicates the carriage
return key.
CONTROLchar CONTROLchar indicates a control character. For
example, CONTROLY means you must simultaneously press
the control key and Y key on the terminal's keyboard.
NOTATION DESCRIPTION
base prefixes The prefixes %, #, and $ specify the numerical base
of the value that follows:
%num specifies an octal number
#num specifies a decimal number
$num specifies a hexadecimal number
When no base is specified, decimal is assumed.
Bit (bit:length) When a parameter contains more than one piece of data
within its bit field, the different data fields are
described in the format Bit (bit:length), where bit
is the first bit in the field and length is the
number of consecutive bits in the field. For
example, Bits (13:3) indicates bits 13, 14, and 15:
most significant least significant
+-----------------------------------------------+
|0 | | | | | | | | | | | | |13|14|15|
+-----------------------------------------------+
Bit(0:1) Bits(13:3)
MPE/iX 5.0 Documentation