COMPILE (Compile Program)

MCP Control Instruction

Access Level: 1

COMPILE executes an assembler or compiler to generate an object program from source language images.

___ COMPILE ___ <program name> _______________________________________________________>
 |           |                  |                         | |        |
 |_ CMP _____|                  |_ ON <code file medium> _| |_ WITH _|
>_ <compiler name> ___________________________________________________________________>
                    |                        | |                    | |       |
                    |_ ON <compiler medium> _| |_ <parameter list> _| |_ TO __|
                                                                      |       |
                                                                      |_ FOR _|
>_____________________________________________________________________________________>
  |           | |               | |     |                           
  |_ LIBRARY _| |_ <disk spec> _| |_ ; _|         
  |           |
  |_ LIB _____|
  |           | 
  |_ SAVE ____|
  |           |                                                              
  |_ SYNTAX __|                                                                         
 
>_____________________________________________________________________________________| 
  |                                                   | |                 |             
  |_ SECURITY <usercode> _____________________________| |_ SENSITIVEDATA _|
  |                       |           | |           | |
  |                       |_ PRIVATE _| |_ IN ______| |
  |                       |           | |           | |
  |                       |_ PUBLIC __| |_ IO ______| |
  |                       |           | |           | |
  |                       |_ NONE ____| |_ OUT _____| |
  |                                     |           | |
  |                                     |_ SECURED _| |
  |                                                   |
  |_ SECURITYGUARDED <guard file name> _______________|

Explanation

CMP
COMPILE
These are synonymous.

<program name>
This is the name of the code file to be created.

<code file medium>
This specifies where the code file will reside after it is created. The available options are as follows; if no option is specified, the default is to create the code file on 100-byte disk.

DISK This specifies creation of the code file on the default disk subsystem.
PACK This specifies creation of the code file on a system resource diskpack.
A diskpack family name This specifies creation of the code file on the given diskpack family name.

Note: The <code file medium> can specify a diskpack only if the compiler used is capable of writing code files to diskpack. Some older compilers (such as COBOLV and BPL) lack this feature.

WITH
This is optional and does not influence the command.

<compiler name>
This is the name of the program that creates the code file.

<compiler medium>
This informs the MCP where to look for the compiler code file.

The CONTROL CODEPACK record that can be included at cold start in the system configuration file affects the sequence of attempts to find the compiler for execution. If ON <compiler media> is not included, the MCP will first look for the compiler on 100-byte disk. If not found, the MCP will look for the compiler on the diskpack specified in the CONTROL CODEPACK record, if specified. Otherwise, all nonrestricted diskpacks will be searched.

The allowable values for <compiler medium> are as follows:

DISK This causes the MCP to look for the compiler code file only on disk.
PACK This causes the MCP to look for the compiler code file among all available non-restricted diskpacks regardless of the presence of a CONTROL CODEPACK declaration at cold start.
A diskpack family name This causes only the specified diskpack family to be searched.

<parameter list>
This contains up to three parameters that can be inserted into a program when the program is started.

The <parameter list> option appears in the syntax of the COMPILE (Compile Program), DEBUG (Debug Session), and EXECUTE (Execute Library Program) commands. These parameters allow you to enter Boolean, string, and integer values, which can be used by the program when the program is being compiled or executed.

The syntax for <parameter list> is shown in the following figure.

_ ( _________________________________________________________________ ) ______________|
     |                 | |                                         |
     |_ <parameter 1> _| |_ , <parameter 2> _______________________|
                         |                   |                   | |
                         |                   |_ , <parameter 3> _| |
                         |                                         |
                         |_ , _ , <parameter 3> ___________________|

The rules for <parameter list> resemble those for parameters in the Work Flow Language (WFL) RUN command.

Integer parameters
Integer parameters

* Contain unsigned numeric data up to eight digits in length (8 UN) * Have values ranging from 0 through F * Are right-justified and zero-filled in the high-order digits if less than the maximum length * Will cause a syntax error if greater than the maximum length

String parameters

* Contain alphanumeric data up to six characters in length (6 UA) * Must be within quotation marks.

To pass a quoted string as a parameter, a double quote must appear in the parameter string (for example, COMPILE MYPROG COBOL9 (,”TRY” “XX”).

* Can be composed of any EBCDIC characters

Are left-justified and blank-filled in the low-order bytes if less than the maximum length

Will be truncated in the low-order bytes if greater than the maximum length

<parameter 1>
This can be an integer up to eight digits in length. It sets the switches at program address 0. For example, CMP MYPROG COBOL9 (10100000).

<parameter 2>
<parameter 3>
This can be 8-digit integers or 6-character strings. The value of <parameter 2> is inserted into the code file at base-relative address 8; The value of <parameter 3> at base-relative address 20. For example,

COMPILE MYPROG WITH COBOL9 (,12345678)
COMPILE MYPROG WITH COBOL9 (101,"TOTEST").

When either <parameter 2> or <parameter 3> are specified, you must have either a value or at least a comma in the preceding parameters. For example:

COMPILE MYPROG WITH COBOL9 (,,"TAPE").

A null entry is allowed. For example,

COMPILE MYPROG WITH COBOL9 (,0,"ABC"" ")

does not change the switches and inserts 00000000 at address 8 and the string “ABC”” at address 20.

Note: Slash parameters were available on previous releases of the MCP. In later releases, slash parameters will be deimplemented. The <parameter list> option replaces them.

TO
FOR
These are optional and do not influence the command.

LIBRARY
LIB
This specifies that the new code file is to be made a permanent file on the specified disk or diskpack after an error-free compile. The code file is not active until explicitly executed.

SAVE
This specifies that at the completion of an error-free compile the new code file is to be made a permanent file on the specified disk or diskpack. In addition, it is automatically executed.

SYNTAX
This specifies that this is a compile for syntax-checking only. The code file is neither saved nor executed.

If you do not specify LIB, SAVE, or SYNTAX, the program will be compiled and executed. (This is referred to as compile-and-go.) If error free, the object file will be removed at EOJ.

<disk spec>
This is a 1- or 2-digit integer specifying the logical ID number on which the new code file is to reside (values 01-39) or the disk subsystem on which it is to reside (values 90-98). Note that <disk spec> can be included only if the code file is to be created on a 100-byte medium.

SECURITY
This indicates that security attributes will be applied to this file.

PRIVATE
This means that the file can be accessed only by the creator of the file in the manner specified by the SECURITYUSE attribute. PRIVATE is the default SECURITYTYPE attribute.

NONE
This specifies that no security attributes are to be applied to this file.

PUBLIC
This means that the file can be accessed by all users in the manner specified by the SECURITYUSE attribute.

IO
This means that the SECURITYUSE attribute will allow READ/WRITE access to the file. IO is the default value assigned to SECURITYUSE.

IN
This specifies that only READ access is allowed to the file.

OUT
This specifies that only WRITE access is allowed to the file.

SECURED
This means that the file is a program and can only be executed. Data cannot be read from or written to this file.

SECURITY GUARDED <guard file name>
This specifies that another file identified by <guard file name> must be accessed before a user can be given permission to use the file. The SECURITYUSE attribute for a guarded file is stored in the GUARD file.

SENSITIVEDATA
This specifies that all records of the file are to be overwritten with random data before the file is returned to the available disk pool. The SENSITIVEDATA attribute will be ignored if the file is declared as PUBLIC.

Getting Programs in the Correct Format

You can use the COMPILE (Compile Program) command to create a program code file on diskpack in the correct 180-byte code file format.

The PCOPY utility, which is described in the V Series Systems Operations Guide Volume 3: System Utilities, can be used to copy a 100-byte disk format program code file to diskpack in the correct 180-byte code file format.

Examples

COMPILE OBJPGM ON SYSPAK WITH COBOL9 ON SYSPAK TO LIBRARY

This compiles OBJPGM, which resides on a diskpack called SYSPAK, with the COBOL9 compiler, which is also on SYSPAK. If the compile is error-free, the new code file, OBJPGM, will become a permanent file on SYSPAK.

CMP TEST RPG SYNTAX

This compiles TEST with the RPG compiler only to check syntax. The code file is neither saved nor executed.

CMP OBJ001 COBOL9 LIB ; SECURITY PRIVATE SENSITIVEDATA

This compiles OBJ001 with the COBOL9 compiler. If it is an error-free compile, the new code file, OBJ001, will become a permanent file. This file can be accessed only by the creator of the file, and when the file is removed, all areas of the file will be overwritten with random data before they are returned to the available disk pool.

See also

ssog2/commands/compile.txt · Last modified: 2009/07/07 07:06 by scott
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki