Create S/36 COBOL Program (CRTS36CBL)

The CRTS36CBL command compiles a COBOL source program into a program object for use on the System/36 environment. You can use this command interactively, in batch mode, or from a CL program.

All object names you specify in the CRTS36CBL command must be composed of alphanumeric characters, the first of which must be alphabetic. The names cannot exceed 8 characters in length.

Parameters

Keyword Description Choices Notes
PGM Program Qualified object name Optional, Positional 1
Qualifier 1: Program Name, *PGMID
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-29, 29 Optional, Positional 4
NEP Never-ending program *NO, *YES Optional, Positional 5
MRTMAX Maximum MRT devices 0-99, 0 Optional, Positional 6
TEXT Text 'description' Character value, *SRCMBRTXT, *BLANK Optional
OPTION Source listing options Values (up to 50 repetitions): *SOURCE, *NOSOURCE, *SRC, *NOSRC, *NOXREF, *XREF, *GEN, *NOGEN, *NOSEQUENCE, *SEQUENCE, *NOVBSUM, *VBSUM, *NONUMBER, *NUMBER, *LINENUMBER, *NOMAP, *MAP, *NOOPTIONS, *OPTIONS, *QUOTE, *APOST, *DEBUG, *NODEBUG, *SECLVL, *NOSECLVL, *PRINT, *NOPRINT Optional
GENOPT Generation options Values (up to 50 repetitions): *NOLIST, *LIST, *NOXREF, *XREF, *NOPATCH, *PATCH, *NODUMP, *DUMP, *NOATR, *ATR, *RANGE, *NORANGE, *UNREF, *NOUNREF, *NOOPTIMIZE, *OPTIMIZE Optional
PRTFILE Print file Qualified object name Optional
Qualifier 1: Print file Name, QSYSPRT
Qualifier 2: Print file library Name, *LIBL, *CURLIB
ICFLIB Library for ICF files Name Optional
REPLACE Replace program *NO, *YES Optional
TGTRLS Target release Simple name, *CURRENT, *PRV Optional
USRPRF User profile *USER, *OWNER Optional
AUT Authority Name, *LIBCRTAUT, *ALL, *CHANGE, *USE, *EXCLUDE Optional
DUMP Compiler debugging dump Element list Optional
Element 1: 1-32767, 1, *
Element 2: 1-32767, 32767
ITDUMP Intermediate text dump 0-31, 0 Optional
FIXDECDTA Fix decimal data *NO, *YES Optional
CPYLIB Copy file library Name, *LIBL, *CURLIB Optional

Program (PGM)

Specifies the program name and library name for the COBOL program object you are creating. The possible values are:

*PGMID
The name for the program object is taken from the PROGRAM-ID paragraph in the COBOL source program.
program-name
Enter a name to identify the compiled COBOL program. If you specify a program name for this parameter, and run the compilation in batch mode, the first program in the batch job uses this name; any other programs use the name specified in the PROGRAM-ID paragraph in the source program.

The possible library values are:

*CURLIB
The current library is used. If you have not assigned a library as the current library, QGPL is used.
library-name
Enter the name of the library to contain the created program object.

Source file (SRCFILE)

Specifies the name of the source file that contains the COBOL source to be compiled. The possible values are:

QS36SRC
The IBM-supplied source file, QS36SRC, contains the COBOL source to be compiled.
source-file-name
Enter the name of the source file that contains the COBOL source to be compiled. This source file should have a record length of 92.

The possible library values are:

*LIBL
The system searches the library list to find the library where the file is located.
*CURLIB
The current library is used. If you have not assigned a library as the current library, QGPL is used.
library-name
Enter the name of the library where the source file is stored.

Source member (SRCMBR)

Specifies the name of the member of the source file that contains the COBOL source to be compiled. You can specify this parameter only if the source file referenced in the SRCFILE parameter is a database file. The possible values are:

*PGM
If you specified a program name for the PGM parameter, the compiler looks for the source program in a member having the same name as the program, and creates a program object with the same name as the program and member.

If you did not specify a program name for the PGM parameter, the compiler looks for the source program in the first member of the database source file, and creates a program object using the name specified in the PROGRAM-ID paragraph.

source-file-member-name
Enter the name of the member that contains the COBOL source.

Generation severity level (GENLVL)

Specifies the severity level that determines if a program object is created. The severity level corresponds to the severity level of the messages produced during compilation of the program. If the severity level of error messages is greater than the value you specify, a program object is not created. For example, if you specify 19 for this parameter, a program object is not created if the severity level of any of the messages is 20 or greater.

29
If errors occur in a program with a severity level greater than 29 a program object is not created.
severity-level
Enter a two-digit number, 00 through 29.

Never-ending program (NEP)

Specifies if this program is a never-ending (or long-running) program. A never-ending program is constantly running and uses system resources (such as disk storage, display stations, or printers) that are not shared with other programs. A never-ending program does not end when all of its requesters are released.

The possible values are:

*NO
The program is not a never-ending program.
*YES
The program is a never-ending program.

Maximum MRT devices (MRTMAX)

Specifies the maximum number of requesting display stations to be allowed during the running of the compiled program. The maximum is 99. The possible values are:

0
There are no requesting display stations.
1-99
A two-digit number, 00 through 99, can be specified.

Text 'description' (TEXT)

A brief description of the program and its function. The possible values are:

*SRCMBRTXT
Use the same text for the program object as that which describes the database file member containing the COBOL source. If the source comes from a device or in-line file, specifying *SRCMBRTXT has the same effect as specifying *BLANK.
*BLANK
No text is specified.
'text-description'
Enter the text that briefly describes the program and its function. The text can be a maximum of 50 characters in length and must be enclosed in apostrophes. The apostrophes are not part of the 50-character string.

Source listing options (OPTION)

Specifies the options to use when the COBOL source is compiled. The possible values are:

*SOURCE or *SRC
The compiler produces a source listing, consisting of the COBOL source input and all compilation-time error messages.
*NOSOURCE or *NOSRC
The compiler does not produce a source listing.
*NOXREF
The compiler does not produce a cross-reference listing for the source program.
*XREF
The compiler produces a cross-reference listing for the source program.
*GEN
The compiler creates a program object after the source program is compiled.
*NOGEN
The compiler performs syntax-checking and lists the appropriate error messages, but does not create a compiled program object.
*SEQUENCE
The compiler checks the sequence of the source program statements. If statements are not in sequence, a message is printed.
*NOSEQUENCE
The compiler does not check the sequence of the source program statements.
*NOVBSUM
Verb-usage counts are not printed.
*VBSUM
Verb-usage counts are printed.
*NUMBER
The user-supplied sequence numbers (columns 1 through 6) are used for reference numbers.
*NONUMBER
The source file sequence numbers (columns 1 through 6) are used for reference numbers.
*LINENUMBER
The sequence numbers created by the compiler are used for reference numbers. This option combines program source code and source code introduced by COPY statements into one consecutively-numbered sequence. Use this option if you specify FIPS (Federal Information Processing Standards) flagging.
*NOMAP
The compiler does not list the Data Division map.
*MAP
The compiler lists the Data Division map.
*OPTIONS
Options in effect are listed for this compilation.
*NOOPTIONS
Options in effect are not listed for this compilation.
*QUOTE
Specifies that the quotation mark (") is used to delineate literals.
*APOST
Specifies that the apostrophe (') is used to delineate literals.
*DEBUG
If you specify DEBUG for a program that does not contain WITH DEBUGGING MODE clauses, this option has no effect. Treat WITH DEBUGGING ON clause as normal.
*NODEBUG
Treat WITH DEBUGGING ON clause as comment.
*NOSECLVL
Second level message text is not listed for this compilation.
*SECLVL
Second level message text is listed for this compilation.
*PRINT
The compiler listing created by the COBOLC procedure is printed.
*NOPRINT
The compiler listing created by the COBOLC procedure is not printed or displayed.

Generation options (GENOPT)

Specifies the options to use when creating the program object. The listings could be required if a problem occurs in COBOL. The possible values are:

*NOLIST
No IRP (intermediate representation of program), associated hexadecimal code, or error messages are listed.
*LIST
The IRP, its associated hexadecimal code, and any error messages are listed.
*NOXREF
A cross-reference listing of all objects defined in the IRP is not produced.
*XREF
A cross-reference listing of all objects defined in the IRP is produced.
*NOPATCH
Space is not reserved in the compiled program for a program patch area.
*PATCH
Space is reserved in the compiled program for a program patch area. The program patch area can be used for debugging purposes.
*NODUMP
The program template is not listed.
*DUMP
The program template is listed.
*NOATR
The attributes for the IRP source are not listed.
*ATR
The attributes for the IRP source are listed.
*NORANGE
Does not verify ranges at run-time.
*RANGE
At run-time, the system verifies that subscripts are within the correct ranges, but does not verify index ranges. It also checks for substring operations in the code created by the compiler.
*UNREF
Unreferenced data items are included in the compiled program.
*NOUNREF
Unreferenced data items are not included in the compiled program. This reduces the number of ODT (object definition table) entries used, allowing a larger program to be compiled. The unreferenced data items still appear in the cross-reference listings produced through the *XREF option.
*NOOPTIMIZE
The compiler performs only standard optimizations for the program.
*OPTIMIZE
The program object created may run more efficiently, and may require less storage. However, specifying *OPTIMIZE can substantially increase the time required to compile a program.

Print file (PRTFILE)

Specifies the name of the file to which the compiler listing is directed and the library where the file is located. The file should have a minimum record length of 132. If a file with a record length less than 132 is specified, information is lost.

The possible values are:

QSYSPRT
If you do not specify a file name, the compiler listing is directed to QSYSPRT, an IBM-supplied file.
file-name
Enter the name of the file to which the compiler listing is directed.

The possible library values are:

*LIBL
The system searches the library list, *LIBL, to find the library in which the file is located.
*CURLIB
The library specified as the current library is searched. If you have not assigned a current library, QGPL is used.
library-name
Enter the name of the library in which the file is located.

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 if a new program object is created when a program object of the same name in the same library already exists. The possible values are:

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

Target release (TGTRLS)

Specifies the release level of the operating system on which you intend to use the object being created.

You can specify an exact release level in the format VxRxMx, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V3R1M0 is Version 3, Release 1, Modification level 0.

Note: To use the object on the target system, you must save the object to the target release level specified on the create command and then restore it on the target system.

For example, if your system is running V3R1M0 and you want to create a program object for distribution to a V2R3M0 system, you must create the program with TGTRLS(V2R3M0) or TGTRLS(*PRV), save the program with TGTRLS(V2R3M0) or TGTRLS(*PRV), and restore the program on the V2R3M0 system. The program object can also be restored on a V3R1M0 system.

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.

*CURRENT
The object is to be used on the release of the operating system currently running on your system. For example, if V3R1M0 is running on the system, *CURRENT means you intend to use the object on a system with V3R1M0 installed. You 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 V3R1M0 is running on your system, *PRV means you intend to use the object on a system with V2R3M0 installed. You can also use the object on a system with any subsequent release of the operating system installed.
release-level
Specify the release in the format VxRxMx. The object can be used 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. To see the list of valid values, press F4=Prompt on the TGTRLS parameter of the command.

User profile (USRPRF)

Specifies the user profile that will run the compiled COBOL program. The profile of the program owner or the program user is used to run the program and control which objects can be used by the program (including the authority the program has for each object).

The possible values are:

*USER
The user profile of the program user is to be used when the program is run.
*OWNER
The user profiles of both the program's owner and user are to be used when the program is run. The collective sets of object authority in both user profiles are to be used to find and access objects when the program is run. Any objects that are created during the program are owned by the user of the program.

Authority (AUT)

Specifies the authority given to users who do not have specific authority to the program object, who are not on the authorization list, or whose group has no specific authority to the program object. You can alter the authority for all users, or for specific users after the program is created by using the GRTOBJAUT (Grant Object Authority) or RVKOBJAUT (Revoke Object Authority) commands.

The possible values are:

*LIBCRTAUT
The public authority for the object is taken from the CRTAUT keyword of the target library (the library that is to contain the created program object). This value is determined when the object is created. If the CRTAUT value for the library changes after the object is created, the new value does NOT affect any existing objects.
*ALL
Provides authority for all operations on the program object except those limited to the owner or controlled by authorization list management authority. The user can control the program object's existence, specify security for it, change it, and perform basic functions on it, such as running and debugging the program object.
*CHANGE
Provides all data authority and the authority to perform all operations on the program object except those limited to the owner or controlled by object authority and object management authority. The user can change the object and perform basic functions on it, such as running and debugging the program object.
*USE
Provides object operational authority and read authority; authority for basic operations on the program object such as running the program. The user is prevented from changing the object.

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
The public cannot access the program object.
authorization-list-name
Enter the name of an authorization list of users and authorities to which the program is added. The program object is secured by this authorization list, and the public authority for the program object is set to *AUTL. The authorization list must exist on the system when the CRTS36CBL command is issued.

Compiler debugging dump (DUMP)

An IBM COBOL debugging aid. (For IBM service personnel.)

Intermediate text dump (ITDUMP)

An IBM debugging aid which causes the compiler to dump the internal text at certain times during the compilation. (For IBM service personnel.)

Fix decimal data (FIXDECDTA)

Checks for decimal data errors. A decimal data error occurs when a program attempts to use a packed or zoned number that is not valid. The possible values are:

*YES
The compiler generates code to monitor for and correct decimal data errors.
*NO
The compiler does not generate code to monitor for decimal data errors. If such an error occurs, your program will stop.

Copy file library (CPYLIB)

Specifies the name of the library to be searched when a COPY statement is encountered. If no library is specified, #LIBRARY will be used.

The possible library values are:

*CURLIB
The library specified as the current library is searched. If you have not assigned a current library, QGPL is used.
*LIBL
The library list is searched to find the library in which the COPY file is located.
library-name
Enter the name of the library in which the COPY file is located.

Examples

Example 1: Compiling a Source Program into a Program Object for use on the System/36 environment

CRTS36CBL   PGM(MYLIB/XMPLE1)  SRCFILE(MYLIB/QS36SRC)
            SRCMBR(XMPLE1)  OPTION(*SOURCE)
            TEXT('My COBOL program')

This command calls the COBOL 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

CBL1019
Compile failed. Program not created.
SBL9001
Compile failed. Program not created.
SBL9006
TGTRLS(&1) specified, but previous compiler is not installed.
SBL9007
The product library is damaged, or the user is not allowed to use it.