HP 3000 Manuals

Migrating from IBM RPG [ HP RPG/XL Programmer's Guide ] MPE/iX 5.0 Documentation


HP RPG/XL Programmer's Guide

Migrating from IBM RPG 

Converting IBM S/34 and S/36 RPG programs to run under MPE XL consists of
four steps.  First, you convert the programs on a system that runs MPE V
by using the HP product, TRANSFORM. Next, you manually convert certain
features that are not converted by TRANSFORM. Then, you recompile the
programs under MPE V. Finally, you must STORE the programs onto tape,
then RESTORE them onto the system that runs MPE XL. These steps are
discussed in more detail below:

Step:      Description: 

1.         TRANSFORM performs the following primary tasks when converting
           IBM RPG S/34 and S/36 programs to run on an MPE V system:

            *  It translates IBM RPG source programs to HP RPG.

            *  It generates HP RPG source files for IBM DFU files.

            *  It translates IBM procedure files into PROCMON procedure
               files.

            *  It translates IBM message files into a format compatible
               with the HP message file produced by MAKECAT.

            *  It transfers data files to the HP 3000, converting
               sequential and ISAM files to MPE and KSAM file formats.

           For complete information about TRANSFORM, see the
           TRANSFORM/3000 Reference Manual.

2.         Since HP RPG is approximately 95% compatible with IBM RPG,
           TRANSFORM can convert most features automatically.  However,
           for those DFU features that are not converted, you must
           manually modify the generated source programs to include those
           features.  The TRANSFORM/3000 Reference Manual lists the
           features that you must convert manually.

3.         Compile the HP RPG programs generated by TRANSFORM (compile
           them on the system running MPE V).

4.         STORE the compiled programs onto tape, and then RESTORE the
           files onto the system running MPE XL. (See the instructions in
           the MPE XL migration guides for information on how to do
           this.)  HP RPG programs run under MPE XL in compatibility mode
           only.

RPG Features That Are New 

HP RPG extends the features found in IBM System/3 and System/360 DOS RPG
II to include:

External Subroutine Call Parameters 

You can pass parameters with an EXIT Calculation Specification operation
(the parameters are identified by PARM operation(s) immediately following
EXIT). EXIT makes it easier to use subroutines written in Business BASIC,
C, Pascal, COBOL and FORTRAN.

Run-Time Error Options 

RPG provides three methods for handling run-time errors:

   1.  Using the Header Specification to specify whether to ignore the
       error or whether to abort the program.

   2.  Letting the operator determine, at run-time, how to handle the
       error.

   3.  Using Calculation Specification to handle the error.  (this method
       provides an individualized way of handling the error.)

Cross-Reference Listing 

The Cross-Reference listing shows all line references to file names,
indicators, and field names.  You must specifically request this listing
using the Header Specification or the MAP option of the $CONTROL compiler
subsystem command.

EBCDIC/ASCII Translation 

You can have HP RPG automatically generate file translation tables for
EBCDIC-to-ASCII, EBCDIK to JIS, or ASCII-to-EBCDIC, JIS to EBCDIK
conversions.  Or, you can use the EBCDIC or EBCDIK alternate collating
sequence.

Partial Field Translation 

You can have HP RPG translate just alphanumeric and unpacked numeric
fields, leaving packed numeric and binary fields unchanged.

Combined Input/Output (Terminal) File 

HP RPG lets you use a terminal as a single file.  This allows both read
and write operations for the file.

Calculation Indicator Repetition 

HP RPG lets you enter conditioning indicators once in Calculation
Specifications and repeat them on successive lines.

Compile-Time Tables/Arrays on Separate Disc Files 

If you're using a compile-time table or array in more than one program,
select one program in which to define it, then include an Array/Table
File Name Specification (A) in each of the remaining programs.  The table
or array is saved on disc and each Array/Table File Name Specification
references that disc file.

Structured Programming Constructs 

The following Calculation Specification operations let you use standard
structured programming techniques:  DO-WHILE, DO-UNTIL and IF-THEN-ELSE.

EXCPT Group Names 

You can name a group of Output Specifications with the EXCPT Calculation
Specification operation.

Full Procedural Files 

The READE Calculation Specification operation reads the next sequential
record in a demand or full procedural file whose key matches a specified
key field.  The READP operations reads the previous record for that key
field.

RPG Screen Interface (RSI) 

RSI lets you use screen (terminal) files in an RPG program.  RSI forms
processing provides:

 *  Full screen capability using standard RPG specifications.

 *  Lets you use message files and dynamically change screen attributes.

 *  Generates an RSI forms file from the file's Input Specifications (RSI
    CONSOLE files).

RPG Features That Are Different 

The following HP RPG features are different from IBM RPG:

Printer Files 

For programs that use carriage control tape channels other than Channel 1
for printer files, add Line Counter Specifications to equate each channel
to a particular line number.  Otherwise, the compiler equates Channel 1
to line 6 and the overflow line to line 60.  Also, Channels 2-12 are
equated to the line numbers obtained by multiplying the channel numbers
by 5.

Edit Words 

HP RPG handles edit words as follows:

 *  All blanks in edit words are replaceable characters.  (To print the
    blank character, included an ampersand (&) in the edit word.)

 *  Constants are allowed to the right of an edit word.

 *  The floating dollar sign is not a replaceable character.

 *  Fields containing all zeros are positive.

 *  The edit field can be smaller or larger than the number of
    replaceable characters in the edit word.  Extra characters are
    truncated or leading zeros are added.

 *  All constants that follow a significant digit are printed (except for
    a minus or credit sign following a positive number).

Differences in Character Codes 

HP RPG uses the American Standard Code for Information Interchange
(ASCII) Character Set/Collating Sequence.  If your system has Katakana
characters installed, you use the Japanese Industrial Standard (JIS). IBM
System/3 and System 360 use Extended Binary Coded Decimal Interchange
Code (EBCDIC). In Japan, this is EBCDIK. The items below summarize the
differences in these character sets:

 *  Alphabetic characters are higher in the ASCII collating sequence than
    numeric characters.  This affects compare and matching field
    operations.  You can use the Header Specification (column 26) to
    generate an EBCDIC or EBCDIK alternate collating sequence table.
    Also, you can use columns 54-59 in the File Description Continuation
    line to generate file translation tables for EBCDIC-TO-ASCII (EBCDIK
    to JIS) or ASCII-to-EBCDIC (JIS to EBCDIK) conversion.

 *  You must convert all existing translation tables (including alternate
    collating sequence and file translation tables) to ASCII (JIS)
    equivalents.

 *  Move Zone operations using ASCII (JIS) may yield results that are
    different from the same operations using EBCDIC or EBCDIK (these
    differences involve special characters).

Device Class Names 

HP device class names have no established values except for a few
reserved names such as WORKSTN, STDIN and STDLIST. They are defined then
the operating system is installed.  Therefore, HP RPG accepts all values
for device class names.  When entering a device class name in the File
Description Specification, be sure to use the same name assigned during
system generation.

Rewind Operations 

HP RPG does not support all tape-rewinding operations, since the
operating system performs these tape operations.

Quotation Marks 

Because other HP languages use the double quotation mark as the delimiter
for constants and edit words, HP RPG also uses them for the same purpose.
To continue to use the single quotation mark as the delimiter character
for constants and edit words, use the $CONTROL compiler subsystem command
with the QUOTE= parameter.  Compiler subsystem commands are discussed in
the HP RPG Reference Manual.

File and Program Names 

File and program names must begin with a letter (A-Z), followed by
letters (A-Z) or digits (0-9).  File names may contain up to eight
characters.  If the file is in a different group or account, you must
enter a :FILE command to identify its location.  Append the group and
account to the file name.  For instance, to qualify the file named
FILENAME, enter FILENAME.GROUPNAME.ACCOUNTNAME. See the MPE XL General 
User's Reference Manual for more information on qualifying file names.
Program names may contain up to six characters.

RPG Features That Are Not Supported 

HP RPG does not support the following IBM RPG features:

Sterling Notation 

The Sterling currency (pounds, shillings, pence) specifications (Header,
Input, and Output) must be changed.

Telecommunications 

HP RPG does not currently support telecommunications specifications.

ULABL Operation 

RPG does not support ULABL calculation operations that make external
subroutine fields accessible to an RPG program.  HP RPG does, however,
support the RLABL and PARM operations.  RLABL makes fields, tables,
arrays, and indicators in RPG programs available to external subroutines.
PARM passes parameters to and from external subroutines.

Card Reader/Punch/Interpreter 

HP RPG does not support punched card devices.  You must manually convert
code related to these devices.

Header Specification Features 

The following Header Specification features are not supported:

 *  Variable memory sizes during compilation and execution.

 *  Destination device of a compiled object program.

 *  Inquiry request option (to allow/disallow interruption and roll-out
    of a running program, followed by roll-in of a new program).

 *  Normal halt bypass when the object program transmits an
    unrecognizable character to an output device.

 *  Sharing of a single output area by all disc files.



MPE/iX 5.0 Documentation