Section A. Deck Structure and Control Cards
There are three principal control cards:
$JOB - to begin a program and specify options
$PROCESS - to separate external procedures and specify options
$DATA - to denote the beginning of input data
(not required if no data is present)
Other control cards give additional flexibility in option
specification (see Section B), control the INCLUDE feature (see
Section J), and control the MACRO feature (see Section I).
The control cards described here are only those cards
required by PL/C. The operating system may require other
control cards to precede those shown to invoke the PL/C
compiler, and after those shown to close the job. PL/C will use
whatever region is passed to it by the operating system. With
the usual (overlayed) version of PL/C a minimum region of
approximately 100K is required. 120K is more reasonable and
will accommodate a program of about 200 statements. For a
reentrant version of PL/C, a region of 40K will allow you to run
a 200 statement program. As the program length and number of
identifiers increase more space is required.
PL/C is designed to process a group of independent programs
that will all look like a single job to the operating system.
Each $JOB card reinitializes the compiler to begin a new
program.
PL/C control cards are recognized by a $ in column 1. This
must always be in column 1 -- it is not affected by the SORMGIN
option. This "recognition character" is an installation option
and may be any non-blank character, but this Guide will describe
all control cards as if the character is a $.
A program consisting of a single external procedure and
requiring no data would simply be the following:
$JOB <options>
<source program cards>
A program with two external procedures and data would be:
$JOB <options>
<source cards for external procedure>
$PROCESS <options>
<source cards for external procedure>
$DATA
<data cards>
Note that the control cards are distinct from both program and
data cards. Program statements must not begin on a control
card; data cannot begin on the $DATA card. It is not a good
idea to use data cards with a $ in column 1, since PL/C will
LABELS, L
List of labels with frequency of encounter.
ENTRIES, E
List of entry-names with frequency of call.
REPORT, R
Statistics on run (time, core usage,
auxiliary I/O operations, etc, See SectionK.)
Depth
An integer giving limit on number of active
blocks for B, S and A dump options. If 0 is
given, depth is unlimited.
UNREAD, U
List of first 5 or fewer unread data cards.
DFLTS,D
Equivalent to specifying the installation
defaults.
Supplied default DUMP options are (S,F,L,E,R,U).
DUMPE, NODUMPE, DE, [NO]DUMPE=(d1,d2,...), [NO]DUMPE=l1l2...
(on $JOB only) Produce post-mortem dump only if error
was encountered during execution.
Supplied default DUMPE options are (S,F,L,E,R,U).
DUMPT, NODUMPT, DT, [NO]DUMPT=(d1,d2,...), [NO]DUMPT=l1l2...
(on $JOB only) Produce post-mortem dump only if
execution was terminated by an error.
Supplied default DUMPT options are (S,F,L,E,R,U).
DUMPS, NODUMPS, DS, [NO]DUMPS=(d1,d2,...), [NO]DUMPS=l1l2...
(on $JOB only) Specifies all three of DUMP, DUMPE and
DUMPT.
ERRORS=(c,r), E (on $JOB only)
Suppress execution if c or more compile errors.
If c=0 suppress execution unconditionally.
Terminate execution after r runtime errors.
If r=0 there is no limit on runtime errors.
Supplied default c=50, r=50. Maximum for each is 255.
ETIME=(m,s.h), ET (on $JOB only)
Time limit for execution.
m is minutes; assumed zero if omitted.
s is seconds; assumed zero if omitted.
h is hundredths of seconds; assumed zero if
omitted.
FLAGE, FLAGW, FE, FW
FLAGW prints both warnings and error messages.
FLAGE suppresses warnings.
HDRPG, NOHDRPG, H (on $JOB only)
Print header/separator page before program.
E9 SYMBOL-TABLE OVERFLOW. USE LARGER REGION OR INCREASE
TABSIZE.
(see TABSIZE option in Section B)
EA COMPILER ERROR IN ERROR-MESSAGE WRITER.
(a compiler error, see beginning of Section C)
SY or MD Prefix Errors during the Syntactic Analysis Phase
In some cases, particularly in declarations, errors are
discovered too late in the analysis of the statement for PL/C to
conveniently correct the text of the statement. The internal
form of the program has been altered to a correct construction
(often just a null statement) but the usual display of corrected
source text is omitted. Messages that frequently are issued in
such circumstances are marked with a * in the following list.
NUMBER MESSAGE
00 MISSPELLED KEYWORD
(apparent misspelling of one of the reserved
keywords. See list under DECLARE in Section E.)
01 EXTRA (
(deleted)
02 MISSING (
(supplied)
03 EXTRA )
(deleted)
04 MISSING )
(possibly missing operator, right paren is supplied)
05 EXTRA COMMA
(deleted)
06 MISSING COMMA
(supplied)
07 EXTRA SEMI-COLON
(deleted)
08 MISSING SEMI-COLON (OR MISUSE OF RESERVED WORD)
(A semi-colon is supplied. A frequent cause of
this error is the use of a reserved keyword as an
identifier. This forces the start of a new statement
so the statement prematurely ended apparently lacks
a semi-colon. The user may need to choose a non-
reserved identifier rather than supply a semi-colon)
09 MISSING :
(supplied)
0A MISSING =
(supplied)
0B * IMPROPER ATTRIBUTE ON PARAMETER
0C INEFFECTIVE IF
(warning; a pointless IF statement has been given.
The THEN unit is null and there is no ELSE unit.)
0D * IMPROPER ENTRY/RETURNS ATTRIBUTE
0E MISSING END
($PROCESS, $DATA, or end of program encountered
with a block still open; END supplied)
09 CONVERSION REQUIRED TO MATCH ARGUMENT iden OF iden
(warning. PL/C has generated code to convert the
argument of a procedure call so that the attributes
of the value passed will match the attributes of the
corresponding parameter. PL/I(F) would not do this
conversion because the attributes of the parameter
have not been specified in an ENTRY declaration)
0A SCALAR ARGUMENT SUPPLIED TO AGGREGATE PARAMETER iden
OF iden . ((1:10) USED FOR ALL BOUNDS.)
(this is a PL/C restriction, see Section E.
Assign the constant to an array with the proper
bounds and pass that array to the procedure.)
0B WORKSPACE OVERFLOW IN EXPRESSION PROCESSING
(either the situation which would generate error
CG02 exists or the nesting of array expressions,
array subscripting, function references, or paren-
thesized expressions is too deep. Simplify the
expression. Increasing region size will not help)
0C NO FILE SPECIFIED. SYSIN/SYSPRINT ASSUMED.
(warning)
0D iden IS A PARAMETER IN I/O LIST OR CHECK PREFIX
(warning. PL/I(F) does not allow parameters in
DATA- directed I/O lists nor in CHECK prefixes.
PL/C will accept the parameter)
0E BOTH FORMS OF INITIALIZATION USED FOR LABEL VARIABLE
iden
(PL/I(F) does not permit a LABEL variable to be
initialized via both the INITIAL attribute and
subscripted statement label constants. Both forms
are accepted by PL/C. Where there is conflict the
INITIAL attribute takes precedence)
0F STORAGE CAPACITY IS EXCEEDED
(object code exceeds available space,
specify larger region)
10 ILLEGAL COMPLEX COMPARE. REAL PARTS WILL BE COMPARED
11 iden IS ILLEGAL OPERAND IN INITIAL, LENGTH
OR DIMENSION ATTRIBUTE OF STATIC VARIABLE.
constant IS USED.
(the bounds, lengths, and iteration factors used
with a STATIC or EXTERNAL variable must
be optionally signed decimal constants. A non-
constant has appeared in this context and has been
replaced by a constant of appropriate type)
12 NON-CONSTANT OPERAND( iden ) IN INITIAL, LENGTH
OR DIMENSION ATTRIBUTE OF STATIC VARIABLE.
(warning: a STATIC or EXTERNAL variable, BUILT-IN
function, EXTERNAL user-defined function has
been used in the bounds, length, or iteration
factor for a STATIC/EXTERNAL variable. This is
not allowed in PL/I. PL/C uses the value of the
operand in error)
13 PL/C BUILT-IN FUNCTION USED.
(warning. A builtin function that is not included
in PL/I(F) has been used)
14 ARGUMENT TO MAX OR MIN IS COMPLEX. REAL PART IS USED.
23 TOO MANY ERRORS DURING COMPILATION. EXECUTION
SUPPRESSED.
24 COMPILER ERROR DURING CODE GENERATION. PROGRAM ABORTED.
(a compiler error, see beginning of Section C)
25 ILLEGAL ARGUMENT TO REAL OR IMAG PSEUDO-VARIABLE.
(THE ASSIGNMENT IS PERFORMED ANYWAY.)
(argument must be COMPLEX arithmetic)
26 IMPLIED ARITHMETIC/STRING CONVERSION INVOKED.
(MONITOR message. Conversion is performed)
27 STRING CONSTANT IN INITIAL, LENGTH OR DIMENSION
ATTRIBUTE OF STATIC VARIABLE.
(conversion is performed)
28 BIT STRING IN GET OR PUT STRING. STATEMENT DELETED.
EX Prefix Errors during the Execution Phase
NO ON MESSAGE
CODE
00 0004 PROGRAM RETURNS FROM MAIN PROCEDURE.
01 0004 PROGRAM IS STOPPED.
(normal termination-- a STOP or EXIT has
been executed)
02 0070 END OF FILE REACHED.
(the ENDFILE condition is raised. System action
terminates the program.)
03 0300 EXPONENT OVERFLOW. RESULT IS SET TO 1.
04 0300 EXPONENT OVERFLOW. RESULT IS LEFT UNCHANGED.
05 0310 FIXED-POINT OVERFLOW.
(low order digit set to 1)
06 0310 FIXED-DECIMAL OVERFLOW.
07 0310 NUMBER TOO LARGE TO CONVERT TO FIXED BINARY. 1 IS USED.
08 0320 FIXED-POINT QUOTIENT TOO LARGE. PROBABLE DIVISION BY 0.
RESULT IS SET TO 0.
09 0320 FIXED-POINT QUOTIENT TOO LARGE. PROBABLE DIVISION BY 0.
RESULT IS LEFT UNCHANGED.
0A 0320 FLOATING-POINT DIVISION BY 0. RESULT IS SET TO 1.
0B 0320 FLOATING-POINT DIVISION BY 0. RESULT IS LEFT UNCHANGED.
0C 0330 EXPONENT UNDERFLOW. RESULT IS SET TO 0.
0D 0330 EXPONENT UNDERFLOW. RESULT IS LEFT UNCHANGED.
0E 0340 SIZE RAISED. RESULT IS LEFT UNCHANGED.
(occurs when the value of an expression is assigned
to a variable whose precision is too small to hold
the value. In PL/C, no left-truncation occurs.
Instead the computed value is assigned to the
variable, regardless of its declared precision.)
0F 0340 SIZE RAISED DURING CONVERSION. RESULT IS SET TO 0.
10 0340 SIZE RAISED DURING STRING-TO-ARITHMETIC CONVERSION.
VALUE USED IS number
11 0340 NUMBER TOO LARGE TO CONVERT TO SPECIFIED BIT STRING.
(SIZE CONDITION) NUMBER IS number
STRING USED IS string
12 0340 RESULT OF BIT-TO-ARITHMETIC CONVERSION GREATER THAN
2**56-1. (SIZE CONDITION) STRING IS string
VALUE USED IS number
String Generic:
BOOL, HIGH, INDEX, LENGTH, LOW, REPEAT, STRING, SUBSTR,
TRANSLATE, UNSPEC, VERIFY
Note on UNSPEC: Although the PL/I(F) and PL/C internal
representation of certain data-types differ (see SectionD), the PL/C and PL/I(F) UNSPEC functions produce identical
results (except for the packed decimal error case noted
under pseudo-variables.) The PL/C UNSPEC is somewhat more
complicated (and time-consuming to execute) than its
PL/I(F) counterpart, since the PL/C UNSPEC must convert to
and from the PL/I(F) representation.
Array Generic:
ALL, ANY, DIM, HBOUND, LBOUND, PROD, SUM
Incompatibility: In PL/C the built-in functions DIM, LBOUND
and HBOUND operate without actually evaluating an array
expression, if such an expression is given as the first
argument. Since PL/I(F) evaluates the expression before
invoking the function, there could be "side effects" under
PL/I(F) that will not occur in PL/C.
Type Conversion:
BINARY, BIT, CHAR, DECIMAL, FIXED, FLOAT, PRECISION
Condition:
DATAFIELD, ONCHAR, ONCODE, ONCOUNT, ONFILE, ONKEY, ONLOC,
ONSOURCE
PL/C has an additional condition: KEY condition with ONCODE
= 69. This will be raised if (ISAM only):
1. A REWRITE or DELETE is issued for a SEQUENTIAL
file, and the previous I/O operation wasn't a READ.
2. A DELETE is invalid because the file is not opened
for UPDATE.
3. A DELETE is invalid because L has not been
specified in the OPTCD.
4. A DELETE is invalid because the KEY occupies the
first byte of the record.
PL/C does not include all of the ON codes of PL/I(F). See
Section H.
Miscellaneous:
COUNT, DATE, LINENO, TIME
where oooo is the origin statement number, dddd is the
destination statement number, and nnn is a count of the
number of times the transfer was made in succession. If
the condition is raised within the scope of a FLOW
statement, the origin and destination of the transfer are
immediately printed on SYSPRINT in the same format as used
by the PUT FLOW statement. This may, of course, be
replaced with a user-supplied ON FLOW unit. The ONORIG and
ONDEST builtin functions are useful in such an ON- unit--
see Section G. The NOFLOW and FLOW statements will still
serve to dynamically suppress and resume the printing that
may result from the raising of the FLOW condition. The
user should disable the FLOW condition in any FLOW ON-unit
he supplies (by using a NOFLOW prefix) to avoid an infinite
loop.
If the FLOW or NOFLOW prefix is applied to a PROCEDURE
or BEGIN statement, its scope is the entire block. If
applied to a DO statement, its scope is the DO group.
Applied to other statements, its scope is the single
statement.
KEY See Section G for a description of KEY Condition 69.
NAME
OVERFLOW OFL NOOVERFLOW NOOFL
RECORD
SIZE NOSIZE (note default different from PL/I(F))
When the SIZE condition is raised, the arithmetic results
in PL/C will differ from those produced by PL/I(F). In
particular, PL/I(F) may truncate results on the left to the
user-specified precision, while PL/C always retains the
implementation-defined maximum precision.
STRINGRANGE STRG NOSTRINGRANGE NOSTRG
(note default different from PL/I(F))
SUBSCRIPTRANGE SUBRG NOSUBSCRIPTRANGE NOSUBRG
(note default different from PL/I(F))
The NOSUBSCRIPTRANGE prefix will not be effective unless
the NOMONITOR=(SUBRG) sub-option is specified. Since out-
of-range subscripts can damage the compiler (if PL/C is not
in the link pack area) and interfere with batch operation,
many installations elect to inhibit (override) this option.
TRANSMIT
UNDEFINEDFILE UNDF
UNDERFLOW UFL NOUNDERFLOW NOUFL
User-defined condition
ZERODIVIDE ZDIV NOZERODIVIDE NOZDIV
As noted in the ERROR condition, PL/C will attempt to correct
runtime errors and continue. In the case of arithmetic
condition, if the condition is disabled (i.e., a NO-prefix is in
effect), the correction will be suppressed. If a user-supplied
ON-unit is pending, the correction will be applied, but no error
message will be given.
The ONCODE values for each error condition are given in
Section C. These are the same as the PL/I(F) codes wherever
possible. In addition, error cases detected by PL/C which have
no PL/I(F) codes are given codes in the 900-999 range.
Section K. PL/C Post Mortem Dump Statistics Report
The PL/C post mortem dump statistics report is generated in
response to the R suboption on the DUMP, DUMPE, or DUMPT options
(See Section B). Much of the report is self-explanatory.
However, note the following:
- PAGES and LINES refer to output to the system output file,
SYSPRINT. CARDS refers to input from the system input file,
SYSIN. INCL'S refers to the total number of cards read from all
$INCLUDEd files. AUXIO refers to the total number of records
read from, written to, or updated in auxiliary files. This
includes auxiliary input file cards that are $INCLUDEd.
- BYTES USED figures are given exactly and then rounded up to
the nearest K (=1024 bytes). BYTES UNUSED figures are given
exactly and then rounded down to the nearest K.
For example: USED 1025 ( 2K)
UNUSED 1025 ( 1K)
Since some internal PL/C tables grow and shrink, BYTES USED
means the maximum amount used at any time, and BYTES UNUSED
means the minimum amount unused at any time.
- SYMBOL TABLE refers to the PL/C internal table that records
information about identifiers, variables, constants, entries,
files and blocks used in the program. It exists through
compilation and execution. Symbol table space is also used
during compilation for storing macro definitions. (See diagram
below.)
- INTERMEDIATE CODE refers to the PL/C internal
representation of the program during compilation. It exists
only during compilation. (See diagram below.)
- OBJECT CODE refers to the machine code generated by PL/C
for the program. It is created by compilation, and exists
through execution. (See diagram below.)
- STATIC CORE refers to core for storing STATIC (and
EXTERNAL) variables. It exists during execution time. Even if
no STATIC or EXTERNAL variables are declared, STATIC CORE USED
will be approximately 350 bytes for fixed overhead. (See
diagram below.)
- AUTOMATIC CORE refers to core for storing AUTOMATIC
variables. It exists during execution time. Even if no
AUTOMATIC variables exist in the program, AUTOMATIC CORE USED
will be approximately 200 bytes. (See diagram below.)
- DYNAMIC CORE refers to core for auxiliary and $INCLUDE file
DCBs, buffers, macro expansions, and several other miscellaneous
functions. It is used dynamically through compilation and
execution time. (See diagram below.)