Create RPG II Program (CRTS36RPG)

The command Create System/36 RPG Program (CRTS36RPG) is used to call the System/36-compatible RPG II compiler.

Parameters

Keyword Description Choices Notes
PGM Program Qualified object name Optional, Positional 1
Qualifier 1: Program Name, *CTLSPEC
Qualifier 2: Library Name, *CURLIB
SRCFILE Source file Qualified object name Optional, Positional 2
Qualifier 1: Source file Name, QS36SRC
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Source member Name, *PGM Optional, Positional 3
GENLVL Generation severity level 0-99, 21 Optional
NEP Never ending program *NO, *YES Optional
MRTMAX Maximum MRT devices 0-99, 0 Optional
TEXT Text 'description' Character value, *SRCMBRTXT, *BLANK Optional
OPTION Source listing options Values (up to 10 repetitions): *SOURCE, *NOSOURCE, *SRC, *NOSRC, *XREF, *NOXREF, *GEN, *NOGEN, *DUMP, *NODUMP, *SECLVL, *NOSECLVL, *CONSOLE, *NOCONSOLE Optional
GENOPT Generation options Values (up to 10 repetitions): *LIST, *NOLIST, *XREF, *NOXREF, *ATR, *NOATR, *DUMP, *NODUMP, *PATCH, *NOPATCH, *OPTIMIZE, *NOOPTIMIZE Optional
PRTFILE Print file Qualified object name Optional
Qualifier 1: Print file Name, QSYSPRT
Qualifier 2: Library Name, *LIBL, *CURLIB
ICFLIB Library for ICF files Name Optional
REPLACE Replace program *YES, *NO Optional
TGTRLS Target release Simple name, *CURRENT, *PRV Optional
USRPRF User profile *USER, *OWNER Optional
AUT Authority Name, *LIBCRTAUT, *ALL, *CHANGE, *USE, *EXCLUDE Optional
PHSTRC Phase trace *NO, *YES Optional
ITDUMP Intermediate text dump Character value, *NONE Optional
SNPDUMP Snap dump Character value, *NONE Optional
CODELIST Codelist Character value, *NONE, *ALL Optional
FIXDECDTA Fix decimal data *YES, *NO Optional

Program (PGM)

Specifies the library and program name by which the compiled RPG program is to be known.

*CTLSPEC
Specifies the program name used by the system, in positions 75 - 80 of the control specification.
program-name
Enter the name by which the program object will be known.
*CURLIB
The current library will be used. If you have not specified a current library, #LIBRARY will be used.
library-name
Enter the name of the library in which the compiled program is to be stored.

Source file (SRCFILE)

Specifies the name of the file that contains the source program and the name of the library that contains the file.

QS36SRC
Specifies the default file name.
source-file-name
Enter the name of the source file containing the program to be compiled.
*LIBL
Causes the system to search the library list to find the library containing the source file.
*CURLIB
The current library will be used. If you have not specified a current library, #LIBRARY will be used.
library-name
Enter the name of the library in which the source file is stored.

Source member (SRCMBR)

Specifies the name of the member of the source file.

*PGM
Specifies the member name for the source program to be compiled.
source-file-member-name
Enter the name of the member containing the source program.

Generation severity level (GENLVL)

Specifies whether or not a program object is to be generated depending on the severity of the errors encountered.

21
Does not generate a program object if error messages have a severity level of 21 or greater.
severity-level-value
Enter a number from 0 through 99. The severity level value of RPG messages does not exceed 50.

Never ending program (NEP)

Specifies whether the current program is to be a never-ending program.

*NO
Specifies that this is not a never-ending program.
*YES
Specifies that this is a never-ending program.

Maximum MRT devices (MRTMAX)

Specifies the maximum number of requesting display stations.

0
This is a SRT program.
maximum-terminals
Enter a number from 0 through 99 to show the maximum number of requesting terminals.

Text 'description' (TEXT)

Allows the user to enter text that describes the program and its function.

*SRCMBRTXT
Uses the text in the source program.
*BLANK
Omits the text.
text
Enter the description, enclosed in apostrophes, in 50 characters or less.

Source listing options (OPTION)

Specifies the options to use when the source program is compiled.

*SOURCE or *SRC
Produces a source listing with compile-time errors.
*NOSOURCE or *NOSRC
Does not produce a source listing.
*XREF
Produces a cross-reference listing and key-field information table.
*NOXREF
Does not produce a cross-reference listing and key-field information table. This is the default when *NOSOURCE is specified.
*GEN
Creates a program that can be run.
*NOGEN
Does not create a program that can be run.
*NODUMP
Does not print the program template when an error occurs.
*DUMP
Prints a program template when an error occurs.
*NOSECLVL
Does not print second-level messages.
*SECLVL
Prints second-level messages following first-level messages.
*CONSOLE
Creates display formats for a CONSOLE file if the program being compiled contains a CONSOLE file.
*NOCONSOLE
Does not create display formats for a CONSOLE file.

Generation options (GENOPT)

Specifies the options to use when the program object is created.

*NOLIST
Does not produce a listing of the intermediate representation of a program (IRP).
*LIST
Produces a listing of the intermediate representation of a program (IRP).
*NOXREF
Does not print a cross-reference listing for the IRP.
*XREF
Prints a cross-reference listing for the IRP.
*NOATR
Does not produce an attribute listing for the IRP.
*ATR
Produces an attribute listing for the IRP.
*NODUMP
Does not print the program template when an error occurs.
*DUMP
Prints a program template when an error occurs.
*NOPATCH
Does not reserve a program patch area in the compiled program.
*PATCH
Reserves a program patch area in the compiled program.
*NOOPTIMIZE
Does not improve a program for more efficient processing.
*OPTIMIZE
Improves a program for more efficient processing.

Print file (PRTFILE)

Specifies the name of the file in which the compiler listing is to be placed and the library in which the file is located.

QSYSPRT
If a file name is not specified, the compiler listing is placed in QSYSPRT file.
print-file-name
Enter the name of the file in which the compiler listing is to be placed.
*LIBL
The system searches the library list to find the library.
*CURLIB
The current library will be used. If you have not specified a current library, #LIBRARY will be used.
library-name
Enter the name of the library in which the file is stored.

Library for ICF files (ICFLIB)

Specifies the library containing the ICF record format definitions to be used with the program.

ICF-library-name
Enter the name of the library for ICF files.

Replace program (REPLACE)

Specifies whether or not a new program object is to be created if a program with the same name already exists in the specified library.

*YES
A new program object will be created and any existing program object of the same name in the specified library will be moved to library QRPLOBJ.
*NO
A new program object will not be created if a program object of the same name exists in the specified library.

Target release (TGTRLS)

Specifies the release of the operating system on which you intend to use the object being created. In the examples given for the *CURRENT and *PRV values, and when specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V2R3M0 is version 2, release 3, modification level 0.

Valid values for this parameter change every release.

The possible values are:

*CURRENT
The object is to be used on the release of the operating system currently running on your system. For example, if V2R3M5 is running on the system, *CURRENT means that you intend to use the object on a system with V2R3M5 installed. You can can also use the object on a system with any subsequent release of the operating system installed.
*PRV
The object is to be used on the previous release with modification level 0 of the operating system. For example, if V2R3M5 is running on your system, *PRV means you intend to use the object on a system with V2R2M0 installed. You can also use the object on a system with any subsequent release of the operating system installed.
target-release
Specify the release in the format VxRxMx. You can use the object on a system with the specified release or with any subsequent release of the operating system installed.

Valid values depend on the current version, release, and modification level, and they change with each new release. If you specify a release-level that is earlier than the earliest release level supported by this command, an error message is sent indicating the earliest supported release.

Note: The program may be able to be restored on a release level earlier than the one you specified on the create command. Use DSPPGM to determine the earliest release the program can run.

User profile (USRPRF)

Specifies the user profile that the compiled RPG program is to run under.

*USER
Uses the program user's profile when the program runs.
*OWNER
Uses the user profiles of both the program's owner and user when the program runs. The USRPRF parameter will not be updated if the program already exists.

Authority (AUT)

Specifies what authority is granted for the program.

*LIBCRTAUT
The default public authority for created objects is taken from the CRTAUT keyword which is associated with the target library. The value is determined at create time. If the value of the CRTAUT keyword of the library changes after the create, the new value will not affect any existing objects.
*ALL
Complete authority for the program except for transferal of object ownership.
*CHANGE
All operations are permitted except those dealing with the object's existence and its management.
*USE
Permission to read or run the compiled program, but not to debug or to change it.

Note: A user must have *USE authority to a program to obtain a formatted dump of the variables of the program. To dump variables, the program must also have observable information.

If you do not want some users to be able to dump the variables, then give them only *OBJOPR plus *EXECUTE authority to the program. This will allow them to call the program but not dump its variables.

If you do not want any users to be able to dump the variables, then use Change Program (CHGPGM) to remove the program's observable information.

*EXCLUDE
No authority.
authorization-list
The name of the authorization list which secures the object. The public authority will be *AUTL.

Phase trace (PHSTRC)

Specifies whether trace information about the compiler phases will be included in the listing.

*NO
Does not provide compiler phase information.
*YES
Provides compiler phase information.

Intermediate text dump (ITDUMP)

Produces a dynamic listing of intermediate text for the specified compiler phases.

*NONE
Does not produce an intermediate text dump.
phase-name
Enter the fourth and fifth characters of from 1 to 25 phase names.

Snap dump (SNPDUMP)

Produces a listing of major data areas and intermediate text following compilation of one or more specified phases.

*NONE
Does not produce a snap dump.
phase-name
Enter the fourth and fifth characters of from 1 to 25 phase names.

Codelist (CODELIST)

Causes dynamic listing of the intermediate representation of a program (IRP) for the specified compiler phases.

*NONE
Does not produce IRP listings.
*ALL
Produces an IRP listing for each compiler phase.
phase-name
Enter the fourth and fifth characters of from 1 to 25 phase names.

Fix decimal data (FIXDECDTA)

Specifies whether decimal data which is not valid is corrected or an error is signaled.

*YES
Corrects data which is not valid by setting digit values in the range A through F to zero, and not valid signs to plus.
*NO
Signals an error to the program without correcting the data which is not valid.

Examples

Example 1: Compiling a Source Program into a Program Object

CRTS36RPG   PGM(MYLIB/XMPLE1)
            SRCFILE(MYLIB/QS36SRC)  SRCMBR(XMPLE1)
            OPTION(*SOURCE)  TEXT('My RPG II program')

This command calls the System/36 Compatible RPG II compiler to create a program named XMPLE1. The source program is in member XMPLE1 of source file QS36SRC in library MYLIB. A compiler listing is created.

Error messages

*ESCAPE Messages

QRG9001
Compilation failed. Program is not created.
QRG9004
The release &1 specified on the TGTRLS option is not supported.