GCL Programing
GCL Programing
REFERENCE
47 A2 36UJ 05
DPS7000/XTA
NOVASCALE 7000
GCL
DPS7000/XTA
NOVASCALE 7000
GCL
Programmer's Manual
August 1999
BULL CEDOC
357 AVENUE PATTON
B.P.20845
49008 ANGERS CEDEX 01
FRANCE
REFERENCE
47 A2 36UJ 05
The following copyright notice protects this book under Copyright laws which prohibit such actions as, but not
limited to, copying, distributing, modifying, and making derivative works.
Copyright
Printed in France
Suggestions and criticisms concerning the form, content, and presentation of this
book are invited. A form is provided at the end of this book for this purpose.
To order additional copies of this book or other Bull Technical Publications, you
are invited to use the Ordering Form also provided at the end of this book.
The information in this document is subject to change without notice. Bull will not be liable for errors contained
herein, or for incidental or consequential damages in connection with the use of this material.
Preface
Scope and
Objectives
This manual explains the GCL interface with GCOS 7 in interactive and batch
modes.
Intended
Readers
This publication is intended for all GCOS 7 users. It complements the information
given in the IOF Terminal User's Reference Manual to which the reader must refer
for detailed information on the set of system-level commands, directives and
utilities. Other aspects for handling the system are treated in the IOF Programmer's
Manual.
Prerequisites
It describes all the essential GCL functions. The primitives dealt with are in GPL
and COBOL, and where applicable, the FORTRAN and C language equivalents are
given.
Structure
Section 1
Section 2
Section 3
Section 4
Section 5
Section 6
Section 7
47 A2 36UJ Rev05
iii
Bibliography
iv
47 A2 36UJ Rev05
Preface
Syntax
Notation
item
[ item ]
{ item1 }
{ item2 } or { item1 | item2 | item3 }
{ item3 }
or in a line separated by |
means one item must be selected. The default, if any,
heads the list and is underlined.
...
47 A2 36UJ Rev05
vi
47 A2 36UJ Rev05
Table of Contents
1.
Introduction
1.1
1.2
1.3
Expressions................................................................................................................... 1-14
1.4
1.5
1.6
1.7
1.8
47 A2 36UJ Rev05
vii
1.9
2.
viii
47 A2 36UJ Rev05
2.2
47 A2 36UJ Rev05
ix
2.2.40
2.2.41
2.2.42
2.2.43
2.2.44
2.2.45
2.2.46
2.3
47 A2 36UJ Rev05
2.3.5
2.3.6
2.3.7
2.3.8
47 A2 36UJ Rev05
xi
2.3.9
3.
xii
Command Management
3.1
3.2
3.3
3.4
47 A2 36UJ Rev05
3.5
3.6
3.7
3.8
47 A2 36UJ Rev05
xiii
3.8.29
3.8.30
3.8.31
3.8.32
3.8.33
3.8.34
3.8.35
3.8.36
3.8.37
4.
Files................................................................................................................................. 4-1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
xiv
47 A2 36UJ Rev05
5.
6.
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
Reports.......................................................................................................................... 5-35
5.9.1 Job Occurrence Report (JOR)......................................................................... 5-35
5.9.2 H_BATCH Report ............................................................................................ 5-37
Debugging
6.1
6.2
DUMP.............................................................................................................................. 6-2
6.3
47 A2 36UJ Rev05
xv
7.
xvi
Programmatic Interface
7.1
7.2
7.3
7.4
7.5
7.6
47 A2 36UJ Rev05
7.7
7.8
7.9
Index
47 A2 36UJ Rev05
xvii
xviii
47 A2 36UJ Rev05
1. Introduction
1.1
Command Language
1.1.1
47 A2 36UJ Rev05
1-1
1.1.2
Objects
Objects are the basic elements on which the commands operate. Files, libraries,
outputs, catalogs, and programs are objects, just as the user profile is.
Examples of activities that include functions and procedures to be executed on
objects are:
to create the environment that controls resources and their allocations to
1.1.3
applications
to manage files being copy, save, restore, compare, create, delete and load
to define new commands
to test programs, and to observe and change system values in the process
and to ensure the security of objects against unauthorized use.
1-2
47 A2 36UJ Rev05
Introduction
47 A2 36UJ Rev05
1-3
1.2
Global Variables
Parameters of commands and directives can be referred to either as literal values or
by symbolic names. The statement:
PRINT_FILE MYDIR.TEST.REL.FILE2
SYS.POOL.
A maximum of 100 global variables can be declared in the same procedure.
Continuing on from the above example, the following two commands would make
the variable known and assign a value to it:
GLOBAL F2 FILE
LET F2 MYDIR.TEST.REL.FILE2
Any further reference to that value can be in the form of %F2, for example:
PRINT_FILE %F2
DELETE_FILE %F2
COMPARE_FILE %F2 MYDIR.TEST.REL.FILE1
...
The percentage sign (%) introduces the reference to the value of the variable and
distinguishes it from the file name F2.
1-4
47 A2 36UJ Rev05
Introduction
1.2.1
Syntax:
{ GLOBAL }
{
}
{ GB
}
NAME=name31
[
{ CHAR
}]
[ TYPE={ BOOL | DEC | FILE | FSET | HEXA | LIB }]
[
{ NAME | OUTPUT | RFILE | STAR | VOLUME }]
[ LENGTH=dec3 ]
[ NUMVAL=( dec2 [ dec2 ])]
[ VALUES=( condition [ condition ]...)]
[ PROMPT=char40 ]
Parameters:
NAME
TYPE
47 A2 36UJ Rev05
1-5
LENGTH
CHAR
BOOL
DEC
FILE
FSET
HEXA
LIB
NAME
OUTPUT
RFILE
STAR
VOLUME
NUMVAL
Maximum
Length
255
1
31
255
255
8
255
44
255
255
88
255
Default
Length
80
1
31
44
80
8
44
31
80
80
31
80
PROMPT
1-6
47 A2 36UJ Rev05
Introduction
VALUES
Type of Condition
Form
Examples
discrete value
value
contains
{> }value
{< }value
{>=}value
{<=}value
{= }value
{> } {> }
value{ }*{ }value
{>=} {>=}
$value
starts with
/value
&9
&A
&X
^any of above
A
123
*
>2
<32
>=0
<=XYZ
=0
A<=*<H
0<*<=99
A<=*<=Z
$XYZ
$.
$',' contains a comma
/AXY
/' ' starts with space
/.
&9
&A
&X
^=*
^$XYZ
^&9
47 A2 36UJ Rev05
1-7
NOTE:
Non-numeric values are compared by their EBCDIC collating sequences.
EXAMPLES:
GLOBAL COUNT DEC 3
VALUES=>0
GLOBAL LIST
NAME 20
NUMBAL=(1,30)
VALUES=&A
GB C
GLOBAL B BOOL
boolean variable
GB D DEC
VALUES=(0 10<=*<=99) variable which is 0 or a decimal in range
10-99
Constraints:
When the GLOBAL directive is used in immediate mode (non-compiled), the
the global variables declared in the aborted procedure remain active. This way
lead to the error message "INCONSISTENT GLOBAL REDEFINITION FOR
VARIABLE MYVAR" in case of redefinition with another characteristics.
1-8
47 A2 36UJ Rev05
Introduction
In this case the global variable must be deleted by the user using the command
DLGB MYVAR.
EXAMPLE:
LOCAL N NAME;
LET N #CVNAME(#CAT(#USERID,'_TERMID'));
SCALL GLOBAL NAME=%N,TYPE=NAME;
LET %N #CVNAME(#TERMID);
LET # #VALUE(%N);
...
1.2.2
assigns the value 62 to the variable AGE. Since LET is a directive, it can be used
to change the value of a variable at any time and the change becomes effective
immediately. The next reference to the variable will be a reference to the new
value.
There is no percentage sign before the name of the variable.
The construct:
LET %VAR 3
47 A2 36UJ Rev05
1-9
The assigned value must, therefore, meet the requirements of the GLOBAL
directive that declared the variable:
if the type is incorrect, a TYPE ERROR diagnostic is returned
if the value is longer than that specified by LENGTH, a LENGTH ERROR is
returned
if the value does not satisfy the VALUES conditions, a VALUE ERROR is
returned.
EXAMPLE:
Using the declarative for AGE:
LET AGE 1234
LET AGE ABC
LET AGE -3
When the declared variable is a list, the values to be assigned are enclosed within
parentheses.
If LIST is declared, for example:
GLOBAL LIST DEC 2 NUMVAL=(3,6) VALUES=>0
a list of 3 through 6 decimal values, each one up to two digits and positive, the
directive:
LET LIST (1,3,5,7)
or
LET LIST (1 3 5 7)
If any one of the elements in the list fails to meet one of the GLOBAL
requirements (LENGTH, TYPE, VALUES) the appropriate diagnostic is returned.
1-10
47 A2 36UJ Rev05
Introduction
1.2.3
Types
Since GCL is a typed language, the assignments and references of variables and
expressions must be consistent with their type. For example, if AGE is decimal,
assigning the name of a file to it will result in an error diagnostic. The twelve types
in GCL are:
BOOL
CHAR
DEC
FILE
FSET
HEXA
LIB
NAME
OUTPUT
RFILE
STAR
VOLUME
Boolean value 0 or 1
Character string, quoted or unquoted
Decimal value, signed or unsigned
File for example, A.B.FILE or A.B.MYLIB..SF
Fileset for example, A.*.B
Hexadecimal value for example, A23F
Library for example, A.B.MYLIB
Name for example, JOE, A-B, MYPG
Output for example, X123:2:1
Remote File for example, $LYON:A.B.C
Star-Name for example, A*B
Volume for example, VOL2:MS/D500
A literal value assigned to a variable must be valid for the type of variable.
One variable can be assigned the value of another variable by the following
construct:
LET V1 %V2
where the variable V1 is assigned the current value of the variable V2. In this case,
the variables V1 and V2 must be of the same type. A limited number of implicit
conversions are supported by GCL. These are summarized in the following
diagram:
---^---------^---------^-------CHAR--------^---------^---------^-|
|
|
|
|
|
|
|
|
|
|
|
|
|
OUTPUT
VOLUME
DEC
RFILE
FSET
STAR
HEXA
^
|
|
^
|
|
|
|
|
+----^----+
|
BOOL
|
NAME
|
FILE
^
|
|
LIB
47 A2 36UJ Rev05
1-11
If C is a variable, say CHAR, whose current value is a valid for a DEC value, then
assign it to AGE. Otherwise return a TYPE ERROR. A set of dedicated builtin
functions ensures whether a given variable has a value that is acceptable to a
variable of another type.
LET B #ISITDEC(%C)
will assign the boolean variable B the value 1 if the value of C is a valid for a DEC
value. Otherwise, it will assign the boolean value 0.
1.2.4
References to Variables
In all commands and directives, a value that can be specified for a parameter can be
replaced by a reference to a variable as in the examples above. The actual process
used involves substituting the current value of the variable for its reference
wherever it appears.
References to variables are introduced by a percentage sign (%) to distinguish them
from literal name values. The value denoted by the variable must be acceptable in
the context where it is used, otherwise an error diagnostic is reported. For
example:
CLEAR_LIBRARY %B
where B is a boolean value cannot be accepted since a boolean value is not treated
as a library.
Using lists is illustrated in the following example.
The COBOL command accepts as its first parameter a list of names or star-names
denoting the names of source COBOL programs to be compiled. The line coding:
COBOL (A B C)
1-12
47 A2 36UJ Rev05
Introduction
requests the compilation of three source COBOL programs. Assuming that three
following global variables have been declared:
GLOBAL G1 NAME
GLOBAL G2 NAME
GLOBAL L NAME NUMVAL=(0,4)
resulting in two scalar name variables G1 and G2, and L a list of up to four names.
Assuming that the following assignments have taken place:
LET G1 A
LET G2 B
LET L (C D E)
then:
COBOL %G1
COBOL %G2
COBOL %L
COBOL (%G1 %G2)
COBOL (%L %G1)
COBOL (%G2 X Y %L)
Local and global variables referenced in a procedure must be declared either in the
procedure or before the procedure is activated. A sequence of GCL statements
executed through the GCL command EXECUTE_GCL is similar to a called
procedure. The variables declared in the sequence are not known to the procedure
that executes the EXECUTE_GCL.
The following sequence is correct:
PROCEDURE A;
GLOBAL G.....;
CALL B;
PROCEDURE B;
Local V...;
LET V %G;
ENDPROC;
47 A2 36UJ Rev05
PROCEDURE B;
GLOBAL G.....;
ENDPROC;
1-13
1.3
Expressions
Variables can be operated on and combined into expressions to build new values.
In GCL, expressions are created from builtin functions. A builtin function is
denoted by #, followed by a name and an optional list of arguments enclosed
within parentheses, e.g.:
LET AGE #PLUS(%AGE,1)
assigns to the variable AGE the value of the variable AGE plus 1 to increments the
value of AGE. In this example, #PLUS is a builtin function with two arguments.
Builtin functions can have any number of arguments. Following are some
examples:
#TIME and #DATE
#LENGTH(a)
1-14
47 A2 36UJ Rev05
Introduction
Implicit and explicit conversion rules are the same as for the assignment of
variables.
Wherever a variable may be used, an expression in the form of a builtin function
can also be used. This also applies to lists, where a builtin may be used to denote a
list or a single element within a list:
LET LIST (6 3 #PLUS(4,3) #MINUS(6,2))
47 A2 36UJ Rev05
1-15
1.4
displays the value of the variable LIST. The expression to the right of # can be as
complex as necessary.
The # alone is a particular instance of a system variable denoting the current line
on the output device being either the IOF terminal, or SYSOUT or PRTFILE in
batch. Assigning a value to it results in printing that value on the output device.
For IOF:
When used in an expression like:
#PLUS (#,1)
1 is added to a value which is to be entered at the terminal. Enter the value when
the prompt #? appears. The value keyed in will replace # in the expression, and
evaluation continues. In this particular case, the value entered must be numeric to
be acceptable to the #PLUS builtin.
The most use of # in an expression is in constructs like:
LET V #
1-16
47 A2 36UJ Rev05
Introduction
For Batch:
'LET V #' cannot be used.
To assign to a variable, a value read in from the terminal of the job submitter, use
'READ_FROM_CONSOLE'.
47 A2 36UJ Rev05
1-17
1.5
This task can be repeatedly performed for as many times as there are different
programs and files.
The following sequence of GCL commands stored in a source library:
COBOL %P
LINK %P
EXEC_PG %P FILE1=IFN1 ASG1=%F
PRINT_FILE %F
See IOF Terminal User's Reference Manual for the description and syntax of these
commands.
1-18
47 A2 36UJ Rev05
Introduction
1.5.1
ALTER_INPUT Command
The ALTER_INPUT command allows replacing entries normally keyed in at the
terminal by entries in a file. The entry stream that can be executed by
ALTER_INPUT can contain:
commands belonging to levels S: and C:
and data to be processed by a processor at level I:, for example.
The entry stream can be parameterized using Global Variables which are
referenced in the commands to be executed but not in the data.
In the preceding example:
two Global Variables must be declared:
GLOBAL P NAME;
GLOBAL F FILE;
their desired values allocated:
LET P MYPG;
LET F .MYFILE;
and the sequence executed by:
ALTER_INPUT TEST or AI TEST;
47 A2 36UJ Rev05
1-19
1.5.2
EXECUTE_GCL Command
When in the current domain, the EXECUTE_GCL command allows executing:
commands of the current domain
all the directives
and all basic GCL commands.
At level S:, the EXECUTE_GCL command allows executing:
all the commands in the IOF domain
all the directives in the H_NOCTX domain
and all basic GCL commands.
At level C: of MNLIB SL, the EXECUTE_GCL command allows executing:
all the commands in the LIBMAINT_SL domain
all the directives in the H_NOCTX domain
and all basic GCL commands.
1-20
47 A2 36UJ Rev05
Introduction
1.6
STARTUP Sequences
IOF offers a facility whereby a stored sequence of commands or lines can be
automatically executed when the user logs on. This sequence is known as a startup
sequence. Startup sequences can be defined at system, project, and user levels.
Their execution may be mandatory or optional.
A typical use of a startup sequence would be to place the user under the control of
a certain processor without having to request it.
An optional startup sequence can be bypassed. (Mandatory sequences may not be
bypassed except by the project SYSADMIN.)
1.6.1
IOF Startups
Startup sequences are described in IOF Terminal User's Reference Manual.
When the user logs on to IOF, the system simulates an AI directive to the startup
sequence of the user or the project associated with the user. In the startup sequence
all the commands required can be stored to set the user's normal operating context.
Following is an annotated example of what a project level startup might look like:
LET # 'BEGINNING OF PROJECT XYZ STARTUP'; issue a message
modify elements of
MDP NOVICE=0 GCLFORM=LINE;
profile
MWINLIB SL .REF
MWLIB SL <WORK
MWINLIB BIN .CMDS
MWLIB BIN X$TEMPRY
$$AI
$$AI
$$AI
$$AI
$$AI
>JONES IF=#EQ(JONES,#USERID)
>HENRY IF=#EQ(HENRY,#USERID)
NORMAL-STUFF
SPECIAL-STUFF IF=some-condition
>END
$JONES:
MWLIB BIN .JONES.SPECIAL
PASCAL
$$AI >END
47 A2 36UJ Rev05
1-21
$HENRY:
MAIL OFF
MWLIB CU .CU.REF
MWINLIB CU .CU.WORK
MWLIB LM .LMS
$END:
issue a message
define the working libraries
and other common rules
issue a message
command.
Startups are solely at the discretion of the system administrator.
1-22
47 A2 36UJ Rev05
Introduction
1.6.2
Batch Startups
For GCL batch jobs, specific startups are executed before the execution of the
submitted GCL sequence but after its compilation. As in IOF, 2 startup sequences
can be attached to a Project in the catalog, namely, a mandatory startup and an
optional one.
Possible startups are:
a) SITE_GCL_B
b) project_GCL_B
c) project_user_GCL_B.
In a batch startup:
the following can be used:
commands of the IOF domain
directives
and operator commands through EXDIR.
however, the following may not be used:
GCL basic commands, however, the EXECUTE_GCL command is authorized
47 A2 36UJ Rev05
1-23
1.7
one of the user's input binary libraries defined by the MWINLIB BIN command,
the command is immediately accessible to that user.
1.7.1
1-24
47 A2 36UJ Rev05
Introduction
definition in a library that is in the search path of all its potential users by
including a suitable MWINLIB BIN command in the startup sequence common
to all these users
if the command is to be used by all the users of an installation, store the
definition
either in the SYS.HBINLIB library to which only the System Administrator
has write access
or in any other library that is in all users' search paths, possibly by including a
reference to it in a MWINLIB BIN command in the site-level startup
sequence.
The number of binary libraries allowed in the GCL search path as well as
SYS.HBINLIB depends on the GCL15BIN CONFIG parameter declared at
GCOS 7 system configuration. At execution, GCL can process a maximum of
4,090 command names or aliases, and a maximum of 3,276 prompts.
When a command is keyed in at the terminal:
the system looks for its definition in the user's binary library input search path, if
any, in the order in which the search path is defined in the MWINLIB BIN
command, first INLIB1, then INLIB2 and lastly INLIB3 or INLIB15 until it
finds a definition of that name
if the search fails, the definition is taken from the system library SYS.HBINLIB
47 A2 36UJ Rev05
1-25
then:
results in:
1-26
47 A2 36UJ Rev05
Introduction
1.7.2
MAINTAIN_COMMAND
MAINTAIN_COMMAND (MNCMD) is the compiler for command definitions. It
is described in Section 3.
MAINTAIN_COMMAND enables working on a copy of a command definition
held in a workspace and not operating on it directly. Handling the workspace
involves:
storing the workspace contents in the binary library through the SAVE or
RESAVE command
loading the command definition from the library into the workspace through the
LOAD command.
Command definition proceeds as follows:
creating the command in the workspace through the CREATE command
adding lines in the workspace through the APPEND command
and editing the contents of the workspace through the LEDIT command.
belongs
LIST the names of the commands of a particular domain
and PRINT the definition of a particular command.
Up to 2045 command names or aliases may be compiled in the same binary library
(BINLIB) for the same domain.
47 A2 36UJ Rev05
1-27
1.7.3
GCL Procedures
A command is defined by a GCL procedure consisting of a sequence of GCL
commands embedded between a PROC and an ENDPROC command.
The commands that can appear within a procedure are the following:
dedicated GCL procedure commands dealt with in Section 2
directives treated in the IOF Terminal User's Reference Manual
any system-supplied or user-defined command that belongs to the domain of the
EXAMPLE:
PROC (SORT_NAMES SRTN)
PROMPT='to sort out the list of user names';
A GCL procedure created with the same name as a system GCL command such as
CBL, will override the system command which will no longer be available.
1-28
47 A2 36UJ Rev05
Introduction
KWD Command
The KWD command:
introduces each parameter of the command
provides
the name of the parameter with its possible abbreviations
type
length
and shape
the condition that it should satisfy
its default value, if any
and a short explanatory text for display alongside the screen or serial prompt.
EXAMPLE:
KWD ORDER NAME 4
VALUES=(ASC DESC) DEFAULT=ASC
PROMPT='ASCending or DESCending order?';
defines a parameter named ORDER that can take values ASC or DESC, the first
being its default value.
LOCAL Command
The LOCAL command defines variables that are local to the procedure.
GLOBAL Command
The GLOBAL command defines variables that pertain to the entire interactive
session. A maximum of 100 variables may be declared or referenced in the same
GCL procedure.
47 A2 36UJ Rev05
1-29
CONTROL Command
The CONTROL command specifies:
further controls that must be satisfied for the parameters to be accepted
the conditions under which check is made
and the message to be issued if it fails.
EXAMPLE:
CONTROL WHEN=#EXIST(K1)
CHECK=#NOT(#EXIST(K2))
MSSG='K1 and K2 are mutually exclusive';
will check that two parameters K1 and K2 may not be simultaneously specified.
Other Commands
Structuring commands may be used to direct the flow of control within the
procedure such as:
IF
ELSE
ENDIF
WHILE
UNTIL
GOTO.
Calling commands such as SCALL and VCALL can be activated in the procedure.
ENDPROC must be the last command in the definition and serves as a RETURN
command, if none is explicitly specified.
1-30
47 A2 36UJ Rev05
Introduction
for a procedure is 64K, although no element of the procedure can exceed 32K.
An example of an element is a group of executable statements or the zones
reserved for KWD and LOCAL.
Due to the optimization done by the GCL compiler, it is not possible to compute
the size of the elements of a procedure. If, during the compilation phase, an
error message beginning with "TOO MANY" appears, you must split the
procedure into several smaller ones.
47 A2 36UJ Rev05
1-31
1.7.4
Its result is always the boolean 1. The following procedure will create a new
directive that will solve the problem of keeping the connection alive even when the
terminal is inactive.
PROC (KEEP_LINE,KLN)
PROMPT='keep the line active';
LOCAL B BOOL;
LET B #KLN(60,'I am busy');
ENDPROC;
Once compiled and stored in the H_NOCTX domain of a suitable library, the KLN
directive becomes available for use at system level:
within any processor
or as a directive by prefixing it with the directive identifier:
$$KLN
An optional parameter allows further control over the frequency at which the
message is issued.
PROC (KEEP_LINE KLN)
PROMPT='keep the line active';
KWD (FREQUENCY FREQ)
DEC 3 VALUES=>0
PROMPT='frequency, in seconds';
LOCAL B BOOL;
IF #NOT(#EXIST(FREQ));
LET FREQ 60;
ENDIF;
LET B #KLN(%FREQ,'I am busy');
ENDPROC;
1-32
47 A2 36UJ Rev05
Introduction
is 3 positive decimals
the three commands starting with the IF command assign a default value to the
builtin #KLN.
the new KLN directive may then be used as:
or
meaning 60 seconds
$$KLN
$$KLN 30
$$KLN FREQ=30
47 A2 36UJ Rev05
1-33
1.7.5
Linking will proceed even if the compilation has failed. This can be avoided by
entering the following three lines after the COBOL command:
IF #GE(#SEV,3);
ABORT 'Compilation fails';
ENDIF;
which will abort the procedure with a suitable message, if the severity level of the
compilation is 3 or more.
The above command covers the case when only one program is to be linked in the
load module. The next example shows several source programs to be linked in a
single load module, the first program named being the main program:
PROC (COMPILE_LINK CLC)
PROMPT='Compile and link';
KWD PROG NAME 32 NUMVAL=(1,16)
PROMPT='Programs (first is main)';
COBOL %PROG;
IF #GE(#SEV,3);
ABORT 'Compilation fails';
ENDIF;
LINK #ELEM(%PROG,1);
ENDPROC;
1-34
47 A2 36UJ Rev05
Introduction
In this example:
NUMVAL=(1,16) declares PROG as accepting up to 16 names
the COBOL command compiles all source programs, the first one provided as
In this example:
the UNLIST command performs the following:
extracts each name of the list PROG
assigns it to the local variable LN
and iterates the processing that follows up to the ENDUNLIST command, for
list is processed
if the command is to cease executing if a compilation fails, the corresponding
47 A2 36UJ Rev05
1-35
1.8
Absentee Jobs
The submission of system-level commands for execution in batch, in parallel with
the interactive session is described in the IOF Terminal User's Reference Manual.
Commands that can be so submitted are not restricted to the system-supplied ones.
User-defined commands in the IOF domain can also be submitted such as:
EJ PROC=CLS VALUES=MYPG;
EJ PROC=CLS VALUES=(PROG=(X1,X2,X3));
Search rules also apply in that case. When the parameter LIB is not specified in
the EJ directive, commands are searched for in the binary input libraries defined by
the MWINLIB BIN command.
It is recommended that the default binary output library be defined as being also
the first one of the binary input libraries.
Thus commands created by use of MAINTAIN_COMMAND become immediately
available for interactive absentee execution.
MWLIB
BIN .MYBLIB;
MWINLIB BIN (.MYBLIB, others...);
When absentee mode is used, the cataloged binary input libraries must be
cataloged:
either in an auto-attachable catalog
or in the SYS.CATALOG or SITE.CATALOG.
Constraints:
When absentee mode is used, the switch number 2 cannot be used in user
commands as it is reserved for the system.
1-36
47 A2 36UJ Rev05
Introduction
1.9
SYS.SPOOL Files
1.9.1
MAINTAIN_COMMAND processor.
1.9.2
Shared Code:
Shared Code corresponds to commands of pre-initialized domains regularly used
by GCOS 7:
The shared code is loaded from system library SYS.HBINLIB into each of the
SYS.SPOOL files during every RESTORE of the system. This code is preserved
in the SYS.SPOOL files. It is reloaded:
at RESTORE
if command SPOOL is specified at RESTART
if a command of a pre-initialized domain is modified in SYS.HBINLIB and if no
47 A2 36UJ Rev05
1-37
It is retained:
until the end of the IOF session
on termination of the job
or until execution of the next MWINLIB BIN command.
1.9.3
1-38
47 A2 36UJ Rev05
Introduction
1.9.4
1.9.5
Access Rights
All users must be authorized READ and WRITE access to the SYS.SPOOL files.
1.9.6
domains
and specifies the size and use of GCL cache.
the commands reserved for the Main Operator are:
DISPLAY_GCL_CACHE
HOLD_GCL_CACHE
and RELEASE_GCL_CACHE.
the command DISPLAY_GCL_INFO which displays for each SYS.SPOOL file:
its size
its contents
and the percentage of space used.
47 A2 36UJ Rev05
1-39
1-40
47 A2 36UJ Rev05
2.1
47 A2 36UJ Rev05
ENDUNTIL
ENDWHILE
GOTO
IF
KWD
LABEL
LOCAL
OTHER (OTHERWISE)
OTHERWISE
PROC
RETRY
RETURN
SCALL
SYSTEM
UNLIST
UNTIL
VCALL
VCHAIN
WHILE
2-1
Conditional
CASE
CASEOF
ELSE
ENDCASEOF
ENDIF
ENDUNLIST
ENDUNTIL
ENDWHILE
IF
GOTO
OTHER
OTHERWISE
UNLIST
UNTIL
WHILE
When the command entered is not a basic GCL command, an implicit "CALL" is
generated.
Declarative commands introduce the objects such as variables, parameters and
labels that are handled by procedures.
Conditional commands direct the flow of control such as jumps, loops and choices
through the body of the procedure.
Linkage commands define the relations of the current procedure to other
procedures that it can use.
A GLOBAL directive is considered a declarative command inside a GCL
procedure as a LOCAL basic GCL command. This means that the declared
variable is known at command call, wherever the GLOBAL statement appears in
the GCL procedure. So the sequence:
PROC NEWCOM;
DLGB;
GLOBAL NEWVAR CHAR 10;
LET NEWVAR #;
ENDPROC;
2-2
47 A2 36UJ Rev05
This means too that LOCAL and GLOBAL variables must be declared before
executing a command that references them. So the sequence:
PROC COM1;
CALL COM2;
LET # %NEWVAR;
ENDPROC;
PROC COM2;
GLOBAL NEWVAR;
LET NEWVAR #;
ENDPROC;
CASEOF...ENDCASEOF
IF...ENDIF
PROC...ENDPROC
UNLIST...ENDUNLIST
UNTIL...ENDUNTIL
WHILE...ENDWHILE.
valid nesting
+----| IF ....
|
|
+--|
| |
| |
| | WHILE ....
| |
| | ENDIF;
| +----|
|
|
| ENDWHILE;
|
+----
invalid nesting
When a command is executing, all blocks that contain the command are active.
Transferring control from within an active block to an inactive one is not allowed.
47 A2 36UJ Rev05
2-3
statement lines)
irrespective of the current setting of the format (line or free). All other rules that
pertain to GCL commands also apply to the GCL basic commands.
Before a GCL procedure can be used, it must be compiled by means of the
MAINTAIN_COMMAND (MNCMD) processor whose commands are described
in Section 3. Examples of procedures, and general hints may be found in
Paragraph "Creating new GCL Commands".
2-4
47 A2 36UJ Rev05
2.1.1
ABORT
Purpose:
To abort the execution of the procedure. If the procedure is called by a sequence of
procedure calls, all of the calling procedures abort. A new command is then
requested from the input stream or from the user's terminal. A message can be
specified to report the abort of the procedure.
Syntax:
ABORT
[ MESSAGE=char78 ]
[{ SEVERITY | SEV }=dec1 ]
Parameters:
MESSAGE
SEVERITY
Constraints:
None
Examples:
ABORT;
no message issued
literal message
ABORT %ABTMESS;
message is a variable
message is an expression
47 A2 36UJ Rev05
2-5
2.1.2
CASE
Purpose:
Denotes the beginning of a clause consisting of one or more commands in a
CASEOF block, and ending with:
another clause introduced by a new CASE
an OTHERWISE command
or an ENDCASEOF command.
Syntax:
CASE
EXPRESSION=( expression [ expression ]...)
Parameters:
EXPRESSION
Constraints:
CASE must be included within a CASEOF block.
Once CASE has been executed, control passes to the command following
ENDCASEOF.
If no match is found among the CASE expressions, OTHERWISE is executed.
2-6
47 A2 36UJ Rev05
Examples:
CASE -1;
CASE (1,2,3,100);
CASE #PLUS(%X,%Y);
CASE (0,#MINUS(#PL,%RNG));
matches:
CASEOF expresssion=0
CASEOF expresssion=#PL - %RNG}
47 A2 36UJ Rev05
2-7
2.1.3
CASEOF
Purpose:
To head a CASEOF block, several of which can be nested. Depending on the
expression the next command to be executed, is:
either CASE
or OTHERWISE.
Syntax:
CASEOF
EXPRESSION=expression
Parameters:
EXPRESSION
Constraints:
CASEOF must be matched by ENDCASEOF to denote the end of the block
CASEOF can only be followed by:
CASE
or OTHERWISE
or ENDCASEOF.
No other command may appear immediately after the CASEOF.
Example:
CASEOF %I;
CASE 1;
LET VAR 3;
CASE (3, 4, 5);
LET VAR 9;
OTHERWISE;
LET VAR 0;
ENDCASEOF;
2-8
47 A2 36UJ Rev05
2.1.4
CHAIN
Purpose:
Activates the named procedure by continuing from the procedure currently
executing. When the chained procedure terminates, control passes to the command
following the one that initiated the procedure containing CHAIN.
Syntax:
CHAIN
COMMAND=command-name31
[ parameter-reference ]...
Parameters:
COMMAND
parameter-reference
Constraints:
All parameters specified must agree in type, number, length and value with their
47 A2 36UJ Rev05
2-9
Example:
PROC P;
+-------> PROC Q;
+------> PROC R;
.
|
.
|
.
.
|
.
|
.
.
|
.
|
.
CALL Q; ------+
.
|
.
CHAIN R; ------+
.
.
RETURN; ------+
COMMAND 2 <------+
.
.
|
.
|
.
.
|
.
|
.
.
|
.
|
ENDPROC;
ENDPROC;
|
ENDPROC;
|
|
+--------------------------------------------+
2-10
47 A2 36UJ Rev05
2.1.5
CONTROL
Purpose:
Specifies global checks to be performed on procedure parameters or other variables
before execution of the procedure starts.
Syntax:
CONTROL
CHECK=( bool [ bool ]...)
{ MSSG }
{
}=char78
{ MSG }
[ WHEN=( bool [ bool ]...)]
Parameters:
CHECK
MSSG
WHEN
Constraints:
All checks specified in the KWD statements are verified before the procedure
executes.
The check fails if the condition in CHECK is not 1, resulting in the following:
the procedure aborts
and the message specified in MSSG is displayed.
In case of an UNLOCKED procedure, CONTROL messages can be prefixed by
47 A2 36UJ Rev05
2-11
Examples:
CONTROL
WHEN=#EXIST(COMMAND)
CHECK=#NOT(#EXIST(COMFILE))
MSSG='COMMAND AND COMFILE ARE MUTUALLY EXCLUSIVE';
CHECK=#GT(%MAXVAL,%MINVAL)
MSSG='MAXVAL MUST BE GREATER THAN MINVAL';
execution.
2-12
47 A2 36UJ Rev05
2.1.6
ELSE
Purpose:
Denotes an alternative in an IF block.
Syntax:
ELSE
Parameters:
None
Constraints:
The conditional expression in IF command is evaluated as follows:
if =1, the commands following IF execute but those following ELSE are
skipped
if =0, control is transferred to the command following ELSE, if any.
ELSE must be within an IF block.
Examples:
IF #EQ(%A,%B);
IF #EQ(%A,%C);
LET X %Y;
ELSE;
LET X %Z;
ENDIF;
ENDIF;
IF #EQ(%A,%B);
IF #EQ(%A,%C);
LET X %Y;
ENDIF;
ELSE;
LET X %Z;
ENDIF;
47 A2 36UJ Rev05
2-13
2.1.7
ENDCASEOF
Purpose:
Denotes the end of a CASEOF block.
Syntax:
ENDCASEOF
Parameters:
None.
Constraints:
ENDCASEOF must match its corresponding CASEOF that heads the block.
Example:
CASEOF %KIND;
if %KIND=AVERAGE execute command(s) following
CASE AVERAGE;
CALL AVERAGE;
CASE STATISTIC; if %KIND=STATISTIC execute command(s) following
CALL STATISTIC;
if %KIND=CHECK execute command(s) following
CASE CHECK;
CALL CHECK;
otherwise execute command(s) following
OTHER;
CALL ERROR;
ENDCASEOF;
2-14
47 A2 36UJ Rev05
2.1.8
ENDIF
Purpose:
Denotes the end of an IF block.
Syntax:
ENDIF
Parameters:
None.
Constraints:
ENDIF must match its corresponding IF that heads the block.
Example:
IF #EQ(%K,TRUE);
LET # TRUE;
ELSE;
LET # FALSE;
ENDIF;
47 A2 36UJ Rev05
2-15
2.1.9
ENDPROC
Purpose:
Denotes the end of a procedure.
Syntax:
ENDPROC
Parameters:
None
Constraints:
Each procedure must begin with PROC and end with ENDPROC.
Example:
PROC P ....;
. }
. } commands that define procedure P
. }
ENDPROC;
2-16
47 A2 36UJ Rev05
2.1.10
ENDUNLIST
Purpose:
Denotes the end of an UNLIST block.
Syntax:
ENDUNLIST
Parameters:
None
Constraints:
ENDUNLIST must match UNLIST that heads the block.
Example:
UNLIST ITEM %LIST;
. }
. } sequence of commands to be repeatedly executed until all
. } elements of LIST have been supplied to variable ITEM
. }
ENDUNLIST;
47 A2 36UJ Rev05
2-17
2.1.11
ENDUNTIL
Purpose:
Denotes the end of an UNTIL block.
Syntax:
ENDUNTIL
Parameters:
None
Constraints:
ENDUNTIL must match its corresponding UNTIL that heads the block.
Example:
UNTIL #OR (#LT(%A,0), #EQ(%S, STOP));
. }
. } sequence of commands to be repeatedly
. } executed until %A<0 or %S=STOP
. }
ENDUNTIL;
2-18
47 A2 36UJ Rev05
2.1.12
ENDWHILE
Purpose:
Denotes the end of a WHILE block.
Syntax:
ENDWHILE
Parameters:
None.
Constraints:
ENDWHILE must match its corresponding WHILE that heads the block.
Example:
WHILE #OR (#EQ(%I,0), #EQ(%I,1));
. }
. } sequence of commands to be repeatedly
. } executed while %I=0 or 1
. }
ENDWHILE;
47 A2 36UJ Rev05
2-19
2.1.13
GOTO
Purpose:
Modifies the flow of execution by branching to a label defined by a LABEL
command.
Syntax:
GOTO
LABEL=label-name31
Parameter:
LABEL
Constraints:
The label must be unique within the procedure defined by LABEL in:
either the same active block
or an active outer block which includes the current block.
2-20
47 A2 36UJ Rev05
Examples:
GOTO ERROR;
branch to ERROR
GOTO SCAN_INPUT;
branch to SCAN_INPUT
GOTO END_OF_PROCESS;
branch to END_OF_PROCESS
47 A2 36UJ Rev05
+----|
| +---| |
| |
| | GOTO --+--+
| |
| |
| |
| |
| |
<--+ |
| +---|
|
|
|
|
|
|
|
<-----+
|
+-----
+----|
|---| |
| |
| | GOTO ---+
| |
|
| |
|
| +---|
| +---|
| |
|
| |
<--| |
| +---|
+-----
valid branches
invalid branches
2-21
2.1.14
IF
Purpose:
Tests the value of a specified expression in an IF block to control the flow of
execution according to the result of the test. IF blocks can be nested.
Syntax:
IF
Parameter:
CONDITION
Constraints:
Conditions are evaluated as follows:
if all conditions =1:
2-22
47 A2 36UJ Rev05
Examples:
IF #EQ(%A,%B)
. }
. } commands to be executed if %A = %B
. }
ENDIF;
. }
. } commands to be executed whether %A=%B or not
. }
.
IF #GT(%C,%D);
. }
. } commands to be executed if %C>%D
. }
ELSE;
. }
. } commands to be executed if %C<=%D
. }
ENDIF;
47 A2 36UJ Rev05
2-23
2.1.15
KWD
Purpose:
Defines the name and characteristics of a keyword being a procedure argument.
Syntax:
KWD
NAME=( name31 [ name31 ]...)
[
{ CHAR
}]
[ TYPE={ BOOL | DEC | FILE | FSET | HEXA | LIB }]
[
{ NAME | OUTPUT | RFILE | STAR | VOLUME }]
[ LENGTH=dec3 ]
[ NUMVAL=( dec2 [ dec2 ])]
[ DEFAULT=( value78 [ value78 ]...)]
[ VALUES=( condition [ condition ]...)]
[ PROMPT=char40 ]
[ NOTE=( char78 [ char78 [ char78 ]])]
[ HELP=name30 ]
[{ MSG | MSSG }=char78 ]
[ ASK=dec2 ]
[ CONCEAL=bool ]
[{ DLGTH | DISPLAY_LENGTH }=dec3 ]
2-24
47 A2 36UJ Rev05
Parameters:
NAME
Lists up to 32 names:
the first being the main name for the keyword
the following being aliases.
LENGTH
CHAR
BOOL
DEC
FILE
FSET
HEXA
LIB
NAME
OUTPUT
RFILE
STAR
VOLUME
Maximum
Length
255
1
31
255
255
8
255
44
255
255
88
255
Default
Length
80
1
31
44
80
8
44
31
80
80
31
80
NUMVAL
DEFAULT
47 A2 36UJ Rev05
2-25
2-26
47 A2 36UJ Rev05
Example:
VALUES=(&9 * $/) means applies to a variable
which starts with a digit, or is an asterisk or contains a
slash.
Type of Condition
discrete value
Form
value
Examples
A
123
*
>2
<32
>=0
<=XYZ
=0
100>*>=10
0>*>=-20
{> }value
{< }value
{>=}value
{<=}value
{= }value
{> } {> }
value{ }*{ }value
{>=} {>=}
contains
{< } {< }
value{ }*{ }value
{<=} {<=}
$value
starts with
/value
&9
&A
&X
^any of above
A<=*<H
0<*<=99
A<=*<=Z
$XYZ
$.
$',' contains a comma
/AXY
/' ' starts with space
/.
&9
&A
&X
^=*
^$XYZ
^&9
NOTE:
Non-numeric values are compared by their EBCDIC collating sequences.
PROMPT
47 A2 36UJ Rev05
2-27
Example:
GLOBAL X DEC 3 PROMPT='Your age?'
LET X #
Your age?
NOTE
HELP
MSSG
ASK
Default: NUMVALmax
CONCEAL
=1
=0
DISPLAY_LENGTH
NOTES:
Keywords with NUMVAL min >0 are called, mandatory keywords.
Keywords with NUMVAL min =0 and ASK = 1 are called, optional keywords.
Keywords with NUMVAL min =0 and ASK = 0 are called, optional hidden
keywords.
2-28
47 A2 36UJ Rev05
Constraints:
Restrictions on values are:
Each keyword is treated as a Local Variable within the procedure in which it
is defined.
A keyword can be referenced positionally, namely, %1, %2, %3...:
LENGTH.
The number of fields prompted is specified by ASK and cannot exceed one
screen.
Restrictions on keywords declaration order:
mandatory keywords must be declared first.
optional keywords must be declared next.
optional hidden keywords must be declared at the end.
47 A2 36UJ Rev05
2-29
Examples:
KWD (PRINTING-WIDTH,PW) DEC;
KWD C;
KWD B BOOL;
boolean variable
through 99
KWD PAGES DEC LENGTH=2
if decimal variable not between 1
DEFAULT=1 VALUES=1<=*<99
and 98 (default 1), issue error message
PROMPT='Number of Pages'
MSSG='Invalid number of Pages';
KWD CLASS LENGTH=5 DEFAULT=ALL character variable list
with default value ALL and
NUMVAL=(0,8)
three lines of text
NOTE:=('BUILTIN CLASS:',
before the keyword PROMPT
'ALL RELAT BOOL CHAR',
'LIST OBMGT IS_IT ARITH')
PROMPT='SELECT ONE OF 8 CLASSES';
KWD KIND NUMVAL=(3,15)
HELP=HELP-KIND
ASK=3;
KWD PASSWORD LENGTH=3 CONCEAL;
2-30
47 A2 36UJ Rev05
2.1.16
LABEL
Purpose:
Defines a label referred to in a GOTO command.
Syntax:
LABEL
LABEL = label_name_31
Parameter:
LABEL
Constraints:
The label name must be unique within the procedure in which it is defined.
Example:
IF #EXIST (NM);
GOTO RTRY;
.
.
.
LABEL RTRY;
RETRY MSSG='Name specified already exists: reenter name';
47 A2 36UJ Rev05
2-31
2.1.17
LOCAL
Purpose:
Defines a local GCL variable.
Syntax:
LOCAL
NAME=name31
[
{ CHAR
}]
[ TYPE={ BOOL | DEC | FILE | FSET | HEXA | LIB }]
[
{ NAME | OUTPUT | RFILE | STAR | VOLUME }]
[ LENGTH=dec3 ]
[ NUMVAL=( dec2 [ dec2 ])]
[ DEFAULT=( value78 [ value78 ]...)]
[ VALUES=( condition [ condition ]...)]
[ PROMPT=char40 ]
2-32
47 A2 36UJ Rev05
Parameters:
NAME
TYPE
LENGTH
CHAR
BOOL
DEC
FILE
FSET
HEXA
LIB
NAME
OUTPUT
RFILE
STAR
VOLUME
NUMVAL
Maximum
Length
255
1
31
255
255
8
255
44
255
255
88
255
Default
Length
80
1
31
44
80
8
44
31
80
80
31
80
DEFAULT
47 A2 36UJ Rev05
2-33
Example:
GLOBAL X DEC 3 PROMPT='Your age?'
LET X #
Your age?
VALUES
2-34
47 A2 36UJ Rev05
Example:
VALUES=(&9 * $/) means applies to a variable
which starts with a digit, or is an asterisk or contains a
slash.
Type of Condition
discrete value
Form
value
{> }value
{< }value
{>=}value
{<=}value
{= }value
{> } {> }
value{ }*{ }value
{>=} {>=}
contains
{< } {< }
value{ }*{ }value
{<=} {<=}
$value
starts with
/value
&9
&A
&X
^any of above
Examples
A
123
*
>2
<32
>=0
<=XYZ
=0
100>*>=10
0>*>=-20
A<=*<H
0<*<=99
A<=*<=Z
$XYZ
$.
$',' contains a comma
/AXY
/' ' starts with space
/.
&9
&A
&X
^=*
^$XYZ
^&9
NOTE:
Non-numeric values are compared by their EBCDIC collating sequences.
47 A2 36UJ Rev05
2-35
Constraints:
Expressions are not allowed for parameters in LOCAL. Only literal values can
be assigned.
During a session, more than one keyword with the same name can be active:
only the most local one accessed
the others are masked for the duration of the procedures redefining them.
Examples:
LOCAL COUNT DEC 3
VALUES=>0;
LOCAL C;
LOCAL B BOOL;
LOCAL D DEC
VALUES=(0 10<=*<=99);
2-36
47 A2 36UJ Rev05
2.1.18
OTHERWISE (OTHER)
Purpose:
Denotes the beginning of an OTHERWISE clause in a CASEOF block. If
CASEOF values do not match any CASE values, OTHERWISE is executed.
Syntax:
{ OTHERWISE }
{
}
{ OTHER
}
Parameters:
None.
Constraints:
Restrictions on positioning and processing:
OTHERWISE must be within a CASEOF block and must come after all CASEs
If OTHERWISE is omitted, and no match is found among CASE expressions,
47 A2 36UJ Rev05
2-37
2.1.19
PROC
Purpose:
Heads a procedure definition and defines its characteristics.
Syntax:
PROC
NAME=( name31 [ name31 ]...)
[ PROMPT=char40 ]
[ HELP=name31 ]
[{ PRTY | PRIORITY }={ 0 | dec3 }]
[ ACCESS={ -1 | ( dec3 [ dec3 ]...)}]
[ HIDE={ 0 | ( dec3 [ dec3 ]...)}]
[ OPACC=( dec2 [ dec2 ]...)]
[ OPHID={ 0 | ( dec2 [ dec2 ]...)}]
[ LOCK={ 0 | bool }]
[ LIMITED_ACCESS={ 0 | bool }]
2-38
47 A2 36UJ Rev05
Parameters:
NAME
ABORT
CASE
CASEOF
CHAIN
CONTROL
ELSE
ENDCASEOF
ENDIF
ENDPROC
ENDUNLIST
ENDUNTIL
ENDWHILE
GOTO
IF
LABEL
KWD
LOCAL
OTHER
OTHERWISE
PROC
RETRY
RETURN
SCALL
SYSTEM
UNLIST
UNTIL
VCALL
VCHAIN
WHILE
HELP
ACCESS
HIDE
=-1
=0
47 A2 36UJ Rev05
2-39
OPACC
=-1
=0
PRIORITY
LOCK
=1
=0
2-40
47 A2 36UJ Rev05
GCLKPROJ
=NO
=YES
GCLKSADM
=NO
=YES
LIMITED_ACCESS
=0
=1
Constraints:
Each procedure begins with PROC and ends with ENDPROC.
Only literal values can be specified in PROC; expressions are not allowed.
47 A2 36UJ Rev05
2-41
Examples:
PROC P;
PROC NAME=(CREATE_PROJECT,CRP)
PROMPT='create a project and its attributes'
HELP=H_DCT_CRP
LOCK;
PROC (DELETE_LM,DLM)
PROMPT='Delete an LM library'
HELP=HLP_DLM
ACCESS=(1,4,5,200);
PROC DNP
PROMPT='Define New Password'
ACCESS=(1,4,200)
HIDE=(1,4);
PROC (CHANGE_UN,CUN)
PROMPT='Change User Name'
ACCESS=(4,24,25,200)
OPACC=(1,4,6);
PROC ALCIS
PROMPT='Allocate an Indexed Sequential file'
ACCESS=(4,24,25,200)
OPACC=(1,4,6)
OPHID=(5,6);
PROC G
PROMPT='Command displayed with a lower priority'
PRTY=100;
2-42
47 A2 36UJ Rev05
2.1.20
RETRY
Purpose:
Retries executing the procedure in which it appears by:
passing control to
either the procedure specified
or the beginning of the outermost procedure initiating the current procedure
and re-prompting the parameters to be reentered by the user for retry.
Syntax:
RETRY
[ MESSAGE=char78 ]
[{ SEV | SEVERITY }=dec1 ]
[{ PROC | PROCEDURE }=name31 ]
[ HIGHLIGHT=( name31[.dec2 ][ name31[.dec2 ]]...)]
Parameters:
MESSAGE
SEVERITY
PROCEDURE
47 A2 36UJ Rev05
2-43
HIGHLIGHT
Keywords to be highlighted as prompts on reprompting. When keyword is a list, the rank of the
element in the list can be specified in the format
keyword.rank.
(Up to 64 keyword names can be specified in this list.)
Constraints:
If the user cannot intervene such as when commands are being read from a file,
RETRY is treated as ABORT.
Examples:
RETRY;
no message
2-44
RETRY %RTYMESS;
variable message
message is
expression
47 A2 36UJ Rev05
2.1.21
RETURN
Purpose:
Terminates the execution of the procedure in which it appears to return control to
the calling procedure.
Syntax:
RETURN
Parameters:
None.
Constraints:
Transfer of control depends on how the procedure was activated:
if by CALL, VCALL or SCALL, control passes to next command
if by CHAIN or VCHAIN, control passes to command following that which
Examples:
.
+-----> P1
+-----> P2
.
|
.
|
.
.
|
.
|
.
.
|
.
|
.
.
|
.
|
.
CALL P1
CALL P2
RETURN
.
.
|
. <------+
. <--+
|
.
|
.
|
|
.
|
.
|
|
.
|
.
+---+
.
|
.
.
+----- RETURN
47 A2 36UJ Rev05
.
+-----> P1
+-----> P2
.
|
.
|
.
.
|
.
|
.
.
|
.
|
.
.
|
.
|
.
CALL P1
CHAIN P2
RETURN
.
|
. <------+
|
.
|
|
.
|
|
.
|
|
.
|
|
.
+----------------+
2-45
2.1.22
SCALL
Purpose:
Scans a string of characters as the set of parameter values to be passed to the
specified procedure. If the set is illegal or invalid, prompts the user for correction.
Syntax:
SCALL
COMMAND=name31
[ STRING=char250 ]
Parameters:
COMMAND
STRING
Constraints:
Restrictions on command function:
if STRING denotes a valid parameter set, SCALL behaves like CALL
if not, it behaves like VCALL.
Keywords of calling procedure redefined with the same names, TYPEs,
LENGTHs and NUMVALs as the called procedure are assigned initial values of
corresponding parameters of the called procedure.
Example:
LET PN MYPROC; LET ST 'P1=2 P2=4'; SCALL %PN %ST;
is equivalent to:
CALL MYPROC P1=2 P2=4 or VCALL MYPROC P1=2 P2=4
depending on whether P1=2 and P2=4 are valid parameters for MYPROC
2-46
47 A2 36UJ Rev05
2.1.23
SYSTEM
Purpose:
Passes a string to the calling processor.
Syntax:
SYSTEM
STRING=char250
Parameter:
STRING
Constraints:
Only allowed in user-specific domains.
Examples:
SYSTEM %A;
value of %A is passed
SYSTEM #CAT('DEL_',%1,';');
47 A2 36UJ Rev05
2-47
2.1.24
UNLIST
Purpose:
A sequence of commands between UNLIST and ENDUNLIST is executed for each
element in the specified list. At each execution, the scalar variable is given the
value of the next element in the list, starting with the first. UNLIST blocks can be
nested.
Syntax:
UNLIST
SCALAR=name31
LIST=list-expression
Parameters:
SCALAR
LIST
Constraints:
UNLIST must be matched by its corresponding ENDUNLIST denoting end of
block.
Restrictions on values:
if list is empty, the block is not executed
if values in list within the block are modified, results are unpredictable.
Restrictions on scalar variable:
when all list elements have been supplied to the scalar variable, the UNLIST
2-48
47 A2 36UJ Rev05
Examples:
UNLIST CURRENT %PROGRAM_LIST;
COBOL SOURCE=%CURRENT;
perform loop for all elements of
ENDUNLIST;
PROGRAM_LIST
UNLIST I #INDEX_SET(30);
.
.
.
ENDUNLIST;
47 A2 36UJ Rev05
2-49
2.1.25
UNTIL
Purpose:
A sequence of commands in the UNTIL block is repeatedly executed until the
conditional expression =1. UNTIL blocks can be nested.
Syntax:
UNTIL
CONDITION=( bool [ bool ]...)
Parameter:
CONDITION
Constraints:
UNTIL must be matched by its corresponding ENDUNTIL denoting end of
block.
If all conditional expressions =1 when UNTIL is encountered:
the UNTIL block is not executed
and execution proceeds with the command following ENDUNTIL.
Example:
UNTIL #EQ(%CNT,10);
. }
sequence of statements to be repeatedly executed until %CNT=10
. }
. }
.
ENDUNTIL;
2-50
47 A2 36UJ Rev05
2.1.26
VCALL
Purpose:
Verbose CALL: executes the named procedure with display of specified parameters
for the user to confirm or modify.
Syntax:
VCALL
COMMAND=command-name31
[ parameter-reference ]...
Parameters:
COMMAND
parameter-reference
Constraints:
The difference between VCALL and CALL is that before execution, VCALL
displays the parameters being passed for the user to accept, reject or modify.
Parameter values displayed comprise defaults and those explicitly specified.
If the user cannot intervene such as when commands are being read from a file,
47 A2 36UJ Rev05
2-51
2.1.27
VCHAIN
Purpose:
Verbose CHAIN: executes the named procedure displaying the specified
parameters for the user to confirm or modify. VCHAIN replaces the current
procedure with this new one.
Syntax:
VCHAIN
COMMAND=command-name31
[ parameter-reference ]...
Parameters:
COMMAND
parameter-reference
Constraints:
The difference between CHAIN and VCHAIN is that before execution,
VCHAIN displays all parameters being passed for the user to accept, reject or
modify.
Values displayed comprise defaults and those explicitly specified.
If user cannot intervene such as when commands are being read from a file,
2-52
47 A2 36UJ Rev05
2.1.28
WHILE
Purpose:
The sequence of commands in the block is repeatedly executed for as long as the
conditional expression is WHILE =1. WHILE blocks can be nested.
Syntax:
WHILE
CONDITION=( bool [ bool ]...)
Parameter:
CONDITION
Constraints:
WHILE must be matched by its corresponding ENDWHILE denoting end of
block.
If one of conditional expressions =0 when WHILE is encountered:
the WHILE block is not executed
and execution proceeds with the command following ENDWHILE.
Example:
WHILE #LT (%A,%CNT);
. }
. } sequence of commands to be repeatedly executed while %A<%CNT
. }
.
ENDWHILE;
47 A2 36UJ Rev05
2-53
2.2
System Variables
System variable names begin with the special character #. They can be used in
expressions like any other user-defined variable. The only difference is that
assigning a value to a system variable, in addition to modifying its current value,
will also alter some characteristics of the user operating environment.
System variables are parameters through which the system supports the user's
session. By altering their values, the user can tailor system behavior to his own
requirements. The set of all system variables constitutes the user's profile listing
the user's requirements and performance characteristics. The DISPLAY_PROFILE
(DP) directive can be used to display part or all of this user profile.
System variables have the same characteristics as other variables such as:
type
shape
and length.
They may be undefined. The normal rules for the assigning values to a variable
also apply to system variables. Some system variables but not all, have a default
value being an initial value set at the beginning of the session but can be changed
later.
This Section lists all available system variables with:
their meanings
applicable values
and effects on the environment.
NOTE:
The following system variables cannot be used in batch:
#AUTOLF
#CC
#CSET
#DI
#EXPTABS
#INVCHAR
#PAGEMODE
#PAGETOP
#PL
#PROMPT
#PW
#ROLL
#TABS
#WSTATION
#ZOK
The system variable # can be used in batch mode only in the context "LET #
expression" but not in the context "LET V #".
2-54
47 A2 36UJ Rev05
2.
3.
4.
5.
Default value: The value of the variable at the beginning of the session. An
undefined or uninitialized variable is:
considered empty
and denoted by ().
6.
7.
8.
Level of assignment:
Some system variables may be modified in all contexts, others may be
modified only when at system level. System variables may appear anywhere,
except on the left side of a LET directive in all contexts.
9.
Alternate statement:
Some system variables can be modified by means of specific directives or
commands. Directive DISPLAY_PROFILE (DP) displays the values of most
system variables, in addition to some other general purpose information.
These directives and commands are described in the IOF Terminal User's
Reference Manual.
47 A2 36UJ Rev05
2-55
2.2.1
#: Terminal Line
Meaning:
Type:
Shape:
Length:
Default value:
Constraints:
Effect:
Level of assignment:
Alternate statement:
2.2.2
Type:
Shape:
Length:
Default value:
Constraints:
Effect:
Level of assignment:
Alternate statement:
2-56
47 A2 36UJ Rev05
2.2.3
NOTES:
2.2.4
1.
2.
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-57
2.2.5
2.2.6
#BRK: Break
For more information, see paragraph "Break Processing".
2.2.7
Level of assignment:
Alternate statement:
2.2.8
Level of assignment:
Alternate statement:
2-58
47 A2 36UJ Rev05
2.2.9
Level of assignment:
Alternate statement:
2.2.10
Effect:
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-59
2.2.11
Level of assignment:
Alternate statement:
2.2.12
Level of assignment:
Alternate statement:
2-60
47 A2 36UJ Rev05
2.2.13
Level of assignment:
Alternate statement:
2.2.14
47 A2 36UJ Rev05
2-61
2.2.15
Level of assignment:
Alternate statement:
2.2.16
Type:
Shape:
Length:
Default value:
Constraints:
Effect:
Level of assignment:
Alternate statement:
2-62
47 A2 36UJ Rev05
2.2.17
Level of assignment:
Alternate statement:
2.2.18
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-63
2.2.19
Level of assignment:
Alternate statement:
2.2.20
2-64
47 A2 36UJ Rev05
2.2.21
Level of assignment:
Alternate statement:
2.2.22
47 A2 36UJ Rev05
2-65
2.2.23
Level of assignment:
Alternate statement:
2.2.24
Level of assignment:
Alternate statement:
2-66
47 A2 36UJ Rev05
2.2.25
Level of assignment:
Alternate statement:
2.2.26
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-67
2.2.27
Level of assignment:
Alternate statement:
2.2.28
Type:
Shape:
Length:
Default value:
Constraints:
Effect:
Level of assignment:
Alternative statement:
2-68
47 A2 36UJ Rev05
2.2.29
Level of assignment:
Alternate statement:
2.2.30
Level of assignment:
Alternate statement:
2.2.31
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-69
2.2.32
Level of assignment:
Alternate statement:
2.2.33
Level of assignment:
Alternate statement:
2-70
47 A2 36UJ Rev05
2.2.34
#SEV: Severity
Meaning:
Type:
Shape:
Length:
Default value:
Constraints:
Effect:
Level of assignment:
Alternate statement:
2.2.35
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-71
2.2.36
Level of assignment:
Alternate statement:
2.2.37
Level of assignment:
Alternate statement:
2-72
47 A2 36UJ Rev05
2.2.38
Effect:
Level of assignment:
Alternate statement:
2.2.39
Type:
Shape:
Length:
Default value:
Constraints:
Effect:
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-73
2.2.40
Level of assignment:
Alternate statement:
2.2.41
2-74
47 A2 36UJ Rev05
2.2.42
Type:
Shape:
Length:
Default value:
Constraints:
Effect:
Level of assignment:
Alternate statement:
2.2.43
2.2.44
Level of assignment:
Alternate statement:
47 A2 36UJ Rev05
2-75
2.2.45
Level of assignment:
Alternate statement:
2.2.46
Level of assignment:
Alternate statement:
2-76
47 A2 36UJ Rev05
2.3
Builtin Functions
GCL builtin functions provide a means for obtaining information on the system
status, for querying the execution environment, or for manipulating GCL objects.
The names of builtins all begin with the special character #. They may have zero,
one, two, three, or more arguments, which may in turn be expressions. The
arguments are enclosed in parentheses after the name of the builtin. For example:
#PLUS(3,5)
#PLUS(#TIMES(2,2),3)
#PLUS(#TIMES(3,6),#TIMES(3,3))
-->
-->
-->
8
7
27
A builtin can be used in place of a literal or a variable provided that the result of
the builtin is of a type acceptable in the context where it is used. For example, the
builtin #PLUS gives a numeric result and therefore, can only be used where a
numeric value is acceptable.
Conversely, the arguments of a builtin must also match certain type requirements.
For example, the arguments of builtin #PLUS must be numeric.
NOTES:
1.
2.
#TERMID
#TTYPE
#LSYS
#MDAY
#MODE
#PROJECT
#RON
#TERMID
#TIME
#TTYPE
#USERID
#WDAY
#YDAY
#FW
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-77
Most builtins operate on scalars, and produce scalar results. When arguments or
results can be lists, "list" is fixed to the end of type. "Any" means any type.
Limited implicit conversions are available, as with the LET directive.
Builtins are classified under the following functions:
- arithmetic
- relational
- boolean
- character handling
- terminal handling
- list handling
- object management
- context handling
- "Is it ?"
- conversion
- file handling.
Boolean value 0 or 1
Expressions of type bool; bool literals
CHAR
DEC
FILE
FSET
HEXA
LIB
NAME
OUTPUT
RFILE
STAR
VOLUME
2-78
47 A2 36UJ Rev05
2.3.1
Arithmetic Builtins
2.3.1.1
#ABS
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.1.2
2.3.1.3
#DIVIDE
Purpose:
Arguments:
Result:
Constraints:
Examples:
Purpose:
#DIVIDE(18, 6) --> 3
#DIVIDE(-7, 2) --> -3
#DIVIDE(-4, -2) --> 2
#MAX
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
#MAX(6, 4)
--> 6
#MAX(-7, 4, 6)
--> 6
#MAX(-12, -15, -7) --> -7
2-79
2.3.1.4
#MIN
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.1.5
2.3.1.6
Purpose:
Arguments:
Result:
Constraints:
Examples:
Purpose:
#MOD
#MOD(7, 2)
#MOD(7, -2)
#MOD(-7, 2)
#MOD(-7, -2)
--> 1
--> -1
--> 1
--> -1
#PLUS
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-80
#MIN(6, 4)
-->
4
#MIN( -7, 4, 6)
--> -7
#MIN(-12, -15, -7) --> -15
#MINUS
Arguments:
Result:
Constraints:
Examples:
2.3.1.7
47 A2 36UJ Rev05
2.3.1.8
#SIGNUM
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.1.9
#TIMES
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-81
2.3.2
Relational Builtins
Relational builtins compare the values of their two arguments and yield a boolean
value denoting whether or not the relation is true.
Values to be compared are:
either numeric being decimal or literal values denoting decimals, in which case,
2.3.2.1
#EQ
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.2.2
#EQ(02, +2)
#EQ(AC, 'ac')
#EQ('', ' ')
#EQ('AB', 'AB
-->
-->
-->
') -->
1
0
1
1
#GE
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-82
47 A2 36UJ Rev05
2.3.2.3
#GT
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.2.4
Arguments:
Result:
Constraints:
Examples:
#LT
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.2.6
#LE
Purpose:
2.3.2.5
#NE
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-83
2.3.3
Boolean Builtins
2.3.3.1
#AND
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.3.2
%B
0
1
0
1
#AND(%A, %B)
0
0
0
1
%B
0
1
0
1
#NAND(%A,%B)
1
1
1
0
#NOR
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-84
%A
0
0
1
1
#NAND
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.3.3
%B
0
1
0
1
#NOR(%A, %B)
1
0
0
0
47 A2 36UJ Rev05
2.3.3.4
2.3.3.5
2.3.3.6
#NOT
Purpose:
Argument:
Result:
Constraints:
Examples:
Purpose:
Arguments:
Result:
Constraints:
Examples:
%A
0
1
#NOT(%A)
1
0
#OR
%A
0
0
1
1
%B
0
1
0
1
#OR(%A, %B)
0
1
1
1
#XOR
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
%B
0
1
0
1
#XOR(%A, %B)
0
1
1
0
2-85
2.3.4
2.3.4.1
#CAT
2.3.4.2
2.3.4.3
Purpose:
Arguments:
Result:
Constraints:
Examples:
Purpose:
Arguments:
Result:
Constraints:
Examples:
-->
-->
-->
-->
ABC
Hello Boys!
ABCDEFG
ABCD
#CTN
#INDEX
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-86
#CAT(A, BC)
#CAT('Hello Boys', !)
#CAT(A, BC, DEF, G)
#CAT(AB, '', CD)
47 A2 36UJ Rev05
2.3.4.4
#LC
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.4.5
#MODIFY
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.4.6
XYZ)->1:
X)
->1:
'') ->1:
XX) ->0:
#QUOTE
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-87
2.3.4.7
#SUBSTITUTE
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-88
47 A2 36UJ Rev05
2.3.4.8
#SUBSTR
Purpose:
Arguments:
Result:
Constraints:
2.3.4.9
Examples:
#SUBSTR(ABCDEFG,
#SUBSTR(ABCDEFG,
#SUBSTR(ABCDEFG,
#SUBSTR(ABCDEFG,
Purpose:
Arguments:
Result:
Constraints:
Examples:
4, 2) --> DE
5)
--> EFG
6, 6) --> FG + 4 spaces
5, 0) --> empty string ('')
#UC
#UC('abcdef')
--> ABCDEF
#UC('a+b-C')
--> A+B-C
#UC('Hello Boys') --> HELLO BOYS
2.3.4.10 #UNQUOTE
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-89
2.3.4.11 #VERIFY
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-90
#
#
#
#
#VERIFY(AB,XACDBE)
#VERIFY('.X',XYZ)
#VERIFY('',ABCD)
#VERIFY(ABCD,'')
-->
-->
-->
-->
1
0
1
0
47 A2 36UJ Rev05
2.3.5
2.3.5.1
#KLN
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.5.2
#L
Purpose:
Arguments:
Result:
Constraints:
47 A2 36UJ Rev05
2-91
Examples:
2.3.5.3
#MASTER
Purpose:
Arguments:
Result:
Constraints:
2.3.5.4
Arguments:
Result:
Constraints:
Examples:
#READ
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-92
#QUERY
Purpose:
2.3.5.5
47 A2 36UJ Rev05
2.3.5.6
#READL
Purpose:
Arguments:
Result:
Constraints:
47 A2 36UJ Rev05
as for #L, but with data supplied from the active input
stream. If the data is wrong, the stream aborts.
(name, char)
bool
see #L
2-93
2.3.6
A list is declared:
by the NUMVAL parameter specifying a range bounded by a minimum and a
EXAMPLE:
GLOBAL V DEC 3 NUMVAL=(2,5)
LET V (3,5,7)
LET V (12,37)
LET V 12
LET V (1,2,3,4,5,6)
2.3.6.1
#ELEM
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-94
7,
4)
2)
1)
12, 18)
--> 18
--> 7
--> 6
47 A2 36UJ Rev05
2.3.6.2
#FMT
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.6.3
#INDEX_SET
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.6.4
#LCOUNT
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-95
2.3.6.5
#LCTN
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.6.6
Arguments:
Result:
Constraints:
Examples:
8, 10)
--> 3
--> 5
--> 0
#LLENGTH
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-96
LET V (2, 3, 5, 7, 9)
#LCTN(%V, 3) --> 1
#LCTN(%V, 4) --> 0
#LINDEX
Purpose:
2.3.6.7
6, 8)
--> 4
--> 1
--> 0
47 A2 36UJ Rev05
2.3.6.8
#MAXLLENGTH
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.6.9
#MINLLENGTH
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.6.10 #REPLACE
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-97
2.3.6.11 #STRING
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.6.12 #STRIP
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-98
Deletes the arg2 first (if arg2 > 0) or arg2 last (if arg2
< 0) elements of the arg1 list.
(any-list, dec)
a list with the same type as arg1.
none
GLOBAL V DEC 3 NUMVAL=(2, 5)
LET V (2, 4, 6, 8, 10)
#STRIP(%V, 2) --> (6, 8, 10)
#STRIP(%V, -3) --> (2, 4)
#STRIP(%V, 0) --> (2, 4, 6, 8, 10)
#STRIP(%V, 6) --> ()
47 A2 36UJ Rev05
2.3.7
2.3.7.1
#CHECKSTAR
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.7.2
#CHECKSTAR(A*B, AXXXB)
#CHECKSTAR(A*B, ABD)
#CHECKSTAR(A*$>AI, AJBC)
#CHECKSTAR(A*$>AI, AHX)
-->
-->
-->
-->
1
0
1
0
#DROP
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.7.3
#DROPGB
Purpose:
Arguments:
Result:
Constraints:
47 A2 36UJ Rev05
2-99
2.3.7.4
#EXIST
Purpose:
Arguments:
Result:
Constraints:
Examples:
a value
--> 0 if V2 non-existent or
uninitialized
2.3.7.5
#LENGTH
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.7.6
#LENGTH(1234)
--> 4
#LENGTH('Hello Boys') --> 10
#LENGTH('')
--> 0
#LISTGB
Purpose:
Arguments:
Result:
Constraints:
2-100
47 A2 36UJ Rev05
2.3.7.7
#MLENGTH
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.7.8
#NEXIST
Purpose:
Arguments:
Result:
Constraints:
Examples:
a value
--> 1 if V2 non-existent or empty
2.3.7.9
#VALUE
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-101
2.3.8
2.3.8.1
2.3.8.2
#BILLING
Purpose:
Arguments:
Result:
Constraints:
Purpose:
#CPU
Arguments:
Result:
Constraints:
2.3.8.3
#DATE
Purpose:
Arguments:
Result:
Constraints:
2.3.8.4
#DOMAINID
Purpose:
Arguments:
Result:
Constraints:
Example:
2-102
47 A2 36UJ Rev05
2.3.8.5
#ELAPSED
Purpose:
Arguments:
Result:
Constraints:
2.3.8.6
#EXTDATE
Purpose:
Arguments:
Result:
Constraints:
2.3.8.7
#FW
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.8.8
#LSYS
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-103
2.3.8.9
#MDAY
Purpose:
Arguments:
Result:
Constraints:
Example:
2.3.8.10 #MODE
Purpose:
Arguments:
Result:
Constraints:
2.3.8.11 #PROJECT
Purpose:
Arguments:
Result:
Constraints:
Purpose:
2.3.8.12 #RON
Arguments:
Result:
Constraints:
2.3.8.13 #TERMID
Purpose:
Arguments:
Result:
Constraints:
Example:
2-104
47 A2 36UJ Rev05
2.3.8.14 #TIME
Purpose:
Arguments:
Result:
Constraints:
2.3.8.15 #TTYPE
Purpose:
Arguments:
Result:
Constraints:
2.3.8.16 #USERID
Purpose:
Arguments:
Result:
Constraints:
Purpose:
2.3.8.17 #WAIT
Arguments:
Result:
Constraints:
2.3.8.18 #WDAY
Purpose:
Arguments:
Result:
Constraints:
Example:
47 A2 36UJ Rev05
2-105
2.3.8.19 #YDAY
Purpose:
Arguments:
Result:
Constraints:
Example:
2-106
47 A2 36UJ Rev05
2.3.9
2.3.9.1
#ISITBOOL
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.9.2
#ISITBOOL(0)
--> 1
#ISITBOOL(ABC) --> 0
#ISITDATE
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.9.3
(93/12/10)
(93/02/29)
(2001/12/31)
(1993/0A/01)
-->
-->
-->
-->
1
0
1
0
#ISITDEC
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-107
2.3.9.4
#ISITFILE
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.9.5
Arguments:
Result:
Constraints:
Examples:
Arguments:
Result:
Constraints:
Examples:
#ISITFSET(A.**) --> 1
#ISITFSET(A/B) --> 0
#ISITLIB
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-108
#ISITHEXA
Purpose:
2.3.9.7
#ISITFILE(a/b/c)
--> 0
#ISITFILE(A.B.C..S) --> 1
#ISITFSET
Purpose:
2.3.9.6
47 A2 36UJ Rev05
2.3.9.8
#ISITNAME
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.9.9
--> 1
--> 0
#ISITOUTPUT
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.9.10 #ISITRFILE
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.9.11 #ISITSTAR
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-109
2.3.9.12 #ISITTIME
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.9.13 #ISITVOLUME
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-110
47 A2 36UJ Rev05
2.3.10
Conversion Builtins
2.3.10.1 #BINTODEC
Purpose:
Arguments:
Result:
Constraints:
Purpose:
2.3.10.2 #BYTE
Arguments:
Result:
Constraints:
2.3.10.3 #CVBOOL
Purpose:
Arguments:
Result:
Constraints:
47 A2 36UJ Rev05
2-111
2.3.10.4 #CVDATDEC
Purpose:
Arguments:
Result:
Constraints:
Examples:
Date:
2.3.10.5 #CVDEC
Purpose:
Arguments:
Result:
Constraints:
2.3.10.6 #CVDECDAT
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-112
47 A2 36UJ Rev05
2.3.10.7 #CVFILE
Purpose:
Arguments:
Result:
Constraints:
2.3.10.8 #CVFSET
Purpose:
Arguments:
Result:
Constraints:
2.3.10.9 #CVHEXA
Purpose:
Arguments:
Result:
Constraints:
2.3.10.10 #CVLIB
Purpose:
Arguments:
Result:
Constraints:
2.3.10.11 #CVNAME
Purpose:
Arguments:
Result:
Constraints:
2.3.10.12 #CVOUTPUT
Purpose:
Arguments:
Result:
Constraints:
47 A2 36UJ Rev05
2-113
2.3.10.13 #CVRFILE
Purpose:
Arguments:
Result:
Constraints:
2.3.10.14 #CVSTAR
Purpose:
Arguments:
Result:
Constraints:
2.3.10.15 #CVVOLUME
Purpose:
Arguments:
Result:
Constraints:
2.3.10.16 #DECTOHEXA
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.10.17 #FB15
Purpose:
Arguments:
Result:
Constraints:
2-114
47 A2 36UJ Rev05
2.3.10.18 #FB31
Purpose:
Arguments:
Result:
Constraints:
2.3.10.19 #HEXATODEC
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.10.20 #RJD
Purpose:
Arguments:
Result:
Constraints:
Examples:
47 A2 36UJ Rev05
2-115
2.3.11
2.3.11.1 #EFN
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.11.2 #EXPANDPATH
Purpose:
Arguments:
Result:
Constraints:
Examples:
-->
-->
-->
-->
A.B.D
A.H.I.J
A.B.C
A:T:MS/D500
2.3.11.3 #FSITE
Purpose:
Arguments:
Result:
Constraints:
Examples:
2.3.11.4 #SUBFILE
Purpose:
Arguments:
Result:
Constraints:
Examples:
2-116
47 A2 36UJ Rev05
3. Command Management
GCL procedures are defined by basic commands. These procedures are then
submitted to the MAINTAIN_COMMAND (MNCMD) processor for compilation
to be executable.
MAINTAIN_COMMAND also has other functions such as creating, updating,
storing and retrieving such procedures. The ON_ERROR command specifies
whether MAINTAIN_COMMAND is to abort or to continue execution of
commands if a Severity 3 occurs.
3.1
Creating Procedures
A procedure is created in one of two ways:
The CREATE command allows entering a procedure into the workspace. Each
47 A2 36UJ Rev05
3-1
3.2
3.3
CREATE
LOAD
RESEQUENCE
APPEND
LEDIT
CLEAR
Updating Procedures
The tools for modifying a procedure are:
the Line Editor (LEDIT): a relatively simple editor which operates on the
member and which can only be used from a terminal with full-screen facilities.
the Text Editor (EDIT): a powerful editor which operates on an SL library
3-2
47 A2 36UJ Rev05
Command Management
3.4
Library Management
The following commands maintain libraries of command definitions:
SAVE
RESAVE
COPY
DELETE
MODIFY_LOCK
COUNT_ENTRIES
LIST
STATUS
COMPILE
DECOMPILE
DOMAIN
DISPLAY
DISPLAY_SCREEN
MERGE
47 A2 36UJ Rev05
3-3
3.5
Domains
A domain is a set of commands (compiled procedures) available at a certain level
of processing.
EXAMPLES:
Domain IOF
Domain LIBMAINT_SL
Domain FSE
System level
Processor level
Processor level
All the commands of a domain are kept in the same subfile in a binary library. The
subfile name is identical to the domain name. User created commands can be
either additions to an existing domain or belong to a new user domain.
3.5.1
Definition of Domains
A domain is a set of compiled commands or procedures stored in a BIN library
member. Commands of a domain specifically belong and pertain to a particular
processor.
EXAMPLES OF DOMAINS:
MAINTAIN_LIBRARY SL commands
commands of MAINTAIN_COMMAND
all commands accessible at system level.
3-4
47 A2 36UJ Rev05
Command Management
3.5.2
Protection of Domains
MAINTAIN_COMMAND does not overwrite an existing domain. It updates the
domain by:
creating a temporary member named CMDMGT_member and writing the records
to it
deleting the previous version of the member
and giving the name of the previous version to the temporary member.
3.5.3
47 A2 36UJ Rev05
3-5
3.5.4
Standard Domains
Commands
Standard Domains
IOF
H_NOCTX
MAIN
CREATE_BFAS_NONE
CREATE_BFAS_SEQ
CREATE_LIBRARY
CREATE_LIBRARY_FBO
CREATE_UFAS_INDEXED
CREATE_UFAS_INDEXED_FBO
CREATE_UFAS_RANDOM
CREATE_UFAS_SEQ_REL
CREATE_UFAS_SEQ_REL_FBO
CRPMM
(under MAINTAIN_SYSTEM processor)
CREATE_COMPLEX_GENERATION
(in MAIN domain)
CREATE_NETGEN
(in MAIN domain)
CREATE_SYSTEM_FILE
(under GIUF processor)
EDIT
ENTER_GIUF
ENTER_RMOS
FSE (system level)
FSE (under the LIBMAINT_SL processor)
Expression "$*$BRK" (break)
CREATE (under CMDMGT processor)
IQS
MAINTAIN_AUDIT7
MAINTAIN_CATALOG
3-6
CREATE_PMM_FUNCTION
CXGEN
NG
TL_DAT
TL_DSA
TL_FW
TL_GCOS
TL_GSF
TL_OLTD
TL_SESSION
DMU_FILESET
PCF
DPAN
DPANCRTR
DPANPDTR
EDIT
GIUF
RMOS
F_S_E
FSE
H_BREAK
H_GCL
IQS
AUDIT7
CATMAINT
47 A2 36UJ Rev05
Command Management
Commands
Standard Domains
MAINTAIN_COMMAND
MAINTAIN_DATA_DESCRIPTION
MAINTAIN_FILE
CMDMGT
MAINTAIN_DATA_DESCRIPTION
MAINTAIN_FILE
MAINTAIN_FILE_FBO
FORMGEN
MAINTAIN_JAS
LIBMAINT_BIN
LIBMAINT_CU
LIBMAINT_LM
LIBMAINT_SL
LIBMAINT_SM
MNMFTM
MAINTAIN_MIGRATION
MNSTM_HPS
MAINTAIN_FORM
MAINTAIN_JAS
MAINTAIN_LIBRARY BIN
MAINTAIN_LIBRARY CU
MAINTAIN_LIBRARY LM
MAINTAIN_LIBRARY SL
MAINTAIN_LIBRARY SM
MAINTAIN_MFT
MAINTAIN_MIGRATION
MAINTAIN_STORAGE_MANAGER
(in full VOLSET FACILITY/QUOTAS
context) alias MAINTAIN_QUOTA
MAINTAIN_STORAGE_MANAGER
in basic VOLSET FACILITY context
MAINTAIN_SYSTEM
MNSYSLM
(under MAINTAIN_SYSTEM processor)
MNSYSSM
(under MAINTAIN_SYSTEM processor)
MNTZS
(under MAINTAIN_SYSTEM processor)
MAINTAIN_EXTENDED_BACKUP
MAINTAIN_VOLUME
MODIFY_PMM
(under MAINTAIN_PMM processor)
Maintain_system update commands
PREPARE_TAPESET
MODIFY
(under MAINTAIN_LIBRARY processor)
SCANNER
SCAN_VCAM_TRACE
MNSTM_AP
MAINTAIN_SYSTEM
MAINTAIN_SYSTEM_LM
MAINTAIN_SYSTEM_SM
MAINTAIN_TTYPEO_SET
MNXBUP
MAINTAIN_VOLUME
MAINTAIN_VOLUME_FBO
MODIFY_PMM
MODIFY_SYSTEM_UNIT
PREPARE_TAPESET
UPDATE
SCANNER
SCAN_VCAM_TRACE
NOTE:
adding private commands or changing access (with MDA command of
MAINTAIN_COMMAND processor) on the commands of the H_GCL domain
can create garbage in the system.
47 A2 36UJ Rev05
3-7
3.5.5
3-8
47 A2 36UJ Rev05
Command Management
Method B:
S: MAINTAIN_COMMAND;
>>>15:12 CMDMGT...
C: DOMAIN IOF;
C: BINLIB MYOWN.BIN5;
C: CREATE;
10: PROC COBOL-LINK PROMPT='GCL EXAMPLE' ACCESS=-1
HIDE=0 OPACC=4 OPHID=0 LOCK=0;
20: KWD PRG_NAME TYPE=NAME LENGTH=31 NUMVAL=(1,5) ASK=3
CONCEAL=0;
30: LOCAL PRG_NAME 31;
40: UNLIST PRG %PRG_NAME;
50: COBOL %PRG XREF MAP LEVEL=NSTD;
60: IF #GT(#SEV,2);
70: LET # #CAT('COMPILATION OF PROGRAM ',%PRG,' ABORTED');
80: ELSE;
90: LINKER %PRG;
100: ENDIF;
110: ENDUNLIST;
120: ENDPROC;
130: /
C: SAVE;
Line numbers are supplied by the system. The name need not be supplied as this is
determined by the PROC statement.
Such a procedure belongs to a standard domain and cannot contain a SYSTEM
command. System calls are performed using the CALL command (CALL COBOL
or simply COBOL).
47 A2 36UJ Rev05
3-9
3.5.6
The domain MYOWN1 will be created when the first procedure is saved in it.
3-10
47 A2 36UJ Rev05
Command Management
3.6
Libraries
Two kinds of binary libraries exist:
The system library SYS.HBINLIB contains all the standard commands of all
standard domains. These standard commands are available to all users with
adequate access and operator rights established in the environment.
SYS.HBINLIB belongs implicitly to the library search path of all users.
Private libraries containing user-defined commands are explicitly declared in the
user's binary search path using the MWINLIB command with the BIN option.
Different versions of the same procedure may be stored in different BIN libraries:
at execution time, the system executes the first one it finds with the name
Consequently, changing the BIN library search path can change the version of a
procedure executed in cases where identically named procedures exist in
different libraries.
47 A2 36UJ Rev05
3-11
3.7
Access Restrictions
3.7.1
Environments
In defining an environment, it is possible to restrict commands to certain classes of
users and also make commands transparent to certain classes of users.
An environment defines a set of commands which are accessible to a certain
project regardless of the domain to which the commands belong. The menu of a
user working under a certain project presents the visible part of the user's current
environment.
The System Administrator defines and personalizes the environments of users at
the installation. However, all users who have the appropriate binary library in their
binary search path, can define the PROC command without access rights with the
appropriate values for ACCESS and HIDE. See Paragraph "Proc" for the syntax of
the PROC command.
Creating and maintaining environments are treated in the System Administrator's
Manual.
3.7.2
Access Rights
The following commands manage access rights to commands:
3-12
DELETE_ENVT
ENVT
LIST_ACCESS
LIST_ENVT
LIST_PROJ
MODIFY_ACCESS
PROJ
RESTORE_ACCESS
47 A2 36UJ Rev05
Command Management
RESET
SAVE_ACCESS
NOTE:
The LIST commands display information on objects specified in the command
itself and are available to all users.
47 A2 36UJ Rev05
3-13
3.8
EDIT (ED)
ENVT
FSE
LEDIT (LED)
LIST (LS)
LIST_ACCESS (LSA)
LIST_ENVT (LSENVT)
LIST_PROJ (LSPROJ)
LOAD (LD)
MERGE
MODIFY_ACCESS (MDA)
MODIFY_LOCK (MDLK)
ON_ERROR
PRINT (PR)
PROJ
QUIT (Q)
RESAVE (RSV)
RESEQUENCE (RSQ)
RESET
RESTORE_ACCESS
(RSTA)
SAVE (SV)
SAVE_ACCESS (SVA)
SLLIB
STATUS (ST)
NOTE:
In the description of the commands, the mention SADMOPT appears.
SADMOPT is a CONFIG statement whose parameters declared at GCOS 7
system installation determine the visibility of the commands, namely:
3-14
GCLKPROJ
=NO:
GCLKSADM
47 A2 36UJ Rev05
Command Management
3.8.1
APPEND (AP)
Purpose:
To add lines to a procedure definition in the workspace. The system automatically
prompts the user with the line number of the line to be entered.
Syntax:
{ APPEND }
{
}
{ AP
}
[ INIT=dec6 ]
[ STEP={ 10 | dec6 }]
Description of Parameters:
INIT
the number of the line after which the new lines are to
be added. If a line before the last line is specified in
INIT, all succeeding lines in the workspace are lost.
Default: the line number after the last line in the
workspace.
STEP
Constraints:
The command is processed as follows:
each line is checked as it is entered
if there is an error in the line, an error message appears and the same line
the line.
47 A2 36UJ Rev05
3-15
Examples:
BINLIB BL1
DOMAIN DMN1
LOAD P1
AP
150:...
160:...
170:...
180:/
RESAVE
3-16
}
}
}
47 A2 36UJ Rev05
Command Management
3.8.2
BINLIB (LIB)
Purpose:
To assign a binary library:
if a BIN library is already assigned, it is replaced by the new one specified
if the BINLIB command is specified without a library name, the current BIN
library is deassigned.
Syntax:
{ BINLIB }
{
}
{ LIB
}
[ LIBRARY=lib78 ]
Description of Parameter:
LIBRARY
Constraints:
If no binary library has been assigned, any attempt to operate on binary library
such as SAVE will cause an error.
Examples:
BINLIB BIN1
BINLIB
47 A2 36UJ Rev05
3-17
3.8.3
CLEAR (CLR)
Purpose:
To delete the current contents of the workspace:
the workspace is empty
the previous contents cannot be recovered.
Syntax:
{ CLEAR }
{
}
{ CLR
}
Parameters: None
Constraints: None
Example:
CLR
3-18
clear workspace
47 A2 36UJ Rev05
Command Management
3.8.4
COMPILE (COMP)
Purpose:
To compile procedures from source texts in source language (SL) library members.
The compiled procedures are stored in the binary library as part of the current or
specified domain. The COMPILE command provides for non-incremental (bulk)
compilation.
Syntax:
{ COMPILE }
{
}
{ COMP
}
{ PROC | PROCEDURES }=star62
[ DOMAIN=name31 ]
[ BRIEF={ 0 | bool }]
[ SOURCE={ 1 | bool }]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ OLDVERS={ 0 | bool }]
Description of Parameters:
PROCEDURES
DOMAIN
BRIEF
=1
=0
Extent of Reporting:
Only the lines in error are displayed
Default: All lines are displayed and next, the size of
the GCL procedure (space used in the assigned
BINLIB).
The size used in BINLIB depends on the parameter
SOURCE value, and it is given in the form:
PROCEDURE REAL SIZE (IN BYTES): 129456
47 A2 36UJ Rev05
3-19
SOURCE
=0
=1
OLDVERS
=1
=0
Constraints:
COMPILE creates the new compiled procedures as part of:
the current domain:
line
two or more GCL statements must not be present in the same source line
a procedure containing errors or incomplete is flagged by an error message
3-20
47 A2 36UJ Rev05
Command Management
File assignment:
BIN and SL libraries must both be assigned through BINLIB and SLLIB
SYS.HBINLIB
the source code for procedures compiled in standard domains is not saved in
the binary library. See Section 10 of the GCOS 7-V6 System Administrator's
Manual for the list of standard domains.
Examples:
BINLIB BL1
SLLIB SL1
DOMAIN DMN
COMP P2
COMP P1 BRIEF
COMP A*
47 A2 36UJ Rev05
3-21
3.8.5
COPY (CP)
Purpose:
To copy one or more procedures of the input domain to the output domain.
Syntax:
{ COPY }
{
}
{ CP
}
{ PROCEDURES } { star62
}
{
}={
}
{ PROC
} {( name31 [ name31 ]...)}
OUTDOM=name31
INDOM=name31
[ BRIEF={ 0 | bool }]
[{ INLIB | IL }=lib78 ]
[{ REPLACE | RPL }={ 0 | bool }]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - [ OLDVERS={ 0 | bool }]
Description of Parameters:
3-22
PROCEDURES
OUTDOM
INDOM
BRIEF
=1
=0
Extent of Reporting:
Only the lines in error are displayed
Default: All lines are displayed.
INLIB
47 A2 36UJ Rev05
Command Management
REPLACE
=1
=0
BRIEF
=1
=0
OLDVERS
=1
=0
Constraints:
The output library must be assigned through the BINLIB command before
COPY is submitted.
Domain requirements:
both input and output domains must exist
when INLIB is omitted, INDOM and OUTDOM must be different.
Restrictions on procedures:
the star convention applies only to procedure names not to aliases
procedures locked in the output domain can only be replaced by their owners.
47 A2 36UJ Rev05
3-23
3.8.6
COUNT_ENTRIES (COUNT)
Purpose:
To count the number of procedure names, aliases and prompts of a given domain in
the current BIN library. All of the procedure and alias names are counted, even if
the procedures are hidden.
Syntax:
{ COUNT_ENTRIES }
{
}
{ COUNT
}
[{ DOMAIN | DOMAINS }=star62 ]
Description of Parameter:
DOMAINS
Constraints:
The BIN library must be assigned through the BINLIB command before
COUNT_ENTRIES can be used.
Examples:
3-24
BINLIB BLIB
COUNT_ENTRIES IOF
47 A2 36UJ Rev05
Command Management
3.8.7
CREATE (CR)
Purpose:
To create a new procedure in the workspace. Lines are numbered automatically as
they are entered.
Syntax:
{ CREATE }
{
}
{ CR
}
[ INIT={ 10 | dec6 }]
[ STEP={ 10 | dec6 }]
Description of Parameters:
INIT
STEP
Constraints:
The command is processed as follows:
each line is checked as it is entered
if there is an error in the line, an error message appears and the same line
number is redisplayed to allow the user to correct the entry
in novice mode, an extra prompt is displayed
to terminate the APPEND sequence, enter / or & or [F in the first position on
the line.
47 A2 36UJ Rev05
3-25
Examples:
BINLIB BLIB1
DOMAIN DMN1
CR
10:PROC P1...
20:...
30:...
40:...
50:/
SAVE
3-26
}
}
leave CREATE
store workspace (procedure P1) in current domain
47 A2 36UJ Rev05
Command Management
3.8.8
DECOMPILE (DEC)
Purpose:
To decompile procedures from the binary library. The source texts produced by
DECOMPILE are stored as source language (SL) library members in the library
assigned by the SLLIB command.
Syntax:
{ DECOMPILE }
{
}
{ DEC
}
{ PROC | PROCEDURES }=star62
[ DOMAIN=name31 ]
[{ REPLACE | RPL }={ 0 | bool }]
[ PREFIX=name6 ]
- - - - - - - - - - - - - - - - - - - - - [ COMPACT={ 0 | bool }]
Description of Parameters:
PROCEDURES
DOMAIN
REPLACE
PREFIX
47 A2 36UJ Rev05
3-27
COMPACT
=1
=0
Constraints:
Restrictions on decompilation:
A procedure compiled with SOURCE=0 in the COMPILE, SAVE or
since their source code is not saved in SYS.HBINLIB. See Section 10 of the
GCOS 7-V6 System Administrator's Manual for the list of standard domains.
if a member of the same name exists in the SL library and is not type CMD,
an error is returned and no member is created
if the member is type CMD, it is overwritten if REPLACE=1; otherwise a
message is issued and no member is created.
DECOMPILE creates new SL members:
in the SL library specified by the SLLIB command
with names of the corresponding procedure headed by prefix and
3-28
BINLIB BL1
SLLIB SL1
DOMAIN D
current domain is D
DEC P1
47 A2 36UJ Rev05
Command Management
3.8.9
DELETE (DL)
Purpose:
To delete one or more procedures of a domain in the current binary library.
Syntax:
{ DELETE }
{
}
{ DL
}
{ PROCEDURES } { star62
}
{
}={
}
{ PROC
} {( name31 [ name31 ]...)}
[ DOMAIN=name31 ]
[ BRIEF={ 0 | bool }]
Description of Parameters:
PROCEDURES
DOMAIN
BRIEF
=1
=0
Constraints:
The BIN library in which the domain is stored must be assigned before using
47 A2 36UJ Rev05
3-29
Examples:
3-30
BINLIB BL1
DOMAIN D
current domain is D
DL P1
DL * DMN
DL ^P*
47 A2 36UJ Rev05
Command Management
3.8.10
DELETE_ENVT (DLENVT)
Purpose:
Reserved for the System Administrator: To delete an existing environment. If this
environment is not the default environment, then DELETE_ENVT deletes all
relations between the environment and all attached projects.
Syntax:
{ DELETE_ENVT }
{
}
{ DLENVT
}
ENVIRONMENT=name12
Description of Parameter:
ENVIRONMENT
Name of environment.
Constraints:
The specified environment must exist.
It is not deleted if it is the default environment for a project. To delete it, use the
PROJ Command.
Example:
DLENVT ENVT1
47 A2 36UJ Rev05
3-31
3.8.11
DISPLAY (D)
Purpose:
To display the syntax of one or more procedures.
Syntax:
{ DISPLAY }
{
}
{ D
}
{ PROCEDURES } { star62
}
{
}={
}
{ PROC
} {( name31 [ name31 ]...)}
[ DOMAIN=name31 ]
Description of Parameters:
PROCEDURES
DOMAIN
Name of domain.
Default: current domain defined in last DOMAIN
command.
Constraints:
The BIN library in which the domain is stored must be assigned before using
DISPLAY; use the BINLIB command to assign it.
Examples:
3-32
BINLIB BL1
DOMAIN D
current domain is D
D X*
47 A2 36UJ Rev05
Command Management
3.8.12
DISPLAY_SCREEN (DSCRN)
Purpose:
To display screens attached to a GCL procedure without leaving MNCMD.
The characteristics and the rules for the display of the screens are similar to those
in interactive mode menu.
The command process execution is the same as the one executed when proc_name
followed by the "?" character is entered at prompting level of a processor, but the
execution stops after the display of the screens.
This command is used as a tool to debug the screens look (Keywords order,
prompts and notes choice).
Syntax:
{ DISPLAY_SCREEN }
{ DSCREEN }
{ DSCRN }
{ PROCEDURE | PROC } = name31
[ DOMAIN = name31 ]
Parameters:
PROCEDURE
DOMAIN
Constraints:
Restrictions on displaying_screen:
a procedure compiled with SOURCE = 0 in the COMPILE, SAVE or
47 A2 36UJ Rev05
3-33
allows the access and execution of the procedure for an IOF user:
OPACC: contains at least the value 5.
OPHID: the procedure is not hidden.
LIMITED_ACCESS = 0: the procedure can be called directly.
Restrictions on DISPLAY_SCREEN:
the procedure must exist in the specified or current domain.
the BIN library must be assigned through BINLIB command before
DISPLAY_SCREEN is used.
DISPLAY_SCREEN cannot be used in BATCH mode.
DISPLAY_SCREEN command is provided as a tool to help the user during
the development phase. If more than one user uses this command to display
the same procedure on a same BINLIB, at the same time, some error
messages may occur.
To suppress most of the constraints in the use of DISPLAY_SCREEN command,
we recommended to set the right values of OPACC, OPHID and
LIMITED_ACCESS only at the end of the development phase.
Example:
3-34
BINLIB BLIB1
DOMAIN MYDMN
DSCRN MYPROC
47 A2 36UJ Rev05
Command Management
3.8.13
DOMAIN
Purpose:
To define the current domain. A domain is a set of related compiled procedures
stored in the binary library. In the library, the domain is a member and the
procedures are stored as sets of consecutive records within the member.
Syntax:
DOMAIN
DOMAIN=name31
Description of Parameter:
DOMAIN
Constraints:
None
Examples:
BINLIB BL1
SLLIB SL1
DOMAIN AA
current domain is AA
COMPILE P1
DOMAIN BB
LOAD P1
47 A2 36UJ Rev05
3-35
3.8.14
EDIT (ED)
Purpose:
To call the Text Editor, by means of which one can create or modify a source text
in the source language (SL) library.
Syntax:
{ EDIT }
{
}
{ ED
}
Description of Parameters:
None
Constraints:
The Text Editor can only be used on a source language (SL) library member
3-36
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BLIB
SLLIB SLIB
DOMAIN D1
current domain is D1
DECOMPILE MYPROC
EDIT
.
.
.
COMPILE MYPROC
47 A2 36UJ Rev05
}
} sequence of Text Editor requests
}
3-37
3.8.15
ENVT
Purpose:
To create a new environment (or modify an existing one) by defining the families
to which the environment has access. ENVT can be used only by the System
Administrator.
Syntax:
ENVT
ENVIRONMENT=name12
FAMILIES=( dec3 [ -dec3 ]...[ dec3 [ -dec3 ])
[ MODE={ CR | ADD | DL }]
Description of Parameters:
ENVIRONMENT
FAMILIES
3-38
47 A2 36UJ Rev05
Command Management
MODE
=ADD
=DL
=CR
Constraints:
None
Examples:
ENVT ENVT-1 (1,2)
ENVT MYENV 10
ENVT AA 0
delete environment AA
ENVT BB (1,2,3)
ENVT BB (1,2,3,4)
ENVT BB 5
47 A2 36UJ Rev05
3-39
3.8.16
FSE
Purpose:
To call the Full Screen Editor for creating or modifying a text member in an SL
(source language) library.
Syntax:
FSE
Parameters:
None
Constraints:
FSE can only be used on an SL library member; to use it on a compiled procedure
in a BIN library:
first convert the procedure to source text through the DECOMPILE command
store it as an SL library member; the SL library must be assigned through the
command.
FSE is described in the Full Screen Editor User's Guide.
Examples:
BINLIB BLIB
SLLIB SLIB
DOMAIN D-2
DECOMPILE MYPROC decompile MYPROC of domain D-2 and store text in SLIB
FSE
.
.
.
}
}
}
COMPILE MYPROC
3-40
47 A2 36UJ Rev05
Command Management
3.8.17
LEDIT (LED)
Purpose:
To activate the Line Editor to operate on lines in the workspace:
Syntax:
{ LEDIT }
{
}
{ LED
}
Parameters:
None
Constraints:
Insert
To insert a line, enter the line number, a colon and the command to be inserted. If a
line of that number already exists, it is replaced by the new line. Each line is
checked as it is entered (same as in CREATE).
Example:
100: GOTO ERROR;
47 A2 36UJ Rev05
3-41
Delete
To delete a line, enter the line number and the letter D. To delete more than one
line, enter a list of line numbers, separated by commas, then D. To delete a range
of lines, enter the first and last line numbers, separated by a dash, then D.
Example:
10D
delete line 10
20,50,80D
20-80D
Print
To print a line, enter the line number and the letter P. To display more than one
line, enter a list of line numbers, separated by commas, then P. To display a range
of lines, enter the first and last line numbers, separated by a dash, then P.
Example:
3-42
40P
print line 40
20,50,180P
20-180P
47 A2 36UJ Rev05
Command Management
Substitute
To replace an existing character string with a new character string, use the
substitute request of format: S/old-string/new-string/
The S request must be preceded by the number(s) of the lines(s) to be substituted.
Every occurrence of the old string is replaced by the new string.
Example:
replace xyz with ABCDE in line 10
replace xy(z) with AB in lines 70, 150, and 220
replace 22; with character ; in lines 10 through 80
10S/ABCDE/xyz/
70,150,220S/AB/xy(z)/
10-80S/;/22;/
If P is entered at the end of the request, the line(s) involved in the substitution are
displayed after the substitution has been done.
Example:
190-400S/CALL A/CALL BB/P
Slash (/) is the delimiter in all of the examples above, however the following
characters also serve as delimiters:
/ ! # ' % & * = [ ] [ . + - $ ; > < ( )
BINLIB BL
LOAD MYPROC
LED
I:...
I:...
I:...
I:/
RESAVE
47 A2 36UJ Rev05
3-43
3.8.18
LIST (LS)
Purpose:
To display the names of all the procedures of a given domain in the current BIN
library dates of their most recent modification and the number of their commands.
Syntax:
{ LIST }
{
}
{ LS
}
{ PROCEDURES } { *
}
{
}={ star62
}
{ PROC
} {( name31 [ name31 ]...)}
[{ DOMAIN | DOMAINS }=star62 ]
[{ ENVT | ENVIRONMENT }=name12 ]
[ OPACC=( dec1 [ dec1 ]...)]
[ OPHID=( dec1 [ dec1 ]...)]
[ ACCESS=( dec3 [ dec3 ]...)]
[ HIDE=( dec3 [ dec3 ]...)]
[ OWNER={ 0 | bool }]
Description of Parameters:
3-44
PROCEDURES
DOMAINS
ENVIRONMENT
OPACC
OPHID
47 A2 36UJ Rev05
Command Management
ACCESS
HIDE
OWNER
=1
=0
Constraints:
The BIN library must be assigned through the BINLIB command before LIST can
be used.
Examples:
BINLIB BLIB
DOMAIN D
current domain is D
LS
LS PR* PAYROLL
47 A2 36UJ Rev05
3-45
3.8.19
LIST_ACCESS (LSA)
Purpose:
To list the access rights and priorities of the procedures of a given domain stored in
the current BIN library.
Syntax:
{ LIST_ACCESS }
{
}
{ LSA
}
[{ PROCEDURES } { *
}]
[{
}={ star62
}]
[{ PROC
} {( name31 [ name31 ]...)}]
[{ DOMAIN | DOMAINS }=star62 ]
Description of Parameters:
PROCEDURES
DOMAINS
Constraints:
Access rights are listed in the form of two arrays and a status character:
means that the procedure is accessible
"+"
means that it is accessible but hidden
"-"
"space" means that the procedure is not accessible.
The BIN library must be assigned through the BINLIB command before
3-46
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BLIB
DOMAIN D
current domain is D
LSA
LSA ^E* D2
47 A2 36UJ Rev05
3-47
3.8.20
LIST_ENVT (LSENVT)
Purpose:
To display the list of the families to which the specified environment(s) have
access.
Syntax:
{ LIST_ENVT }
{
}
{ LSENVT
}
ENVIRONMENTS=star24
Description of Parameters:
ENVIRONMENTS
Constraints:
None
Examples:
3-48
LSENVT ENV1
LSENVT E*
47 A2 36UJ Rev05
Command Management
3.8.21
LIST_PROJ (LSPROJ)
Purpose:
To list the environments to which the specified project(s) have access.
Syntax:
{ LIST_PROJ }
{
}
{ LSPROJ
}
PROJECTS=star24
Description of Parameter:
PROJECTS
Constraints:
None
Examples:
LSPROJ PT1
LSPROJ PT*
47 A2 36UJ Rev05
3-49
3.8.22
LOAD (LD)
Purpose:
To load a procedure from the BIN library into the workspace.
Syntax:
{ LOAD }
{
}
{ LD
}
{ PROC | PROCEDURE }=name31
[ DOMAIN=name31 ]
Description of Parameters:
PROC
DOMAIN
Constraints:
Restrictions on loading:
a procedure compiled with SOURCE=0 in the COMPILE, SAVE or RESAVE
3-50
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BLIB1
DOMAIN MYDMN
LD MYPROC
LEDIT
.
.
.
/
RESAVE
47 A2 36UJ Rev05
3-51
3.8.23
MERGE
Purpose:
To merge two existing domains into a single one by selectively copying the
procedures of the input domain into the output domain:
input domain procedures absent in the output domain are copied into it
input domain procedures replace those of identical names in the output domain.
Syntax:
MERGE
OUTDOM=name31
INDOM=name31
[{ INLIB | IL }=lib78 ]
- - - - - - - - - - - - - - - - - - [ OLDVERS={ 0 | bool }]
Description of Parameters:
3-52
OUTDOM
INDOM
INLIB
OLDVERS
=1
=0
47 A2 36UJ Rev05
Command Management
Constraints:
Restrictions on MERGE:
the output library must be assigned through the command BINLIB before
Examples:
BINLIB BLIB1
47 A2 36UJ Rev05
3-53
3.8.24
MODIFY_ACCESS (MDA)
Purpose:
Reserved for the System Administrator: To modify the access rights or priorities of
procedures of the current BIN library.
Syntax:
{ MODIFY_ACCESS }
{
}
{ MDA
}
}
{ PROCEDURES } { star62
{
}={
}
{ PROC
} {( name31 [ name31 ]...)}
[ DOMAIN=name31 ]
[ PRTY=dec3 ]
[ ACCESS=( nnn [ -nnn ]...[ nnn [ -nnn ]])]
[ ACCESS_MODE={ DL | ADD | RPL }]
[ HIDE=( nnn [ -nnn ]...[ nnn [ -nnn ]])]
[ HIDE_MODE={ ADD | DL | RPL }]
[ OPACC=( dec1 [ dec1 ]...)]
[ OPACC_MODE={ DL | ADD | RPL }]
[ OPHID=( dec1 [ dec1 ]...)]
[ OPHID_MODE={ ADD | DL | RPL }]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - [ NO_ACCESS=( nnn [ -nnn ]...[ nnn [ -nnn ]])]
[ NO_OPACC=( dec1 [ dec1 ]...)]
[ LIMITED_ACCESS=bool ]
Description of Parameters:
3-54
PROCEDURES
DOMAIN
PRTY
47 A2 36UJ Rev05
Command Management
ACCESS
ACCESS_MODE
=ADD
=RPL
=DL
HIDE
HIDE_MODE
=DL
=RPL
=ADD
OPACC
OPACC_MODE
=ADD
=RPL
=DL
OPHID
47 A2 36UJ Rev05
3-55
OPHIDE_MODE
=DL
=RPL
=ADD
NO_ACCESS
HIDE
OPHID
NO_OPACC
LIMITED_ACCESS
=0
=1
Constraints:
Restrictions on MODIFY_ACCESS:
the BIN library must be assigned through the BINLIB command before
3-56
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BLIB
DOMAIN D
MDA E1 NO_OPACC=4
MDA E2 OPHID=4
47 A2 36UJ Rev05
3-57
3.8.25
MODIFY_LOCK (MDLK)
Purpose:
To lock or unlock procedures of a given domain in the current BIN library.
Syntax:
{ MODIFY_LOCK }
{
}
{ MDLK
}
{ PROCEDURES } { star62
}
{
}={
}
{ PROC
} {( name31 [ name31 ]...)}
[ DOMAIN=name31 ]
NEWVALUE={ LOCK | UNLOCK }
Description of Parameters:
PROCEDURES
DOMAIN
NEWVALUE
=LOCK
=UNLOCK
Constraints:
The BIN library must be assigned through the BINLIB command
SADMOPT.
3-58
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BLIB
47 A2 36UJ Rev05
3-59
3.8.26
ON_ERROR
Purpose:
To specify the action of MAINTAIN_COMMAND if an error of Severity 3 occurs
during the execution of a command.
Syntax:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ON_ERROR
[ ACTION={ DEFAULT | ABORT | CONTINUE | RESET }]
Description of Parameters:
ACTION
=ABORT
MAINTAIN_COMMAND is terminated.
=CONTINUE
=RESET
=DEFAULT
Constraints:
None
3-60
47 A2 36UJ Rev05
Command Management
Examples:
ON_ERROR ACTION=ABORT
if a Sev 3 error occurs, abort
MAINTAIN_COMMAND
ON_ERROR RESET
47 A2 36UJ Rev05
3-61
3.8.27
PRINT (PR)
Purpose:
To print one or more procedures of a given domain stored in the current BIN
library. PRINT operates only on compiled procedures stored in the current BIN
library. To print all or part of the workspace, use the P request of the Line Editor
(LEDIT) command.
Syntax:
{ PRINT }
{
}
{ PR
}
{ PROCEDURES } { star62
}
{
}={
}
{ PROC
} {( name31 [ name31 ]...)}
[ DOMAIN=name31 ]
Description of Parameters:
PROCEDURES
DOMAIN
Constraints:
Restrictions on printing:
a procedure compiled with SOURCE=0 in the COMPILE, SAVE or RESAVE
3-62
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BLIB
DOMAIN D
PR P1
PR A1 AA
PR * DMN1
47 A2 36UJ Rev05
3-63
3.8.28
PROJ
Purpose:
Reserved for the System Administrator: To specify the environment(s) to which a
project has access.
Syntax:
PROJ
PROJECT=name12
ENVIRONMENTS=( name12 [ name12 ]...)
[ MODE={ CR | ADD | DL }]
Description of Parameters:
PROJECT
ENVIRONMENTS
MODE
=ADD
=DL
=CR
3-64
47 A2 36UJ Rev05
Command Management
Constraints:
The environment(s) must exist before they can be specified in PROJ. To create an
environment, use ENVT. The general project structure is as follows:
USER
default
PROJECT
default
ENVIRONMENT
Examples:
PROJ PR1 (ENV1, ENV2, ENV3)
PROJ AA E1
PROJ P3 0
47 A2 36UJ Rev05
3-65
3.8.29
QUIT (Q)
Purpose:
To leave the Command Management processor.
Syntax:
{ QUIT }
{
}
{ Q
}
Parameters:
None
Constraints:
If the contents of the workspace have been modified since loaded, and no SAVE or
RESAVE has been made, the system asks whether the user wants to save what has
been edited. Reply YES or NO as appropriate.
Example:
QUIT or Q
3-66
leave MAINTAIN_COMMAND
47 A2 36UJ Rev05
Command Management
3.8.30
RESAVE (RSV)
Purpose:
To replace an existing procedure in the BIN library with the contents of the
workspace:
the new procedure is created with the same name as the old one
if no procedure of that name exists, RESAVE creates a new one.
Syntax:
{ RESAVE }
{
}
{ RSV
}
[ FORCE={ 0 | bool }]
[ DOMAIN=name31 ]
[ SOURCE={ 1 | bool }]
- - - - - - - - - - - - - - - - - - [ OLDVERS={ 0 | bool }]
Description of Parameters:
FORCE
=1
=0
DOMAIN
47 A2 36UJ Rev05
3-67
SOURCE
=0
=1
OLDVERS
=1
=0
Constraints:
Restrictions on RESAVE:
if FORCE is omitted, incomplete or erroneous procedures are discarded
the BIN library must be assigned through the BINLIB command before
SYS.HBINLIB
the source code for procedures compiled in standard domains is not saved in
the binary library. See Section 10 of the GCOS 7-V6 System Administrator's
Manual for the list of standard domains.
3-68
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BL1
DOMAIN DMN
LD P1
LEDIT
.
.
.
/
RSV
47 A2 36UJ Rev05
3-69
3.8.31
RESEQUENCE (RSQ)
Purpose:
To renumber the lines in the workspace.
Syntax:
{ RESEQUENCE }
{
}
{ RSQ
}
[ INIT={ 10 | dec6 }]
[ STEP={ 10 | dec6 }]
Description of Parameters:
INIT
STEP
Constraints:
None
Examples:
3-70
RSQ
RSQ 100
RSQ 100 20
47 A2 36UJ Rev05
Command Management
3.8.32
RESET
Purpose:
Reserved for the System Administrator: To reset the original access rights and
priorities of procedures in the current domain stored in the current BIN library.
Syntax:
RESET
{ PROCEDURES } { star62
}
{
}={
}
{ PROC
} {( name31 [ name31 ]...)}
[ DOMAIN=name31 ]
Description of Parameters:
PROCEDURES
DOMAIN
Constraints:
The BIN library must be assigned through the BINLIB command RESET can be
used
Star-name applies only to procedure names not to aliases.
Examples:
BINLIB BLIB
DOMAIN D
RESET DC*
RESET *
47 A2 36UJ Rev05
3-71
3.8.33
RESTORE_ACCESS (RSTA)
Purpose:
Reserved for the System Administrator and restricted to users of the SYSADMIN
project: To restore the access rights previously saved in an SL library member by
SAVE_ACCESS, of all procedures of a domain.
Syntax:
{ RESTORE_ACCESS }
{
}
{ RSTA
}
{ star62
}
DOMAINS={
}
{( name31 [ name31 ]...)}
[ PREFIX=name6 ]
[ LIST={ NEW | ALL | NO }]
Description of Parameters:
DOMAINS
PREFIX
LIST
=ALL
=NO
=NEW
Constraints:
BIN and SL libraries must both be assigned through BINLIB and SLLIB
commands before RESTORE_ACCESS can be used.
3-72
47 A2 36UJ Rev05
Command Management
Examples:
BINLIB BL1
SLLIB SL1
47 A2 36UJ Rev05
3-73
3.8.34
SAVE (SV)
Purpose:
To store the contents of the workspace as a compiled procedure in the current BIN
library. The compiled procedure is given the procedure name specified in the
PROC command which heads the procedure.
Syntax:
{ SAVE }
{
}
{ SV
}
[ FORCE={ 0 | bool }]
[ DOMAIN=name31 ]
[ SOURCE={ 1 | bool }]
- - - - - - - - - - - - - - - - - - [ OLDVERS={ 0 | bool }]
Description of Parameters:
FORCE
=1
=0
DOMAIN
3-74
47 A2 36UJ Rev05
Command Management
SOURCE
=0
=1
OLDVERS
=1
=0
Constraints:
See RESAVE.
Examples:
BINLIB BL1
DOMAIN DMN
CREATE
10:PROC P1 ...
20:...
30:...
40:/
SV
47 A2 36UJ Rev05
3-75
3.8.35
SAVE_ACCESS (SVA)
Purpose:
Restricted to users of the SYSADMIN project: To save the access rights of all
procedures of a domain in a member of an SL library
defined by parameters of the basic GCL command PROC:
ACCESS
HIDE
LIMITED_ACCESS
LOCK
OPACC
PRIORITY
MODIFY_LOCK.
Syntax:
{ SAVE_ACCESS }
{
}
{ SVA
}
{ star62
}
DOMAINS={
}
{( name31 [ name31 ]...)}
[ PREFIX=name6 ]
[ REPLACE={ 0 | bool }]
Description of Parameters:
DOMAINS
PREFIX
REPLACE
=1
=0 (default)
3-76
47 A2 36UJ Rev05
Command Management
Constraints:
Restrictions on SAVE_ACCESS:
BIN and SL libraries must both be assigned through BINLIB and SLLIB
necessary, to 31 characters:
Examples:
BINLIB BL1
SLLIB SL1
47 A2 36UJ Rev05
3-77
3.8.36
SLLIB
Purpose:
To assign an SL library:
if an SL library is already assigned, it is replaced by the library specified in
SLLIB
if the SLLIB command is specified without a library name, the current SL
library is deassigned.
Syntax:
SLLIB
[ LIBRARY=lib78 ]
Description of Parameter:
LIBRARY
Name of an SL library.
Default: the current SL library.
Constraints:
If no SL library is assigned, any attempt to perform an operation which involves an
SL library such as FSE will result in an error.
Examples:
3-78
SLLIB SLIB1
SLLIB SL2:K152:MS/D500
SLLIB
47 A2 36UJ Rev05
Command Management
3.8.37
STATUS (ST)
Purpose:
To display information on the current context: assigned BIN and SL libraries, the
name of the current domain, the number of lines in the workspace, and the current
value of ON_ERROR.
Syntax:
{ STATUS }
{
}
{ ST
}
Parameters:
None
Constraints:
None
Example:
display current context
STATUS or ST
C: ST
SLLIB
: LINT.CUR.SLLIB$CAT (BVU630:MS/B10)
BINLIB : LINT.TEST.TBINLIB$CAT (BVU630:MS/B10)
WORKSPACE IS EMPTY
CURRENT DOMAIN : CMDMGT
ON_ERROR ACTION = DEFAULT
47 A2 36UJ Rev05
3-79
3-80
47 A2 36UJ Rev05
See Paragraph "GCOS File Access Commands" for details on these GCL
commands.
4.1
Files
Each file to be accessed must have been:
previously declared by the DECLARE_FILE command which associates:
the efn (External File Name) of the file
with its sfn (Symbolic File Name) given by the user
and opened by the OPEN_FILE command which specifies whether the file is to
47 A2 36UJ Rev05
4-1
4.2
Command Parameters
Unless otherwise stated, input parameters may receive either a literal value or the
contents of a GCL variable. GCL variable names must be different from the
keyword names of GCL procedures.
4.3
Completion Codes
The completion codes of all command functions (except
LIST_DECLARED_FILE) are returned to the variable specified in the STATUS
parameter. This variable must be declared with TYPE=DEC and LENGTH=3,
except for the EXIST_FILE command where the declaration is TYPE=CHAR and
LENGTH=32.
Parameter STATUS is mandatory in batch mode. In interactive mode, if STATUS
is omitted, abnormal completion codes will be displayed on the user's terminal.
4.4
Address Format
For UFAS sequential and relative disk files, the address format specified in the
ADDR parameter must be the logical record number. For UFAS indexed disk files,
in direct access mode ACCMODE=D, only the key may be used. For libraries and
tape files, direct access is not authorized. The first logical record is record 1.
4.5
Temporary Files
Since most files to be accessed already exist, their organization is defined and will
be automatically retrieved. Temporary files or sequential tape files will be created
as UFAS sequential files with RECSIZE=255, CISIZE=2048, and RECFORM=FB.
Subfiles of SL libraries will be created. Dummy files are not supported.
4.6
Types of Access
The files to be processed depend on the type of access:
SEQUENTIAL
DIRECT
4-2
47 A2 36UJ Rev05
4.7
Access Requirements
UFAS disk files, libraries, and tape files have specific access requirements:
Libraries
The access mode must be sequential.
The commands MODIFY_RECORD and DELETE_RECORD are not authorized.
In input mode, SSF format is not returned to the user. In output mode, no SSF is
created.
For non-SL libraries, the access mode must be READ, SPREAD, or ALLREAD.
Only read operations are authorized.
Tape Files
The access mode must be sequential.
The commands POINT_RECORD, DELETE_RECORD, and MODIFY_RECORD
are not authorized.
47 A2 36UJ Rev05
4-3
4.8
Break Processing
GCOS file access commands can be used to create GCL procedures that can be
executed in batch mode or in interactive mode. The Break key or equivalent can be
used, in interactive mode to interrupt these procedures, provided the procedures
can manage the interrupts. The capability to do so is given to the GCL procedures
when they are created if required.
Two system variables are available:
or
MP BRKPMODE={ 0 | 1 }
The setting of PRKPMODE determines which can and does manage the Break
interrupts:
if 1 is specified, GCL procedures
if 0 is specified, the GCL processor.
#BRK (BReaK)
Type=char
Length=1
#BRK may be set to 0 or 1. The value 0 indicates that no interrupt request has
been processed.
In the following example:
the user sets and resets the #BRK variable to 0 with "LET #BRK 0."
#BRK is set to 1 when the following series of actions occur:
4-4
47 A2 36UJ Rev05
4.9
COMM
COMM
COMM
COMM
COMM
COMM
PROC
'**************************************************';
'
PROCEDURE PRINT_SOURCE
';
'PRINT SEQUENTIAL FILES IN SOURCE FORMAT OR
';
'LIBRARY MEMBERS. RECORDS GREATER THAN 255
';
'BYTES WILL BE TRUNCATED.
';
'**************************************************';
NAME=(PRINT_SOURCE,PRS)
PROMPT='PRINT A SOURCE FILE';
KWD NAME=FILE_NAME
TYPE=FILE
MSSG='ERRONEOUS VALUE FOR FILE NAME'
PROMPT='FILE TO BE PRINTED';
LOCAL ST DEC 5;
LOCAL WAZ CHAR 255;
LOCAL LG DEC 5;
LOCAL NM CHAR 15;
LET #BRKPMODE 1;
LET #BRK 0;
LET NM '';
LET # #CAT('FILE:',%FILE_NAME);
LET # '';
DCLF FIL,FILE=%FILE_NAME,ACCESS=READ,STATUS=ST;
IF #NE(%ST,0);
EDFERR SFN=FIL,COMMAND='DCLF',ERROR=%ST
GOTO RESET_BREAK;
ENDIF;
OPENF FIL,PMD=IN,ACCMODE=S,STATUS=ST;
IF #NE(%ST,0);
EDFERR SFN=FIL,COMMAND='OPENF',ERROR=%ST;
GOTO RELEASE_FILE;
ENDIF;
LABEL LOOP;
IF #EQ(#BRK,1);
GOTO CLOSE_FILE;
47 A2 36UJ Rev05
4-5
ENDIF;
RDREC FIL,WA=WAZ,LENGTH=LG,STATUS=ST;
IF #OR(#EQ(%ST,0) #EQ(%ST,1));
LET # #SUBSTR(%WAZ,1,%LG);
GOTO LOOP;
ENDIF;
IF #NE(%ST,2);
EDFERR SFN=FIL,COMMAND='RDREC',ERROR=%ST;
ENDIF;
LABEL CLOSE_FILE;
CLOSEF FIL,STATUS=ST;
LABEL RELEASE_FILE;
RLSF FIL,STATUS=ST;
LABEL RESET_BREAK;
LET #BRKPMODE 0;
LET #BRK 0;
ENDPROC;
4-6
47 A2 36UJ Rev05
4.10
CLOSE_FILE
DECLARE_FILE
DELETE_RECORD
EDIT_FILE_ERROR
EXIST_FILE
LIST_DECLARED_FILE
OPEN_FILE
POINT_RECORD
READ_RECORD
RELEASE_FILE
RETURN_DECLARED_FILE
WRITE_RECORD
47 A2 36UJ Rev05
4-7
4.10.1
BUILD_RECORD (BREC)
Purpose:
Moves a GCL variable into the buffer attached to a UFAS sequential, relative, or
indexed disk file, library, or tape file.
Syntax:
{ BUILD_RECORD }
{
}
{ BREC
}
SFN = name16
[ WA = name31 ]
INDEX = dec5
[ LENGTH = dec5 ]
[ STATUS = name31 ]
Parameters:
4-8
SFN
WA
INDEX
LENGTH
47 A2 36UJ Rev05
STATUS
Constraints:
If LENGTH is greater than the data length in WA, the buffer is padded with
blanks.
If INDEX + LENGTH is greater than the size of the buffer, completion code 278
Examples:
BREC SFN=MYFILE0002 WA=BRECWAVAR INDEX=50 LENGTH=250
STATUS=BRECVAR
{move string in GCL variable BRECWAVAR to buffer
attached to MYFILE0002; string is 250 characters
long; first character to be written to rank
(position) 50 of buffer; GCL variable BRECVAR will
receive completion code}
BREC SFN=MYFILE0018 INDEX=0 STATUS=BRECVAR
{the buffer attached to MYFILE0018 will be initialized
with blanks; GCL variable BRECVAR will receive the
completion code}
BREC SFN=MYFILE0018 WA=BRECWAVAR INDEX=0 LENGTH=4000
STATUS=BRECVAR
{same as above; WA and LENGTH are ignored}
47 A2 36UJ Rev05
4-9
4.10.2
CLOSE_FILE (CLOSEF)
Purpose:
Closes an opened file referenced by its symbolic file name (SFN).
Syntax:
{ CLOSE_FILE }
{
}
{ CLOSEF
}
{ ( name16 [ name16 ] ... ) }
SFN = {
}
{ star36
}
[ STATUS = name31 ]
Parameters:
SFN
STATUS
Constraints:
STATUS must be used in Batch Mode.
4-10
47 A2 36UJ Rev05
Examples:
CLOSEF SFN=(MYFILE0008,MYFILE0020) STATUS=CLOSEFVAR
{close the files identified by SFNs MYFILE0008 and
MYFILE0020; GCL variable CLOSEFVAR will receive the
completion code}
CLOSEF SFN=MYFILE* STATUS=CLOSEFVAR
{as above, but for all SFNs beginning with MYFILE}
CLOSEF * STATUS=CLOSEFVAR
{as above, but for all user SFNs}
47 A2 36UJ Rev05
4-11
4.10.3
DECLARE_FILE (DCLF)
Purpose:
Declares UFAS sequential, relative, or indexed disk files; libraries; or sequential
tape files by associating a symbolic file name (SFN) with the file description.
Does not check whether the file exists and does not assign it.
Syntax:
{ DECLARE_FILE }
{
}
{ DCLF
}
SFN = name16
FILE = file78
ACCESS = { WRITE|READ|SPREAD|SPWRITE|ALLREAD|RECOVERY }
[ SHARE = { NORMAL|ONEWRITE|FREE|DIR|MONITOR } ]
[ STATUS = name31 ]
Parameters:
SFN
FILE
ACCESS
4-12
= WRITE
= READ
= SPREAD
47 A2 36UJ Rev05
= SPWRITE
= ALLREAD
= RECOVERY
SHARE
= ONEWRITE
= FREE
no restriction on access.
= DIR
= MONITOR
For a library file, cataloged or uncataloged, when the subfile name is specified, the
default value for SHARE is DIR. If the file is not a library file, the default value
for SHARE is NORMAL (see Constraints).
The sharing of a file becomes effective once the file is assigned. A file processed
by GCL is:
assigned by the command OPEN_FILE.
deassigned explicitly by commands CLOSE_FILE and RELEASE_FILE, or
implicitly at the end of a step or at the end of a job. When a file is deassigned at
the end of a step, it remains deassigned until the next command that accesses the
file (READ_RECORD, WRITE_RECORD, etc.) is executed.
47 A2 36UJ Rev05
4-13
Example:
S:
S:
S:
S:
S:
S:
S:
S:
S:
S:
S:
C:
C:
C:
C:
S:
S:
DCLF F1...
.....
OPENF F1...
.....
.....
.....
CLOSEF F1...
.....
OPENF F1...
.....
MNLIB SL...
.....
RDREC F1...
.....
/
.....
.....
STATUS
+----------------------------+
| F1 not assigned
|
+----------------------------+
|
|
| F1 assigned
|
|
|
+----------------------------+
| F1 deassigned
|
+----------------------------+
| F1 assigned
|
+----------------------------|
| F1 deassigned
|
+----------------------------|
| F1 assigned
|
+----------------------------+
| F1 deassigned
|
+----------------------------+
Constraints:
For cataloged files, the default values for parameters ACCESS and SHARE can
be specified in the catalog. When this is the case, both the default values for
DECLARE_FILE and those values given explicitly are either ignored or
interpreted in a particular way, according to the method of access. The effective
values of ACCESS and SHARE are discussed in the Data Management Utilities
User's Guide.
SHARE=MONITOR may be used only if ACCESS=READ or SPREAD or
ALLREAD.
STATUS must be used in Batch Mode.
4-14
47 A2 36UJ Rev05
Examples:
DCLF SFN=MYFILE0003 FILE=TESTFILE$RES ACCESS=READ
SHARE=NORMAL STATUS=DCLFVAR
{declare resident file TESTFILE with SFN MYFILE0003;
access input only; maximum level concurrent access is
one writer or several readers; DCLFVAR will receive
completion code}
DCLF SFN=MYFILE0014 FILE=CHECKFILE:VOL5:MS/D500 SHARE=ONEWRITE
STATUS=DCLFVAR
{declare file CHECKFILE with SFN MYFILE0014; ACCESS
defaults to WRITE; SHARE specifies one writer and
several readers; DCLFVAR will receive the completion
code}
47 A2 36UJ Rev05
4-15
4.10.4
DELETE_RECORD (DLREC)
Purpose:
Deletes a record in UFAS disk files.
Syntax:
{ DELETE_RECORD }
{
}
{ DLREC
}
SFN = name16
[ KEY = char251 ]
[ ADDR = dec10 ]
[ STATUS = name31 ]
[ HEXA_KEY = char252 ]
Parameters:
4-16
SFN
KEY
ADDR
47 A2 36UJ Rev05
STATUS
HEXA_KEY
47 A2 36UJ Rev05
4-17
Constraints:
The file must be opened in UP (update) processing mode.
KEY, HEXA_KEY and ADDR are mutually exclusive.
UFAS Sequential Disk Files
The last issued command must have been a successful READ_RECORD. The
record retrieved by READ_RECORD is deleted. KEY, HEXA_KEY and
ADDR are not allowed.
UFAS Relative Disk Files
Examples:
DLREC SFN=MYFILE0002 ADDR=874 STATUS=DLRECVAR
{delete record at address 874 in UFAS relative disk
file identified by SFN MYFILE0002; GCL variable
DLRECVAR will receive the completion code}
DLREC SFN=MYFILE0020 KEY=4007832215 STATUS=DLRECVAR
{delete the record whose key is 4007832215 in UFAS
indexed disk file identified by SFN MYFILE0020; GCL
variable DLRECVAR will receive the completion code}
4-18
47 A2 36UJ Rev05
4.10.5
EDIT_FILE_ERROR (EDFERR)
Purpose:
Returns information on the last error that has occurred on a file. The information is
displayed on the active output device (user's terminal or SYSOUT), or, if the WA
parameter is specified, is placed in the working area. This command cannot be
used after the commands EXIST_FILE, LIST_DECLARED_FILE,
RETURN_DECLARED_FILE, and EDIT_FILE_ERROR.
Syntax:
{ EDIT_FILE_ERROR }
{
}
{ EDFERR
}
[ SFN = name16 ]
[ COMMAND = char10 ]
[ ERROR = dec3 ]
[ WA = name31 ]
[ STATUS = name31 ]
Parameters:
SFN
COMMAND
47 A2 36UJ Rev05
4-19
ERROR
WA
SFN
COMMAND
--16 chars
--------10 chars
ERROR
(edited format)
--------------70 chars
G4
(edited format)
--------------30 chars
Constraints:
EDFERR cannot be used after commands EXIST_FILE,
LIST_DECLARED_FILE, RETURN_DECLARED_FILE, and
EDIT_FILE_ERROR.
STATUS must be used in Batch Mode.
4-20
47 A2 36UJ Rev05
Examples:
EDFERR SFN=MYFILE0008 COMMAND=WRREC_ERR ERROR=300
STATUS=EDFERRVAR
{SFN, G4 value in edited format, and "WRREC_ERR"
message will be displayed on the active output
device; GCL variable EDFERRVAR will receive the
completion code for EDFERR}
EDFERR ERROR=256 WA=EDFERRWAVAR STATUS=EDFERRVAR
{literal corresponding to completion code 256 will be
written to the working area EDFERRWAVAR; variable
EDFERRVAR will receive the completion code for EDFERR}
47 A2 36UJ Rev05
4-21
4.10.6
EXIST_FILE (EXISTF)
Purpose:
Determines whether a file exists.
Syntax:
{ EXIST_FILE }
{
}
{ EXISTF
}
FILE = file78
[ STATUS = name31 ]
Parameters:
FILE
external_file_name[..subfile_name][:media:dvc][$attributes]
STATUS
Byte 1
-----0
State
----The file does not exist.
Spaces
Unknown state.
Constraints:
STATUS must be used in Batch Mode.
4-22
47 A2 36UJ Rev05
Examples:
EXISTF FILE=TESTFILE$RES STATUS=EXISTFVAR
{EXISTF determines whether resident file TESTFILE
exists, and writes the result to GCL variable
EXISTFVAR}
EXISTF FILE=TESTFILE..SUBTEST2:VOL1:MS/D500 STATUS=EXISTFVAR
{EXISTF determines whether subfile SUBTEST2 of file
TESTFILE exists, and writes the result to EXISTFVAR}
47 A2 36UJ Rev05
4-23
4.10.7
LIST_DECLARED_FILE (LSDCLF)
Purpose:
Displays information about declared user files. This information is displayed on
the active output device, either the user's terminal or SYSOUT.
Syntax:
{ LIST_DECLARED_FILE }
{
}
{ LSDCLF
}
{ ( name16 [ name16 ] ...) }
[ SFN = { star36
} ]
{ *
}
[ FILE = bool ]
[ IFN = bool ]
[ STATE = bool ]
[ ORG = bool ]
[ PMD = bool ]
[ ACCMODE = bool ]
Parameters:
4-24
SFN
FILE
IFN
STATE
47 A2 36UJ Rev05
ORG
PMD
ACCMODE
Constraints:
If only SFN is specified, then all information about the files is displayed.
If SFN and at least one other parameter are specified, all other unspecified
Normal:
0: Normal execution of command.
Abnormal:
257: No declared file.
265: System error: argument error.
266: System error: file structure not available.
Examples:
LSDCLF SFN=(MYFILE0002,MYFILE0009) IFN=1 ORG=1 ACCMODE=1
{displays for the files identified by SFNs MYFILE0002
and MYFILE0009 the IFNs, file organizations, and
access modes}
LSDCLF SFN=MYFILE* FILE STATE PMD
{displays for all files whose SFNs begin with MYFILE
the file descriptions, file states, and processing
modes}
LSDCLF
47 A2 36UJ Rev05
4-25
4.10.8
MODIFY_RECORD (MDREC)
Purpose:
Modifies (overwrites) a record in a UFAS disk file. The file must be opened in UP
(update) processing mode. This command is not authorized for libraries or tape
files.
Syntax:
{ MODIFY_RECORD }
{
}
{ MDREC
}
SFN = name16
[ KEY = char251 ]
[ ADDR = dec10 ]
[ WA = name31 ]
[ LENGTH = dec5 ]
[ STATUS = name31 ]
[ HEXA_KEY = char252 ]
Parameters:
4-26
SFN
KEY
ADDR
47 A2 36UJ Rev05
WA
LENGTH
STATUS
Normal:
0: Normal execution of command.
4: Synonym.
Abnormal:
256: Wrong symbolic file name.
260: File not opened.
261: No current record.
262: Data length error.
264: Wrong processing mode.
265: System error: argument error.
266: System error: file structure not available.
270: System error: buffer pointer not available.
273: Wrong parameter (FIRST, KEY, HEXA_KEY, or
ADDR) for this organization.
275: Attempt to change existing record key.
276: Duplicate secondary key.
279: Unauthorized command for this type of file.
280: Wrong access mode.
281: ADDR or FIRST unauthorized.
300: Abnormal return code from system primitive.
HEXA_KEY
47 A2 36UJ Rev05
4-27
Constraints:
The file must be opened in UP (update) processing mode.
The length of the new record must be the same as the length of the old one.
KEY, HEXA_KEY and ADDR are mutually exclusive.
UFAS Sequential Disk Files.
The last issued command must have been a successful READ_RECORD. The
record retrieved by READ_RECORD is replaced by the new record. KEY,
HEXA_KEY and ADDR are not authorized.
UFAS Relative Disk Files
4-28
47 A2 36UJ Rev05
Examples:
MDREC SFN=MYFILE0009 ADDR=874 WA=MDRECWAVAR LENGTH=250
STATUS=MDRECVAR
{modify the record at address 874 in UFAS relative
file identified by SFN MYFILE0009; new record is
retrieved from GCL variable MDRECWAVAR; write record
of 250 characters to file; GCL variable MDRECVAR will
receive the completion code}
MDREC SFN=MYFILE0002 KEY=4007832215 WA=MDRECWAVAR LENGTH=4000
STATUS=MDRECVAR
{modify record whose KEY is 4007832215 in UFAS indexed
file identified by SFN MYFILE0002; new record is
retrieved from GCL variable MDRECWAVAR; write record
of 4000 characters to the file; completion code to
MDRECVAR}
47 A2 36UJ Rev05
4-29
4.10.9
OPEN_FILE (OPENF)
Purpose:
Opens sequential, relative, or indexed disk files, and sequential library and tape
files in the specified mode. An opened file can be read, written to, or modified
(except for tapes and libraries, which cannot be modified) until it is closed by a
CLOSE_FILE or RELEASE_FILE command, or the job terminates.
Syntax:
{ OPEN_FILE }
{
}
{ OPENF
}
SFN = name16
PMD = { IN | OU | AP | UP }
ACCMODE = { S | D }
[ STATUS = name31 ]
[ BPB = dec3 ]
Parameters:
4-30
SFN
PMD
Read access.
= OU
Write access.
= AP
= UP
47 A2 36UJ Rev05
The following series of tables shows the authorized GCL commands according to
PMD value:
UFAS Sequential Disk Files
Processing Mode (PMD)
IN
OU
AP
UP
----READ_RECORD
WRITE_RECORD
MODIFY_RECORD
DELETE_RECORD
POINT_RECORD
X
X
X
X
X
X
X (*)
X
X
X
X (*)
X
X
X
X
X
X
X (*)
X
X
X
47 A2 36UJ Rev05
4-31
Libraries
Processing Mode (PMD)
IN
OU
AP
UP
----READ_RECORD
WRITE_RECORD
POINT_RECORD
X
X
Tape Files
Processing Mode (PMD)
IN
OU
AP
UP
----READ_RECORD
WRITE_RECORD
ACCMODE
S (Sequential)
D (Direct)
STATUS
4-32
47 A2 36UJ Rev05
BPB
Constraints:
Libraries and tape files must be opened in sequential access mode.
When files are opened with IN or UP processing mode, the current record will
be the first record of the file. If the file is empty, the next READ_RECORD will
return a DATALIM completion code.
UP processing mode may not be used with libraries or tape files.
When the value for SHARE is MONITOR, the only authorized processing mode
is IN.
STATUS must be used in Batch Mode.
Examples:
OPENF SFN=MYFILE0002 PMD=IN ACCMODE=S STATUS=OPENFVAR
{open file identified by SFN MYFILE0002 in input
processing mode and sequential access mode; GCL
variable OPENFVAR will receive the completion
code}
OPENF SFN=MYFILE0018 PMD=UP ACCMODE=D STATUS=OPENFVAR
{open file identified by SFN MYFILE0018 in update
processing mode and direct access mode; GCL
variable OPENFVAR will receive the completion
code}
47 A2 36UJ Rev05
4-33
Purpose:
Points to a record in a disk file. This command cannot be used with tape files.
Syntax:
{ POINT_RECORD }
{
}
{ PTREC
}
SFN = name16
[ ADDR = dec10 ]
[ KEY = char251 ]
[ KEYLOC = dec5 ]
[ KEYSIZE = dec3 ]
[ FIRST = bool ]
[ COND = { EQ | GE | GT } ]
[ STATUS = name31 ]
[ HEXA_KEY = char252 ]
Parameters:
4-34
SFN
ADDR
47 A2 36UJ Rev05
KEY
KEYLOC
KEYSIZE
FIRST
COND
47 A2 36UJ Rev05
= EQ
= GE
= GT
4-35
STATUS
HEXA_KEY
4-36
47 A2 36UJ Rev05
Constraints:
ADDR, KEY, HEXA_KEY and FIRST are mutually exclusive. One of them
must be specified.
After an unsuccessful PTREC, the current record pointer is undefined.
A file must be opened either in IN (input) or UP (update) processing mode;
however, libraries must always be opened in IN mode and in sequential access
mode (ACCMODE=S).
For libraries, only the FIRST and STATUS parameters may be specified.
For UFAS sequential and relative files, the record pointed to is the logical record
at the given address. If no such record is found, an abnormal completion code is
sent and there is no current record.
For UFAS indexed files, the record pointed to is the first record whose key
satisfies the conditions of comparison. FIRST and ADDR are not authorized.
PTREC may not be used with tape files and sequential files with RECFORM=V
or VB.
KEYLOCK and KEYSIZE must be used with KEY.
COND must be used with KEY or ADDR.
STATUS must be used in Batch Mode.
Examples:
PTREC SFN=MYFILE0009 ADDR=874 COND=GT STATUS=PTRECVAR
{PTREC will get a successful comparison at the first
direct record address greater than 874, and point to
that record in the file identified by SFN MYFILE0009;
GCL variable PTRECVAR will receive the completion code}
PTREC SFN=MYFILE0020 KEY=4007832215 KEYLOC=250 KEYSIZE=6
COND=EQ STATUS=PTRECVAR
{PTREC will point to the first record whose leftmost
6 bytes are equal to 400783; key begins at byte 250 of
the record; file is identified by SFN MYFILE0020; GCL
variable PTRECVAR will receive the completion code}
47 A2 36UJ Rev05
4-37
Purpose:
Reads a record from a previously declared and opened file, and stores it in a buffer
or a GCL variable (the working area WA).
Syntax:
{ READ_RECORD }
{
}
{ RDREC
}
SFN = name16
[ ADDR = dec10 ]
[ KEY = char251 ]
[ KEYLOC = dec5 ]
[ FIRST = bool ]
[ WA = name31 ]
[ LENGTH = name31 ]
[ STATUS = name31 ]
[ HEXA_KEY = char252 ]
Parameters:
4-38
SFN
ADDR
KEY
47 A2 36UJ Rev05
KEYLOC
FIRST
WA
LENGTH
STATUS
47 A2 36UJ Rev05
4-39
HEXA_KEY
Constraints:
KEY, HEXA_KEY, ADDR, and FIRST are mutually exclusive.
KEYLOCK must be used with KEY or HEXA_KEY.
Files must be opened in IN (input) or UP (update) processing mode; however,
record is retrieved.
if the record searched for has been deleted, the current record is the next
file.
a successful POINT_RECORD for that file.
a successful direct READ_RECORD for that file.
For UFAS disk files, the record read by READ_RECORD done in direct access
4-40
47 A2 36UJ Rev05
Examples:
RDREC SFN=MYFILE0020 KEY=4007832215 KEYLOC=250
LENGTH=RDRECLNGVAR STATUS=RDRECVAR
{read record from file identified by SFN MYFILE0020
and store in buffer attached to file; GCL variable
RDRECLNGVAR will receive length of record; record key
is 4007832215 and key offset is 250; completion code
will be written to RDRECVAR}
RDREC SFN=MYFILE0007 FIRST WA=RDRECWAVAR LENGTH=RDRECLNGVAR
STATUS=RDRECVAR
{read record from file identified by SFN MYFILE0007;
record is first record of file; store record in
RDRECWAVA; store its length in RDRECLNGVAR; completion
code is written to RDRECVAR}
RDREC SFN=MYFILE0008 ADDR=874 WA=RDRECWAVAR
LENGTH=RDRECLNGVAR STATUS=RDRECVAR
{read record from file identified by SFN MYFILE0008
and store it in GCL variable RDRECWAVAR, the working
area; record address is 874; GCL variable RDRECLNGVAR
will receive length of record; GCL variable RDRECVAR
will receive the completion code}
47 A2 36UJ Rev05
4-41
Purpose:
Releases a file referenced by its symbolic file name (SFN).
Syntax:
{ RELEASE_FILE }
{
}
{ RLSF
}
{ ( name16 [ name16 ] ... ) }
SFN = {
}
{ star36
}
[ STATUS = name31 ]
Parameters:
SFN
STATUS
4-42
47 A2 36UJ Rev05
Constraints:
If RELEASE_FILE is unsuccessful, the file remains declared and the completion
47 A2 36UJ Rev05
4-43
Purpose:
Retrieves the description of a declared file.
Syntax:
{ RETURN_DECLARED_FILE }
{
}
{ RTDCLF
}
SFN = name16
[ FILE = name31 ]
[ SHARE = name31 ]
[ ACCESS = name31 ]
[ STATE = name31 ]
[ STATUS = name31 ]
Parameters:
4-44
SFN
FILE
SHARE
= ONEWRITE
= FREE
no restriction on access.
= DIR
47 A2 36UJ Rev05
= MONITOR
ACCESS
= WRITE
= READ
= SPREAD
= SPWRITE
= ALLREAD
= RECOVERY
STATE
STATUS
47 A2 36UJ Rev05
4-45
Constraints:
At least one of the parameters, FILE, SHARE, ACCESS, or STATE, must be
specified.
STATUS must be used in Batch Mode.
Examples:
RTDCLF SFN=MYFILE0002 FILE=RTDCLFFILVAR STATUS=RTDCLFVAR
{external file description of the file identified
by SFN MYFILE0002 will be written to GCL variable
RTDCLFFILVAR; GCL variable RTDCLFVAR will receive
the completion code}
RTDCLF SFN=MYFILE0020 SHARE=RTDCLFSHVAR STATUS=RTDCLFVAR
{a value giving the maximum allowable level of
concurrent file access will be written to GCL
variable RTDCLFSHVAR; file is identified by SFN
MYFILE0020; GCL variable RTDCLFVAR will receive
the completion code}
RTDCLF SFN=MYFILE0009 FILE=RTDCLFFILVAR ACCESS=RTDCLFACCVAR
STATE=RTDCLFSTVAR STATUS=RTDCLFVAR
{FILE and STATUS as above, but for MYFILE0009;
access mode will be written to GCL variable
RTDCLFACCVAR; file state will be written to GCL
variable RTDCLFSTVAR; completion code to
RTDCLFVAR}
4-46
47 A2 36UJ Rev05
Purpose:
Takes a character string from the input buffer of a file and stores it in a GCL
variable (the working area WA). The file must be opened in IN (input) or UP
(update) processing mode.
Syntax:
{ SPLIT_RECORD }
{
}
{ SPREC
}
SFN = name16
WA = name31
INDEX = dec5
LENGTH = dec3
[ STATUS = name31 ]
Parameters:
SFN
WA
INDEX
LENGTH
47 A2 36UJ Rev05
4-47
STATUS
Constraints:
If INDEX + LENGTH is greater than the length of the input buffer, the receiving
area will be padded with blanks.
STATUS must be used in Batch Mode.
Examples:
SPREC SFN=MYFILE0002 WA=SPRECWAVAR INDEX=50 LENGTH=40
STATUS=SPRECVAR
{character string is taken from the input buffer of
the file identified by SFN MYFILE0002 and stored in
GCL variable SPRECWAVAR; string is 40 characters
long; first character of string is at rank 50 in
buffer; GCL variable SPRECVAR will receive the
completion code}
SPREC SFN=MYFILE0020 WA=SPRECWAVAR INDEX=900 LENGTH=200
STATUS=SPRECVAR
{as above, with SFN MYFILE0020; character string
200 characters long; first character of string
at rank 900 in the buffer; completion code to GCL
variable SPRECVAR}
4-48
47 A2 36UJ Rev05
Purpose:
Retrieves a record from a buffer or GCL variable, and writes it to a file.
Syntax:
{ WRITE_RECORD }
{
}
{ WRREC
}
SFN = name16
[ ADDR = dec10 ]
[ WA = name31 ]
[ LENGTH = dec5 ]
[ STATUS = name31 ]
Parameters:
SFN
ADDR
WA
47 A2 36UJ Rev05
4-49
LENGTH
STATUS
4-50
47 A2 36UJ Rev05
Constraints:
The current record pointer is not modified by execution of WRREC.
UFAS Sequential Disk Files
for sequential access, the file must be opened in OU processing mode with
ACCMODE=S.
for direct access, the file must be opened in OU or UP mode with
ACCMODE=D.
if OU mode is specified, records must be written in ascending key value order.
if UP mode is specified, records may be written in any order.
ADDR is not authorized.
Libraries
47 A2 36UJ Rev05
4-51
Examples:
WRREC SFN=MYFILE0002 ADDR=874 WA=WRRECWAVAR LENGTH=250
STATUS=WRRECVAR
{record is retrieved from GCL variable WRRECWAVAR;
written to file identified by SFN MYFILE0002;
record length is 250 characters; record address
is 874; GCL variable WRRECVAR will receive the
completion code}
WRREC SFN=MYFILE0009 ADDR=11449 STATUS=WRRECVAR
{record is retrieved from a buffer attached to the
file and written to the file identified by SFN
MYFILE0009; buffer has already been initialized by
BUILD_RECORD; record length defaults to length of
record in buffer; completion code to WRRECVAR}
WRREC SFN=MYFILE0020 WA=WRRECWAVAR LENGTH=1800
STATUS=WRRECVAR
{record is retrieved from GCL variable WRRECWAVAR
and written to the file identified by SFN
MYFILE0020; record length is 1800 characters;
completion code to WRRECVAR; if a UFAS indexed
file is assumed, ADDR cannot be used}
4-52
47 A2 36UJ Rev05
5.1
Overview
5.1.1
Input Reader statements begin by a '$' character and end by a semi colon character.
The '$' character must be the first character (other than blank) of the line. These
statements may be split into more than one source line. More than one such
statement cannot be entered on the same line.
System Level commands, directives and GCL basic commands may be split into
more than one source line. Each statement must be terminated by a semicolon.
More than one command can be entered on the same line; in this case, each
command is separated from the preceding one by a semicolon as follows:
command-1; beginning-of-command-2
remainder-of_command-2;command-3;
47 A2 36UJ Rev05
5-1
5-2
47 A2 36UJ Rev05
. Commands of LINK_PG
.
$ENDINPUT;
IF #GE (#SEV,3);
GOTO PRINT;
ENDIF;
SET_VALUES SML=%SMLIB;
IF %MOVE;
MNSYS COMFILE=*L3,OS=%SYSTEM,
PRTFILE=#CAT (%LISTING,'..H_SM13_MOVE_LKU');
ENDIF;
$INPUT L3,JVALUES;
SM;
IL1 &SML;
MOVE H_SM13 IL1 UNIT=H_GCL;
$ENDINPUT;
LABEL PRINT;
MNLIB SL COMMAND='PRINT
(h_sm13_jobout,h_sm13_map),ASIS;',lib=%listing;
$ENDJOB;
5.1.2
Job Submission
The end user can submit a GCL job to GCOS 7 from a file by using:
the EJR directive
the system-level command RUN_JOB
and the programmatic interfaces.
An executing GCL batch job can submit another GCL job through EJR or
RUN_JOB.
The job submitted must be specified as containing GCL statements at the following
levels:
$JOB Statement
EJR or RUN_JOB
Program Interface
User level
47 A2 36UJ Rev05
5-3
5.1.3
The GCL statements, if requested, and error messages are displayed in the Job
Sysout.
5-4
47 A2 36UJ Rev05
5.2
$JOB
$ENDJOB
$INPUT
$ENDINPUT
$SWINPUT
$SENDCONS
and $OPTIONS.
The Input Reader statements are not parameterizable (neither values, nor GCL
expressions).
Only the commands and parameters usable in GCL batch are described.
47 A2 36UJ Rev05
5-5
5.2.1
$JOB
Purpose:
$JOB, if used, must be the first in a job description to mark the beginning of a job
enclosure to identify the job. $JOB and $ENDJOB are not needed if only one job
is submitted. The statement is recognized by the Stream Reader which stores the
job description statements in the backing store.
If a valid site catalog exists, values specified in $JOB for USER, PROJECT and
BILLING must correspond exactly with the entries in the site catalog.
Syntax:
$JOB
[
[
[
[
job-name
USER=user-name ]
PROJECT=project-name ]
BILLING=billing-name ]
NSTARTUP ]
[
{ SOURCE }]
[ LIST={ NO
}]
[
{ ALL
}]
[
{ NORMAL }]
[ JOR={ ABORT }]
[
{ NO
}]
[
[
[
[
[
[
[
5-6
CLASS=identifier2 ]
HOLD=digits2 ]
HOLDOUT ]
PRIORITY=digit1 ]
REPEAT ]
HOST=name4 ]
JOBLANG={ JCL | GCL }]
47 A2 36UJ Rev05
Parameters:
job-name
USER
PROJECT
BILLING
47 A2 36UJ Rev05
5-7
NSTARTUP
LIST
$SWINPUT
startup sequences and error messages.
5-8
=No
=SOURCE
Default:
the source GCL and inserted Stream Reader
statements
records inserted using $SWINPUT with CONSOLE
and error messages.
47 A2 36UJ Rev05
JOR
CLASS
through P
416job classes of two letters from AA through PZ.
The operator can suspend and reactivate a given class
for flexible and efficient use of machine resources.
Job class selects jobs and manages the serial execution
of jobs.
Up to 26 classes attached to a project. The PROJECT
in the SITE.CATALOG may restrict the class of a job
by its:
batch default class
HOLD
HOLDOUT
47 A2 36UJ Rev05
5-9
PRIORITY
REPEAT
HOST
JOBLANG
=GCL
=JCL
EXPVAL
5-10
47 A2 36UJ Rev05
5.2.2
$ENDJOB
Purpose:
$ENDJOB must appear as the last statement of a job which starts with $JOB to
terminate the job enclosure. The Stream Reader recognizes the statement to closes
the file containing the source GCL statements (see $JOB).
Jobs submitted with the directive EJR do not necessarily require $JOB. If $JOB is
omitted, $ENDJOB must also be omitted.
If $ENDJOB is required but omitted, the job aborts.
Syntax:
$ENDJOB;
Parameters:
None.
47 A2 36UJ Rev05
5-11
5.2.3
$INPUT
Purpose:
Opens an input enclosure and names the SYSIN subfile into which the records of
the enclosure are stored.
Syntax:
$INPUT
input-enclosure-name
[
{ DATA
}]
[
{ DATASSF }]
[
{ COBOL
}]
[ TYPE={ COBOLX }]
[
{ FORTRAN }]
[
{ GCL
}]
[
{ GPL
}]
[
{ JCL
}]
[ FORMAT=( digit3,digit3,digit3,digit3 )]
[
{ ENDINPUT
[ END={ DOLLAR
[
{ MATCH
[
{ 'string8'
[
[
[
[
[
5-12
}]
}]
}]
}]
ENDCHAR='char1' ]
CONTCHAR='char1' ]
PRINT ]
CKSTAT ]
JVALUES ]
47 A2 36UJ Rev05
Parameters:
input-enclosure-name
TYPE
=DATA
=COBOL
=DATASSF
47 A2 36UJ Rev05
5-13
=MATCH
=string8
=ENDINPUT
ENDCHAR
5-14
47 A2 36UJ Rev05
47 A2 36UJ Rev05
5-15
CONTCHAR
5-16
47 A2 36UJ Rev05
Example 2:
Consider the input enclosure of 80 characters per
record:
$INPUT XXXX, CONTCHAR=+, ENDCHAR=/;
AAAbbb..............b
BBB/bbb.............b
CCCbbb..............b
DDD+bbb.............b
EEE/bbb.............b
FFFbbb..............b
GGG+bbb.............b
HHH/bbb.............b
$ENDINPUT;
The following records are stored:
(83 characters)
AAAbbb................bBBB
CCCbbb................bDDDEEE (86 characters)
FFFbbb................bGGGHHH (86 characters)
If the result of using ENDCHAR and/or CONTCHAR
is a record of length zero, the record is ignored.
PRINT
CKSTAT
$SWINPUT
and if found, to interpret and execute it.
JVALUES
47 A2 36UJ Rev05
5-17
Example of JVALUES:
$JOB MYJOB, USER=SMITH,
PROJECT=Q141;
SET_VALUES IOF, MYPROC_IOF;
MNCMD MYBINLIB COMFILE=*MYFILE;
$INPUT MYFILE JVALUES;
list of commands of MAINTAIN_COMMAND
processor
...
DOMAIN &1;
COMPILE &2;
...
$ENDINPUT;
$ENDJOB;
In the example, the input enclosure MYFILE contains
a set of commands for the MAINTAIN_COMMAND
processor and ends with a $ENDINPUT statement.
Constraints:
Function of Statement
$INPUT with its corresponding $ENDINPUT are boundary statements of an input
enclosure containing a job description which can be:
either data input to a user program or system utility
or a source program of processor-specific commands to be submitted for
5-18
47 A2 36UJ Rev05
EXAMPLE 1:
$JOB IE-5 JOBLANG = GCL;
COMM ' Test an Input Enclosure used by
';
COMM ' EXECUTE_GCL with a parameter defined by the ';
COMM ' parameter VALUES of EXECUTE_GCL
';
$OPTIONS PRTFILE = LINT.BATCH.TESTRES..T_IE_5;
EXECUTE_GCL INFILE = *IE_5 VALUES = (SFN = T_IE_5) LIST;
$INPUT IE_5;
KWD SFN NAME;
MNLIB SL
LIB = LINT.BATCH.TESTSL
PRTFILE = #CAT ('LINT.BATCH.TESTRES..', %SFN)
COMMAND = #CAT ('PRINT', %SFN) ;
$ENDINPUT ;
$ENDJOB ;
EXAMPLE 2:
$JOB MYJOB, USER = PILLET, PROJECT = FUEL ;
SET_VALUES MEMBER1, MEMBER2 ;
MNLIB SL MYSLLIB COMFILE = *ENCLOSE ;
$INPUT ENCLOSE JVALUES ;
.....
List of commands of MAINTAIN_LIBRARY processor ;
.....
COMPARE &1 &2 ;
.....
$ENDINPUT ;
$ENDJOB ;
47 A2 36UJ Rev05
5-19
5-20
47 A2 36UJ Rev05
The parameters of $INPUT are applied in the order in the following order:
1) CKSTAT
47 A2 36UJ Rev05
5-21
5.2.4
$ENDINPUT
Purpose:
$ENDINPUT marks the end of an input enclosure introduced by $INPUT. When
the statement is encountered by the stream reader, the SYSIN subfile containing the
input enclosure records is closed.
Syntax:
$ENDINPUT [ input-enclosure-name ];
Parameter:
input-enclosure-name
5-22
47 A2 36UJ Rev05
5.2.5
$SWINPUT
Purpose:
$SWINPUT names the file to which the input stream is to switch from the current
stream or file. The effect is equivalent to:
removing the $SWINPUT statement from the stream of the Stream Reader
and replacing it with the contents of the file which it references.
47 A2 36UJ Rev05
5-23
Syntax:
$SWINPUT
{[INFILE=] sequential-input-file-description
}
{
}
{ member-name [INLIB=] input-library-description
}
{
}
{
{'string105'[ANSWERS=('string105'['string105']...)]}}
{ CONSOLE={
}}
{
{'string105'['string105'] END='string8'
}}
Description of Parameters:
The only mandatory parameter is that which declares the file to which the input
stream is to be switched:
sequential-input-file-description
Optionally prefixed by INFILE= to reference a
sequential file in the GCL format, whose contents
replace the $SWINPUT statement in the input stream.
input-library-description
Optionally prefixed by INLIB= to reference an inputlibrary in the GCL format from which a member will
be selected. The contents of member-name replaces
the $SWINPUT statement in the input stream.
CONSOLE
ANSWERS=
5-24
47 A2 36UJ Rev05
END=
47 A2 36UJ Rev05
5-25
5.2.6
$SENDCONS
Purpose:
$SENDCONS displays a message on the operator's console when the Job is
introduced.
Syntax:
$SENDCONS 'string105';
Parameter:
string105
5-26
47 A2 36UJ Rev05
5.2.7
$OPTIONS
Purpose:
$OPTIONS is used only with GCL Batch Jobs to specify permanent options of the
H_BATCH processor. The option PRTFILE specified at job submission time
(in commands EJR or RUN_JOB) overrides the option PRTFILE specified in
$OPTIONS.
Syntax:
$OPTIONS
[ PRTFILE=file-78 ]
[ REPEAT ]
[
{ NONE
}]
[ JOURNAL={ AFTER }]
[
{ BEFORE }]
[
{ BOTH
}]
[
{ NO
[
{ ALL
[ DUMP={ DATA
[
{ PALL
[
{ PDATA
}]
}]
}]
}]
}]
Parameters:
PRTFILE
REPEAT
=1
=0
47 A2 36UJ Rev05
5-27
JOURNAL
=BEFORE
=AFTER
=BOTH
=NO
Refer to the File Recovery Facilities User's Guide for recovery of files.
DUMP
=ALL
=DATA
=PALL
=PDATA
=NO
5-28
47 A2 36UJ Rev05
5.3
5.4
Directives
The directives that can be used in a GCL job, may be executed in batch mode.
For details of syntax, refer to IOF Terminal User's Reference Manual Part 3,
Section 2.
5.5
47 A2 36UJ Rev05
5-29
5.6
Parameterization
5.6.1
or
EJR INFILE=MY_JOB VALUES=(2,5);
5-30
47 A2 36UJ Rev05
5.6.2
In this case the Input Enclosures can be parameterized with values set by
SET_VALUES and MODIFY_VALUES statements.
Values are referenced symbolically preceded by an '&' sign in the
SET_VALUES statement by:
a positional parameter
or by the keyword specified.
The parameterization by values is allowed only in Input Enclosures.
The values are modified each time a command SET_VALUES or
MODIFY_VALUES is executed.
The parameterization by values is done at execution time each time an Input
Enclosure is referenced by a processor.
The parameterization of processor-specific commands may also be done with
Global Variables. The parameterization with Global Variables is done when the
command is executed.
GCL statements to be executed using the directive EXECUTE_GCL.
47 A2 36UJ Rev05
5-31
5.6.3
Example of Parameterization
The parameterization of the Input Enclosure IE is done by SET_VALUES and by
Global Variables:
5-32
47 A2 36UJ Rev05
5.7
Chaining of Commands
GCL commands are normally executed in sequence. Several GCL basic
commands such as IF, WHILE, CASEOF and GOTO allow modifying sequential
chaining. In the case of Severity 3 or 4 error occurring during the execution of a
processor or of a directive between steps, the chaining of commands can be
controlled through the ON_ERROR command.
The user can, for example, decide if a Severity 3 or 4 error should occur, for the
Job:
either to terminate by specifying:
ON_ERROR ACTION=ABORT;
or to continue by specifying:
ON_ERROR ACTION=CONTINUE;
In the latter case, the user can nevertheless control the chaining of the commands to
execute by testing the severity of the error by using the IF command, for example:
IF #GE(#SEV,3);
GOTO label;
ENDIF;
Note that the severity is not reset to 0 when the step H_BATCH is executed.
Therefore, if the user's step is aborted with a severity 3, H_BATCH will execute
normally but will terminate with an abort severity 3, showing the last return codes.
47 A2 36UJ Rev05
5-33
5.8
Recoveries
Checkpoint and Restart facilities are available for jobs executed in batch mode.
Checkpoint is activated by the REPEAT parameter of:
the $JOB command for the whole job or at the submission time
the commands EXEC_PG or STEP for user programs
the $OPTIONS statement for the system processor H_BATCH.
Checkpoint and Restart are complemented by the Journal files. BEFORE and/or
AFTER Journals are used for files processed:
by user programs
and at System level by the GCL commands described in the GCOS File Access
Commands of Section 4. In this case the BEFORE and AFTER Journal are
activated by the parameter JOURNAL of the $OPTIONS statement.
The rules are the same as for JCL mode. For a complete discussion, please refer to
the manual GCOS 7 File Recovery Facilities User's Guide.
When the whole job is restarted, all the private data attached to the job such as
Global Variables and Values, and parameterized Input Enclosures are deleted. The
System Variables are reset to their initial value.
When the job is restarted at the beginning of a step or at a Checkpoint, the private
data attached to the job, namely, Global Variables, System Variables and Values,
are set to the value saved by Checkpoint at the beginning of the step or at
Checkpoint. The parameterized Input Enclosures are still valid.
GCL Batch Jobs may be restarted after a System Restart WARM without
RESTORE if:
the Sharable Module H_SM13 has not been loaded through the LOADSM
command
the system files SYS.SPOOLi have not been re-initialized through the SPOOL
command.
5-34
47 A2 36UJ Rev05
5.9
Reports
5.9.1
EXAMPLE:
JOBID=1STEP USER=MARGULIS PROJECT=LINT BILLING=LINT--V6 RON=X1279
-----------------------------------------------------------------14:22:07 JOB INTRODUCED FROM
DEC 14, 1993
1STEP LINT.GB.SL BFU033
-----------------------------------------------------------------13:22:09 START OF TRANSLATION
$JOB 1STEP JOBLANG=GCL LIST=ALL;
$ENDJOB;
RECORD COUNT: 7
13:22:09 END OF TRANSLATION
-----------------------------------------------------------------13:22:09 JOB EXECUTION LISTING
DEC 14, 1993
STEP 1
LOAD MODULE=H_BATCH (18:03 OCT 28, 1993) PREINITIALIZED
LIBRARY=SYS.HLMLIB
13:22:10 STEP STARTED XPRTY=9 (DEC 14, 1993)
TASK MAIN PGID=000C PRID=00 COMPLETED
SYSBKST ON S1F6B1: NB OF IO REQUESTS=0
SYSPVMF ON S1F6B1: NB OF IO REQUESTS=29
SYSLIB ON S1F6B1: NB OF IO REQUESTS=114
SYSBKST* ON S1F6B1: NB OF IO REQUESTS=3
H_GCL_ST ON S1F6B1: NB OF IO REQUESTS=4
UFILE ON S1F6B1: NB OF IO REQUESTS=1
BRD_BIN1 ON BVU0E5: NB OF IO REQUESTS=100
H_GCL_B ON S1F6B1: NB OF IO REQUESTS=4
CPU 0.070 PROG MISSING PAGES 102
LINES 41 LIMIT NOLIM BACKING STORE 0
LOCKED 143360
CARDS 09 LIMIT NOLIM BUFFER SIZE 110592 CPSIZE 4096
47 A2 36UJ Rev05
5-35
In the Translation phase, only Input Reader statements and the contents of Input
Enclosures, if requested, are listed.
The Step reports contains two steps: an H_BATCH step report and an
H_LIBMAINT step report. The example is in fact the report of the user step and
the report of the execution of the H_BATCH task, both tasks being executed in the
same step.
The information on the number of IOs, CPU, elapsed time, lines and cards that
appear between the messages USER STEP COMPLETED and STEP
COMPLETED apply to both tasks.
5-36
47 A2 36UJ Rev05
5.9.2
H_BATCH Report
When an error occurs during the execution of a GCL command, two kinds of error
messages can be printed in the H_BATCH report depending on the erroneous
procedure:
The procedure containing the error is not locked. In this case, the error message
will be prefixed by the initial calling procedure in the job and its associated line
number in the report (see example 2).
In both examples, the error occurs in the procedure P3.
EXAMPLE 1:
DESIGN:
$job job_doc joblang = GCL holdout;
mwinlib bin agtr.br.binlib;
let # 'begin job';
P1;
let # 'end job';
$endjob;
proc P1
lock = 0;
endproc;
endproc;
REPORT:
******************************************************************
**** GCOS 7
****
**** BATCH
****
****
****
****
VERSION: 01.00 DATED: NOV 15, 1993 ****
******************************************************************
15:35:32 START EXECUTION
1: mwinlib bin agtr.br.binlib;
2: let # 'begin job';
3: P1;
4: let # 'end job';
begin job
***P3: VARIABLE G HAS NOT BEEN DECLARED
*********************************************B*A*T*C*H************
47 A2 36UJ Rev05
5-37
EXAMPLE 2:
DESIGN:
$job job_doc joblang = GCL holdout;
mwinlib bin agtr.br.binlib;
let # 'begin job';
P1;
let # 'end job';
$endjob;
proc P1
endproc;
lock = 0;
endproc;
endproc;
REPORT:
******************************************************************
**** GCOS 7
****
**** BATCH
****
****
****
****
VERSION: 01.00 DATED: NOV 15, 1993 ****
******************************************************************
15:35:32 START EXECUTION
1: mwinlib bin agtr.br.binlib;
2: let # 'begin job';
3: P1;
4: let # 'end job';
begin job
***P1/3: VARIABLE G HAS NOT BEEN DECLARED
*********************************************B*A*T*C*H************
5-38
47 A2 36UJ Rev05
6. Debugging
6.1
when 1, each line executed within a procedure has its number displayed along
with the name of the procedure before the line is executed.
The GCL debugging options TRACE and DEBUG (see MODIFY_PROFILE
directive) are available in batch mode. When the option DEBUG is active, each
executed line is printed after variables evaluation in the Job-Out subfile of the
system file SYS.OUT.
These debugging options can be specified at job submission by parameters
TRACE_GCL and DEBUG_GCL of the directive EJR or the system level
command RUN_JOB.
Both system variables may be used simultaneously and may be set from outside or
from inside the procedure being debugged. They are part of the user's profile and
may be set by use of the MODIFY_PROFILE (MDP) directive:
MDP TRACE DEBUG
47 A2 36UJ Rev05
6-1
6.2
DUMP
The command DUMP may be used to display the value of variables specified by
their name in the command. The variables that can be displayed are the local
variables, the keywords and the global variables. The result of a GCL expression
can also be displayed by the command DUMP.
The command DUMP is executed only when the system variable #TRACE of the
User Profile is equal to 1. The command DUMP can also be conditionally
executed according to the value of a boolean expression that can be specified by
the parameter IF of the command.
6-2
47 A2 36UJ Rev05
Debugging
6.3
Example of Debugging
S: MP TRACE DEBUG
S: EXGCL GCLTEST LIB=COMMON.SLLIB LIST
1:Proc TEST;
2:Local AUTO char 80;
3:Local D dec 3;
4:Let AUTO abcdefg;
5:Let AUTO #cat (%AUTO,'*',#date,#cat (123,x));
6:Dump AUTO;
7:If #eq (%AUTO,XYZ);
8: Let # TRUE;
9:Else;
10: Let # FALSE;
11:Endif;
12:Let D 1;
13:While #lt (%D,3);
14: Let D #plus (%D,1);
15:Endwhile;
16:Endproc;
+++TEST/4 LET AUTO ABCDEFG
+++TEST/5 LET AUTO #CAT(ABCDEFG<%AUTO>,'*',#DATE,#CAT(123,X))
---TEST/6 DUMP VARIABLES=AUTO;
Variable AUTO:
ABCDEFG*93/12/14123X
+++
+++TEST/7 IF #EQ('ABCDEFG*93/12/14123X'<%AUTO>,XYZ)
+++TEST/10 LET # FALSE
FALSE
+++TEST/12 LET D 1
+++TEST/13 WHILE #LT(1<%D>,3)
+++TEST/14 LET D #PLUS(1<%D>,1)
+++TEST/13 WHILE #LT(2<%D>,3)
+++TEST/14 LET D #PLUS(2<%D>,1)
+++TEST/13 WHILE #LT(3<%D>,3)
+++TEST/16 RETURN
47 A2 36UJ Rev05
6-3
6-4
47 A2 36UJ Rev05
7. Programmatic Interface
7.1
GCL Interface
The user accesses GCL facilities by activating the GCL translator from within the
application. Primitives in both GPL and COBOL provide this interface by:
reading commands from a terminal
and activating the GCL procedures in a domain.
GCL procedure
COBOL
PROC COBOL
Commands are read from the terminal. In screen mode, the user is asked to select a
command from those available. For a serial printer, the user must explicitly enter
the command name, which is rejected if the command is not in the current domain.
The command read from a terminal starts the associated procedure by:
setting system variables such as printer width (#PW) and national language
(#LANG)
activating built-in functions
then returning the text to the caller via the SYSTEM command.
The SYSTEM command passes a text string to the calling processor which may:
either stop activity
or issue another read primitive to resume executing the current procedure, before
47 A2 36UJ Rev05
7-1
GCL returns the internal domain name to the calling processor. The domain is
referenced by this internal domain name in subsequent calls to the primitives. A
single processor can thus access several domains simultaneously.
7.1.1
Primitives
The five primitives in the order of their function are:
GCLINIT
GCLREAD
GCLTERM
GCLABORT
GCLRETRY.
7.1.1.1
GCLINIT
Purpose:
To initialize the GCL interpreter for a new domain to distinguish similarly named
commands belonging to different processors (domains). A domain uniquely
identifies the calling processor.
domain name
prefix
GCL
initialize
internal domain
name
error code
GCLINIT needs as input the name of the domain and a prefix to be associated with
the domain. The prefix is a 1-character prompt used to request input from the
terminal. In response to this prompt, the terminal user may enter any command of
the domain concerned.
The primitive returns a code which denotes a normal or abnormal initialization
phase and an internal identification for the domain. This identification must be
supplied each time another primitive refers to this domain.
7-2
47 A2 36UJ Rev05
Programmatic Interface
Syntax:
GPL:
Parameters:
DOMAIN
INTDOM
PREFIX
COMFILE
PRTFILE
SUP
SUPP
ERROR-RC
Error Code:
COBOL: COMP-2
ECHO
="Y"
="N"
47 A2 36UJ Rev05
7-3
Return Codes:
Normal
DONE
Abnormal
7-4
47 A2 36UJ Rev05
Programmatic Interface
7.1.1.2
GCLTERM
Purpose:
To terminate the activity of the GCL interpreter on the current domain.
internal domain
name
GCL
terminate
error code
When a calling processor has no further use for the GCL interpreter for a domain, it
specifies GCLTERM for that domain. The internal domain name must be supplied.
A code is returned to indicate the status of the termination.
Syntax:
GPL:
$H_TERMGCL INTDOM=i_ptr;
Parameters:
INTDOM
ERROR-RC
Error Code:
COBOL: COMP-2
Return Codes:
Normal
DONE
Abnormal
47 A2 36UJ Rev05
7-5
7.1.1.3
GCLREAD
Purpose:
To request translation of commands read in from the terminal or the COMFILE
when specified, to activate the associated procedures.
internal domain
name
GCL
read
length
output string
length
error code
is 1 (default)
or an error is detected and the value of the PROMPT parameter of the
MODIFY_PROFILE command is 0.
If the user requests the end of the current domain activity (end of current action),
the IGNORE return code is issued. The calling processor is then supposed to
terminate its activity. The text returned to the caller is delivered into the area
provided for output.
Syntax:
GPL:
Parameters:
7-6
INTDOM
OUTLEN
47 A2 36UJ Rev05
Programmatic Interface
OUTAREA
ERROR-RC
Error Code:
COBOL: COMP-2
Return Codes:
Normal
Abnormal
DONE
TRUNC:
IGNORE:
truncation
end of current action
47 A2 36UJ Rev05
7-7
7.1.1.4
GCLABORT
Purpose:
To force an external abort of a current procedure execution with an optional error
diagnostic.
The next GCLREAD reads a new command line from the input stream and
discards any pending SYSTEM and unprocessed commands on the current line.
internal domain
name
[message]
GCL
abort
error code
The message, if present, is output on the terminal. The internal domain name must
be provided in input. A status code is returned.
Syntax:
GPL:
Parameters:
7-8
INTDOM
MSG
Message text:
GPL:
MSG=i_char78
LENGTH
ADDRESS OF MSG
47 A2 36UJ Rev05
Programmatic Interface
FLAG
=0
=1
Type of action:
abort
retry
COBOL: COMP-1
ERROR-RC
Error code:
COBOL: COMP-2
Return Codes:
Normal
DONE
Abnormal
NOTE:
The routine CGCLABORT will cause an abort (if FLAG=0) or a retry.
ADDRESS OF MSG is accepted only if the program is compiled with option
LEVEL=NSTD in the COBOL command.
47 A2 36UJ Rev05
7-9
7.1.1.5
GCLRETRY
Purpose:
To cancel the execution of a command with an optional error diagnostic and give
the user an opportunity to resupply or modify the currently processed command.
Retry is performed only when input is from a terminal and menu mode is set
whereby keywords for which values are invalid, are prompted again. Otherwise
the function is like GCLABORT.
internal domain
name
[message]
GCL
retry
error code
Syntax:
GPL:
Parameters:
7-10
INTDOM
MSG
Message text:
GPL:
MSG=i_char78
LENGTH
ADDRESS OF MSG
47 A2 36UJ Rev05
Programmatic Interface
FLAG
=0
=1
Type of action:
abort
retry
COBOL: COMP-1
ERROR-RC
Return Codes:
Normal
DONE
Abnormal
NOTE:
The routine CGCLABORT will cause an abort or a retry (if FLAG=1).
ADDRESS OF MSG is accepted only if the program is compiled with option
LEVEL=NSTD in the COBOL command.
47 A2 36UJ Rev05
7-11
7.1.2
GCL
Commands
GCL
Procedures
Text returned
to Calling
Processor
GCLINIT
|
|
|
+-->|
|
|
|GCLREAD------->|
|
|
|
+-->|
|COBOL------>|
|
|
| PROC COBOL;
|
|
|
|
|
| SYSTEM 'C1,...C9';
|
|
|
|
|
| ENDPROC;
|
|
|
|
|LINKGO---->|
|
|
| PROC LINKGO;
|
|
|
|
|
| SYSTEM 'L1,...L8';
|
|
| SYSTEM 'S1,S2';
|
|
|
|
|
| ENDPROC;
|
|
GCLTERM
C1,...C9
L1,...L8
S1,S2
7-12
47 A2 36UJ Rev05
Programmatic Interface
7.2
7.2.1
Domain
The domain name specified in the GCLINIT primitive must be the name of the
domain subfile contained in a binary library. This subfile is created when the first
procedure of a domain is created using the DOMAIN, BINLIB and CREATE
commands of MAINTAIN_COMMAND.
At execution, the domain subfile is sought in the binary search path. If the caller
has not specified the binary library, then the GCLINIT primitive returns an error
code, DOMAIN UNKNOWN.
7.2.2
SYSTEM Command
A SYSTEM command associates a GCL procedure of an initialized domain with a
user program. Generally, a procedure will contain one SYSTEM command.
Nothing prevents defining a procedure that contains none, or several SYSTEM
commands. The next prompt appears after exiting from the procedure currently at
the bottom of the GCL stack.
The argument of the SYSTEM command is a character string which is sent to the
program in response to the GCLREAD primitive.
The user program makes no further checks:
after the syntax of the command inside the procedure has been analyzed
and if the string passed through the SYSTEM command is a coded string.
The same program can initialize several domains with different names, allowing
domain nesting.
47 A2 36UJ Rev05
7-13
7.3
Programming Rules
The main operations for creating and testing an interactive program using GCL
facilities are as follows:
1.
2.
Create the GCL command EXEC_PG to invoke the program. This command
procedure belongs to the IOF domain in the user or project private BIN
library. Use the OPTIONS keyword of the EXEC_PG command or global
variables to pass parameters to the procedure.
3.
Create the commands of the processor domain. This domain must be stored
in the private binary library. The QUIT command must be created. The entry
"/" returns an IGNORE code to the calling GCLREAD primitive.
4.
Place the binary library containing the procedures (created in Steps 2 and 3) in
the binary search path, using the MWINLIB BIN command. The procedures
are then available.
5.
6.
7.
7-14
After debugging, delete the DEBUG option from the EXEC_PG command
and remove trace functions in the program using variables. Lock the
procedures if no further modification is desired.
47 A2 36UJ Rev05
Programmatic Interface
7.4
Example of Application
The following example shows how to create an interactive COBOL program which
dialogs with the terminal using the GCL facility, the entities defined being:
a COBOL program BANK
a procedure BANK in the domain IOF that calls the preceding program
a domain BANK containing three procedures activated by the program.
The user-defined domain BANK contains three commands; CREDIT, DEBIT and
BALANCE. Associated with each command there is a section of the COBOL
program to the processing necessary to handle the operation concerned.
The components of the application are shown as follows:
BANK
1. Credit
2. Debit
3. Balance
Credit
Debit
Balance
Detailed processing for each operation is done in the COBOL program is shown
overleaf.
The user-defined GCL domain BANK contains a command for each operation.
The COBOL program activates this domain (by means of the CGCLINIT
command). The program reads the operation entered by the user by means of the
CGCLREAD statement.
47 A2 36UJ Rev05
7-15
To select an operation, the user selects the appropriate command from the BANK
domain level menu (menu mode) or enters the command's name (non-menu mode).
The command chosen and its parameter value(s) are transmitted to the COBOL
program.
The Flowchart of the Application is as follows:
START
$H_INITGCL
BANK
no
OK?
yes
$H_READGCL
Credit
Debit
Balance
processing
SYSTEM
yes
OK?
string
no
$H_TERMGCL
STOP
7-16
47 A2 36UJ Rev05
Programmatic Interface
7.4.1
Programming in COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID.
BANK.
********************************************************
* * THE MAIN AIM OF THIS PROGRAM IS TO ILLUSTRATE * *
* * THE GCL PROGRAMMATIC INTERFACES USED FROM
* *
* *
A COBOL PROGRAM
* *
********************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. LEVEL-64.
OBJECT-COMPUTER. LEVEL-64.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT BANK ASSIGN TO BANK.
DATA DIVISION.
FILE SECTION.
FD BANK LABEL RECORD STANDARD.
01 BANK-REC.
02 FILLER PIC X(200).
WORKING-STORAGE SECTION.
01 DOMAIN PIC X(31) VALUE "BANK".
01 INT-DOM COMP-2.
01 SUP PIC X(8).
01 SUPP PIC X(8).
01 PREFIX PIC X VALUE "C".
01 ERROR-RC COMP-2.
01 OUTLG COMP-2.
01 BANK-FLD.
02 BANK-CODE PIC X.
02 CTVAR
PIC X(15).
01 BANK-CREDIT.
02 BANK-ID-C PIC X(3).
02 AMOUNT-C PIC 9(10).
01 BANK-DEBIT.
02 BANK-ID-D PIC X(3).
02 AMOUNT-D PIC 9(10).
01 BANK-BALANCE PIC X(3).
PROCEDURE DIVISION.
PROC-BEGIN.
OPEN I-O BANK.
CALL "CGCLINIT" USING DOMAIN PREFIX INT-DOM SUP SUPP
ERROR-RC.
IF ERROR-RC NOT = 0 DISPLAY CONVERSION
"INIT DOMAIN BANK MANAGEMENT NOT SUCCESSFUL ERROR-RC : "
ERROR-RC UPON TERMINAL GO TO END-PRG.
47 A2 36UJ Rev05
7-17
INPUT-BANK-MANAGEMENT.
MOVE 16 TO OUTLG. MOVE SPACE TO BANK-FLD.
CALL "CGCLREAD" USING INT-DOM OUTLG BANK-FLD ERROR-RC.
IF ERROR-RC = 2 GO TO USER-END-PRG.
IF ERROR-RC NOT = 0
DISPLAY CONVERSION
"READ DOMAIN BANK NOT SUCCESSFUL ERROR-RC : "
ERROR-RC UPON TERMINAL GO TO READ-END-PRG.
IF BANK-CODE = "C" UNSTRING CTVAR DELIMITED BY "/"
INTO BANK-ID-C AMOUNT-C
DISPLAY "CREDIT THE ACCOUNT OF BANK: " BANK-ID-C UPON TERMINAL
*
* **** SPECIFIC TREATMENT OF THE CREDIT ****
*
The statements needed to do this
*
are not shown as they are not
*
dependent on the fact that a GCL
*
interface is being used.
*
GO TO INPUT-BANK-MANAGEMENT.
IF BANK-CODE = "D" UNSTRING CTVAR DELIMITED BY "/"
INTO BANK-ID-D AMOUNT-D
DISPLAY "DEBIT THE ACCOUNT OF BANK: " BANK-ID-D UPON TERMINAL
*
*
*
*
*
*
*
*
*
GO TO INPUT-BANK-MANAGEMENT.
USER-END-PRG.
DISPLAY "END EXECUTION ASKED BY USER" UPON TERMINAL.
READ-END-PRG.
CALL "CGCLTERM" USING INT-DOM ERROR-RC.
CLOSE BANK.
END-PRG.
STOP RUN.
7-18
47 A2 36UJ Rev05
Programmatic Interface
The CALL "CGCLINIT" USING .... statement in the COBOL program initiates the
user-defined domain named BANK.
The CALL "CGCLREAD" USING .... statement reads the command (and its
parameters) entered by the user. The COBOL program tests to see which type of
operation (CREDIT, DEBIT, or BALANCE) has been entered and a branch is
made to the appropriate part of the program to do the processing. The statements
to do this processing are not shown since they are not dependent on the fact that a
GCL interface is being used.
While in the GCL part of the application, all the facilities of GCL are available.
Thus for example, Help texts can be requested for each command (operation) and
parameter (assuming that these have been written), controls on the values supplied
can be made, error messages can be issued and retries can be done, as for any other
GCL procedure. Thus the full power of GCL can be used in association with the
COBOL program to create the application desired.
The loop on "CGCLREAD" continues until the user indicates that there are no
more operations (by entering a /, instead of a command).
47 A2 36UJ Rev05
7-19
7.4.2
05/06/86
13:34
STMTS= 3
05/06/86
16:54 STMTS= 5
7-20
47 A2 36UJ Rev05
Programmatic Interface
7.4.4
INTDOM
TEXT
TEXT_LG
CMD
COMMAND
BANK
AMOUNT
PTR;
CHAR(256);
FB31;
DEF TEXT,
CHAR(1),
CHAR(3),
CHAR(10);
47 A2 36UJ Rev05
7-21
7.5
7.5.1
Domain level.
2.
Command level.
3.
Parameter level.
4.
Other.
A domain level Help text is associated with a domain of the system such as
LIBMAINT and FORMGEN, and provides general information on the rules that
pertain to that domain. The name of such a Help text is the name of the domain. A
list of the standard domains delivered with the system is given in Section 5.
A command level Help text is associated with a command. It provides information
on the use and purpose of the command. Its name is provided by the HELP
parameter of the PROC statement in the GCL procedure which defines the
command.
7-22
47 A2 36UJ Rev05
Programmatic Interface
EXAMPLE:
PROC COPY
HELP=EXPLAIN_COPY;
47 A2 36UJ Rev05
7-23
7.5.2
"Help" function key. The control field is indicated by "-->: __" in the top righthand corner of the command level menu.
A command level Help text provides a brief description of the function(s) of the
command, a list of its parameters (in most cases), and one or more examples.
A parameter level Help text is requested by entering a question mark (?) instead of
a value for a parameter that is being prompted. It explains the purpose of the
parameter, its relation to other parameters, and gives examples of possible values.
It is recommended that user-defined Help texts can also be requested by entering a
question mark (?) in a specific field, or by pressing a "Help" function key.
7-24
47 A2 36UJ Rev05
Programmatic Interface
7.5.3
Help Operations
A Help text is always presented as a series of screens. Once a screen is displayed,
an action is requested from the user through a prompt (+++). Choose one of the
following:
Return to the place where the Help text was requested by:
typing a slash (/),
pressing a "Break" or "End-of-current-action" function key,
or asking for the next screen (see below) when the screen being displayed is
character.
Ask for Help by entering a question mark (?).
Call the bug/remark report mechanism by typing an asterisk (*).
47 A2 36UJ Rev05
7-25
7.5.4
Conventions
All Help texts are stored in two source language (SL) libraries:
SYS.HELP for help texts associated to the standard domains.
SITE.HELP for help texts created by users. All Help Texts have the same
presentation.
Since the same Help text may exist in different national languages, the following
convention defines the version corresponding to the user's declared national
language:
Names of subfiles in SYS.HELP and SITE.HELP are those of the Help texts
implicitly refers to text subfile COPY0 for English, to COPY1 for the next
language alternative and so forth.
7-26
47 A2 36UJ Rev05
Programmatic Interface
7.5.5
CREATE_HELP_TEXT: CRHELP
This processor facilitates the creation of user-defined Help texts in the library
SITE.HELP.
The source form of new Help texts are written using FSE or EDIT. The first line of
the source text must contain the control HELP and the title of the text:
.HELP 'title of Help text';
'body of Help text'
This title will be repeated at the top of each screen of composed text.
For the desired layout of the composed text, insert formatting controls within the
source text. These formatting controls are discussed below.
Compose the source text using the system command CREATE_HELP_TEXT
(CRHELP). This command places the composed text in the SITE.HELP library.
Syntax:
CRHELP
Parameters:
MEMBERS
LANG
INLIB
47 A2 36UJ Rev05
7-27
7.5.6
Formatting Controls
Insert formatting controls (or commands) in the source Help texts for the desired
layout. These controls start with a period (.) character in the first position of a line.
Several controls can be placed on the same line, but in this case they must be
separated by semicolons (;).
Some of the formatting controls are:
7-28
.help 'mine'
.spb 1
.spb2
.brp
.inl 5
.unl 3
.fif
This turns off fill mode. The text that follows is left as
is until this control is canceled by a .fin control.
.fin
47 A2 36UJ Rev05
Programmatic Interface
7.5.7
7.5.7.1
Source Text
The following is an example of a source Help text (that is, with the formatting
controls still included).
.help 'a sample source text'
This is the first line.
.spb 1
This is a new paragraph.
The text of a single sentence can be split over several lines.
.spb
This is the same as specifying .spb 1.
.spb 2
Do not start a line with a space (or blank) character.
To indent the text from the left, use the .inl control.
.spb 3
Start a new paragraph after skipping 3 lines.
.brp
Start a new paragraph on a new page (screen).
.spb
.inl 8
.unl 3
Start indentation (from the left) at position 9.
So there will be 8 spaces at the start of each line.
However, the line immediately following the .unl is "un-indented" 3 positions to
the left.
.spb 1
.unl 6
This line in "un-indented" 6 positions.
.spb 1
The .inl is effective until canceled.
.spb 1
.inl 0
The .inl 0 resets the left hand margin, that is, it stops the indentation from the left.
.spb 1
.fif
The .fif means that the following
text is not composed, that is, it is
left as is.
.spb 2
.fin
47 A2 36UJ Rev05
7-29
7-30
47 A2 36UJ Rev05
Programmatic Interface
7.5.7.2
Composed Text
Compose the source text as follows:
CREATE_HELP_TEXT MEMBERS=MYTEXT LANG=0 INLIB=MY.SL1;
where MYTEXT is the name of the text.
The composed Help text obtained from the source text presented above is shown
below. Note that the line length of this manual is 68 characters whereas the line
length of a Help text displayed on a screen terminal is usually 78 characters. The
text presented below is based on a line length of 68 characters.
Typing in the above source text and displaying it on a screen terminal, gives a
presentation slightly different due to the 10 character difference in line length.
The composed version of this Help text is given below.
1/3
47 A2 36UJ Rev05
7-31
EXAMPLE:
SYNTAX ON THE LEFT The explanation can be placed on the right hand side.
If necessary, this explanation can continue on several
lines. The .inl and .unl controls ensure that the layout
will be as desired.
Note the use of the .inl and .unl controls to place the syntax of an example on the
left-hand side of the text and the associated explanatory text on the right-hand side.
The explanatory text can extend as long as needed.
The rest of this section consists of an example of a domain level Help text,
followed by an example of a command level Help text, and ending with an
example of a parameter level Help text.
7-32
47 A2 36UJ Rev05
Programmatic Interface
7.5.7.3
You are now in the domain of the Full Screen Editor (FSE); a powerful editor with
which you can create and modify source texts in source libraries using predefined
applications (defined by ADL). FSE has two modes of operation: an input mode
and an edit mode.
In input mode you enter complete records that are used to build up a new text unit
to be inserted in an existing member or used to replace existing lines. You may
define the format of the records you enter, the way they are to be prompted on the
screen, and the order in which they are to be transmitted to the calling program
(selective sequence), in an application.
In edit mode you may specify the actions to be performed on an existing text.
These actions are available through edit requests that you enter in a predefined
field on the screen. The results of the requested actions appear immediately on the
screen, where you may check to see if they have had the desired effect.
2/2
FSE can operate on up to four source libraries at a time; one is the output library,
the others are input libraries. FSE commands that read members from the libraries
operate on the input and the output libraries; whereas FSE commands that modify a
library operate only on the output library.
You can assign the input libraries before entering FSE by the GCL command
MWINLIB, or you can assign them within FSE by the commands INLIB1,
INLIB2, and INLIB3. You can assign the output library before entering FSE by
the GCL command MWLIB or by the keyword LIB of the FSE statement, or you
can assign it within FSE by the LIB command.
Libraries are referred to in FSE by their symbolic names: LIB, INLIB1, INLIB2,
and INLIB3. If you refer to a library that has not been assigned, an error message
is displayed.
47 A2 36UJ Rev05
7-33
7.5.7.4
Examples:
LINK LM=LMOD1; Create the load module LMOD1.
LINK LM=PRTEST LIB=P1.LM3 COMFILE=P1.B1..CF;
Create the load module PRTEST, store it in the LM library P1.LM3. The command
file is the member CF of the SL library P1.B1.
7-34
47 A2 36UJ Rev05
Programmatic Interface
7.5.7.5
The default is that the expiry date is the same as today's date.
EXAMPLES:
89/12/31
31 December 1989
89/138
138
47 A2 36UJ Rev05
7-35
7.5.8
HELP Primitive
Purpose:
To display a Help text.
Syntax:
GPL:
$H_HELP i_char32;
COBOL:
Parameters:
NAME
ERROR or ERROR-RC
COBOL:
COMP-2
FORTRAN: INTEGER
Return Codes:
Normal
DONE
Abnormal
7-36
47 A2 36UJ Rev05
Programmatic Interface
EXAMPLE (GPL):
RECEV:
CALL H_FRMRECV;
IF $FRM FIELD 1; = "/" THEN GOTO ENDDELETE;
IF $FRM FIELD 1; = "?" THEN DO;
$H_HELP "H_FSE RENUMBER";
$FRM SELECT NONE;
$FRM SELECT 1;
$FRM FIELD 1; = " ";
GOTO RETRY;
END.
47 A2 36UJ Rev05
7-37
7.6
7.6.1
Global Variables
GCL global variables are declared in the GLOBAL GCL command and remain
accessible during a session, unless a DELETE GLOBAL command is executed for
the variable.
Global variables are referred to by name. They are defined and used in GCL
commands, or in external calls from programs written in one of these languages:
COBOL, FORTRAN and GPL. GCL global variables thus allow communication
between two GCL procedures, or between a GCL procedure and a program, or
between two programs.
7.6.2
System Variables
System variable names are prefixed with a #. They determine the visibility that the
programmer has of the system such as Printing Width (PW) and National Language
(LANG). They are listed and presented in the IOF Terminal User's Reference
Manual.
Any user may read or change these values. Setting a new value results in a new
operating environment. For example, if LANG is modified, Help texts and error
diagnostics will be displayed in the specified language instead of in English.
7.6.3
#LSYS
#MDAY
#MODE
#PROJECT
#RON
#TERMID
#TIME
#TTYPE
#USERID
#WDAY
#YDAY
#FW
All global variables and system variables are lists. A scalar value is a particular
case of a list with only one element. READVAR and MODVAR access only one
element in the list which is selected through an index denoting its rank. Both these
primitives require an index value as well as the name of the global or system
variable to be accessed.
7-38
47 A2 36UJ Rev05
Programmatic Interface
7.6.3.1
READVAR
Purpose:
To access a global or system variable.
Syntax:
GPL:
COBOL:
Parameters:
NAME
Type of variable:
system variable if it begins with # such as #MENU
otherwise, global variable such as MY_GLOBAL.
GPL:
i_char31
COBOL:
PIC X(31)
FORTRAN: CHARACTER*31
INDEX or INDEX-ID
OUTLEN
OUTAREA
ERROR or ERROR-RC
COBOL:
COMP-2
FORTRAN: INTEGER
47 A2 36UJ Rev05
7-39
Return Codes:
Normal
DONE:
TRUNC:
Abnormal
ARGERR:
INDERR:
LNERR:
EXAMPLE (GPL):
$H_READVAR '"#GCLFORM"', OUTLEN = 1,
OUTAREA = GCLFORM;
7-40
47 A2 36UJ Rev05
Programmatic Interface
7.6.3.2
MODVAR
Purpose:
To modify a global or system variable.
Syntax:
GPL:
COBOL:
Parameters:
NAME
Type of variable:
system variable if it begins with # such as #MENU
otherwise, global variable such as MY_GLOBAL.
GPL:
i_char31
COBOL:
PIC X(31)
FORTRAN: CHARACTER*31
INDEX or INDEX-ID
INLEN
INAREA
ERROR or ERROR-RC
COBOL:
COMP-2
FORTRAN: INTEGER
47 A2 36UJ Rev05
7-41
Return Codes:
Normal
DONE:
Abnormal
ARGERR:
FUNCNAV:
INDERR:
LNERR:
NAMEERR:
NOMATCH:
OBJUNKN:
RESNAV:
7-42
47 A2 36UJ Rev05
Programmatic Interface
7.7
NOTE:
Lowercase letters are converted to uppercase unless they are within protected
strings.
47 A2 36UJ Rev05
7-43
7.7.1
File Literal
Syntax:
file-literal
remote-file
{ :string-1
}
::= $site-name { :protected-string
}
{ { /|!|^|>|<|. }string-2 }
Definition of Elements:
site-name
::= name8
string-1
local-file
::= can be one of the following entries:
{ cataloged-file::=
{[$CAT[i]][$VOLSET[:name6]]}
path-name[/g-suffix][..subfile]{
}
{$NATIVE
}
| temporary-file::=
|
|
|
|
7-44
{[:md[/md]...:dvc] }
path-name[..subfile]{[$RES]
}$TEMPRY
{[$VOLSET[:name6]]}
permanent-uncataloged-file::=
{$RES [$UNCAT]
}
{
}
{
[{$UNCAT
}]}
path-name[..subfile]{
[{$MFT[i|+]}]}
{:md[/md]...:dvc[{$NATIVE }]}
{
[{$NONE
}]}
{
[{$NSTD
}]}
{ * | SYSIN .. } input-enclosure-name
{ DUMMY | SYS.OUT }
* : md[/md]...:dvc [{ $UNCAT | $NATIVE }]
[path-name]:[md]:TN[/tbd][$UNCAT]
}
47 A2 36UJ Rev05
Programmatic Interface
Definition of Elements:
full-path-nm
rel-asc-path
rel-desc-path
path-name
::= {full-path-nm}
{rel-asc-path}
{rel-desc-path}
g-suffix
::= {
{
{
{
{
subfile
{ Gdigit4
}
}
{ G{+|-}digit4 }[{ Vdigit2 ] }
{ G{+|-}
}
}
G name5
}
Vdigit2
}
::= name31
input-enclosure-name
::= name16
7.7.2
47 A2 36UJ Rev05
$NATIVE ]
------- ]
$COMPACT]
]
$NONE
]
]
$NSTD
]
7-45
7.7.3
Primitives
Two macro definitions are provided for analyzing a file literal string. The first one
($H_DCANFILE) declares a structure that is passed to the second ($H_ANFILE).
This structure is used to convey the input parameters to the primitive and to obtain
the resulting parameters.
The following is a very simple programming example that illustrates the manner in
which these two primitives are to be used:
PREFIX=''
*/
FIRSTCHAR=1; LASTCHAR=LEN
*/
SYNTAX_OPTION="1
*/
SUBFILE_OPTION="1"
*/
EXPANDPATH="2"
*/
SITE_OPTION="1"
*/
$H_ANFILE ANFILE
*/
IF RETURNCODE=0 THEN DO
/* no error detected
*/
*/
...
END
ELSE DO
...
END
7-46
47 A2 36UJ Rev05
Programmatic Interface
7.7.3.1
DCANFILE
Purpose:
To declare the file analysis structure.
Syntax:
$H_DCANFILE [ PREFIX=l_identifier16 ] [ ATTRIB=l_char ];
Parameters:
PREFIX
ATTRIB
For more information, see the GPL System Primitives Reference Manual.
7.7.3.2
ANFILE
To check the description of constructs denoting a file or volume literal, analyze the
options, then return the information required to dynamically assign the file
(H_ASSIGN).
Syntax:
$H_ANFILE b_structure;
Parameter:
name
analysis.
Return Codes:
Normal
DONE:
Abnormal
47 A2 36UJ Rev05
normal execution
7-47
7.8
7.8.1
Fileset Literal
Syntax:
Fileset-literal
: :=
star-exp:md[/md...:dvc[$UNCAT]$MFT[+|i][$REF[:file-literal
[$REF:file-literal]...]]]
star-exp [{:md[/md]...:dvc}][$UNCAT]$REF[:file-literal[$REF:file-literal]
[{$RES}]...]]
star-exp $VOLSET[:vset-6] [$REF[:file-literal[$REF:file-literal]...]]
star-exp [{ $CAT[i]
}][$ONLY:{*|md[/md...}:dvc][$REF[:file-literal
[{ $CAT:catalog-name }]
[$REF:file-literal]...]]]
star-exp [{ $CAT[i]
}][$ONLY:$VOLSET[:vset-6][/vset-6]....]
[$REF[:file[{ $CAT:catalog-name }]
literal[$REF:file-literal]...]]
Definition of Elements:
star-exp : := [{.|<[<]...}] {sse[.sse]...[.**[.sse]...][/suffix]
| **[.sse]...[/suffix] }
sse : := {constant-string | [constant-string]*[constant-string]}
size max = char16
suffix : := { [{Gdigit4 }]
}
{ [{G+digit4}]
}
{ [{G-digit4}] [{Vdigit2}] }
{ [{G+
}] [{V*
}] }
{ [{G}] [{V**
}] }
{ [{G*
}]
}
{ [{G**
}]
}
{ G_alphanum5
}
7-48
47 A2 36UJ Rev05
Programmatic Interface
7.8.2
Primitives
Three macro definitions are provided for analyzing a fileset literal string:
$H_DCANFST declares a structure that is passed to $H_ANFST
$H_ANFST takes parameters from the generated structure, analyzes the fileset
after $REF.
7.8.2.1
DCANFST
Purpose:
to declare and generate a Fileset structure to be used as the communication area
between a program and the ANFST or ANFLFST primitive.
Syntax:
$H_DCANFST [ PREFIX=l_identifier16 ] [ ATTRIB=l_char ];
Parameters:
PREFIX
ATTRIB
For more information, see the GPL System Primitives Reference Manual.
47 A2 36UJ Rev05
7-49
7.8.2.2
ANFST
Purpose:
To analyze the fileset literal and to fill the structure generated by DCANFST.
Syntax:
$H_ANFST b_structure;
Parameter:
name
Return Codes:
These are given by the RC in the H_DCANFST structure.
7-50
47 A2 36UJ Rev05
Programmatic Interface
7.8.2.3
ANFLFST
Purpose:
To analyze a File Literal inside a Fileset literal.
Syntax:
$H_ANFLFST b_structure1 FILE_STRUCT=b_structure2;
Parameters:
name
FILE_STRUCT
in input
and initialized as required for H_ANFILE.
The string address, beginning and end index are to be
found in the substructure FLREF of H_DCANFST.
Return Codes:
These are given by the RC in the H_DCANFST structure.
If RC=-1, another $REF:file_literal has been found. Repeated calls are made to
H_ANFLFST to analyze the remaining file literal, until RC is different from -1.
Output of $H_ANFLFST is to the $H_DCANFST structure.
47 A2 36UJ Rev05
7-51
7.9
where:
The star convention acts as a pattern in which the star * may match any occurrence
(including none) of any characters. The upper and lower values delimit the
inclusive range within which the matching names must fall.
7.9.1
Primitives
Three primitives are provided for analysis of the star convention:
$H_DCANSTAR declares a data structure to be used as an argument for the
for a star convention and fills in fields of the data structure for use by
$H_CHKSTAR
$H_CHKSTAR checks whether a given name matches the star convention of the
7-52
47 A2 36UJ Rev05
Programmatic Interface
7.9.1.1
DCANSTAR
Purpose:
To declare and generate a STAR convention structure to be is filled by
H_ANSTAR and used by H_CHKSTAR.
Syntax:
$H_DCANSTAR [PREFIX=l_identifier16] [ATTRIB=l_char];
Parameters:
PREFIX
For more information, see the GPL System Primitives Reference Manual.
47 A2 36UJ Rev05
7-53
7.9.1.2
ANSTAR
Purpose:
To analyze a STAR convention and fill the structure generated by H_DCANSTAR.
Syntax:
$H_ANSTAR i_char63, OSTRUCT=o_structure;
Parameters:
string
OSTRUCT
7-54
Normal
DONE
Abnormal
47 A2 36UJ Rev05
Programmatic Interface
7.9.1.3
CHKSTAR
Purpose:
To check if a name (STAR convention) matches a given star convention. For
example, if INSTANT matches the *NST*$>CA$<PRS star convention.
Syntax:
$H_CHKSTAR i_char31 ISTRUCT=i_structure;
Parameters:
string
ISTRUCT
Return Codes:
Normal
DONE
Abnormal
47 A2 36UJ Rev05
7-55
7.10
Job Submission
The Input Reader provides interfaces for SYNCHRONOUS or
ASYNCHRONOUS submission of jobs for programs written in: GPL and
COBOL.
7.10.1
Syntax:
GPL:
$H_RUN JOBDESC_PTR=I_JOBDESC_PTR
IO_RESULT_PTR;
RESULT_PTR =
OPTERR
COBOL:
7.10.2
GPL:
$H_SUBMIT JOBDESC_PTR=I_JOBDESC_PTR
RESULT_PTR=IO_RESULT_PTR;
RETURN CODE G4:
DONE
ARGERR
OPTERR
COBOL:
7-56
47 A2 36UJ Rev05
Programmatic Interface
7.10.3
Description of Parameters
I_JOBDESC_PTR
IO_RESULT_PTR
JOB_DESCRIPTION
RESULT
47 A2 36UJ Rev05
7-57
7.10.4
GPL:
$H_JOBINFO JOBSTRUCT=b_jobstruct;
RETURN CODE G4:
DONE
ARGERR
NOMATCH
Function is correct.
Invalid argument REQID.
The job has not yet been launched or is no longer
known to the system.
Overflow on a system table.
SYSOVLD
COBOL:
Comments:
The CALL H_CBL_UJOBINFO can follow either a CALL H_IN_ISUBMIT
or a CALL H_IN_UEJR.
Description of Parameters:
JOBSTRUCT
7-58
47 A2 36UJ Rev05
Programmatic Interface
7.10.5
COBOL Equivalents
The COBOL equivalents for GPL values are:
GPL values
CHAR(nn)
FIXED BIN(15)
FIXED BIN(31)
COBOL values
PIC X(nn)
COMP-1
COMP-2
01 JD-JOB-DESCRIPTION.
03 JD-JOB-SOURCE.
05 JD-MEMBERS
05 JD-FILE
05 JD-SELECTION-FLAG
05 JD-JOBS-SELECTION.
07 JD-JOB-ID1
07 JD-JOB-ID2
05 FILLER
03 JD-JOB-ATTRIBUTES.
05 JD-JOBLANG
05 JD-HOLDOUT
05 JD-HOLD
05 JD-JOR
05 JD-LIST
05 JD-JOBCLASS
05 JD-PRIORITY
05 JD-STARTUP
05 JD-REPEAT
05 JD-DELETE
05 JD-HOST
05 JD-SWITCH.
07 JD-PASS
07 JD-SWITCHES
05 JD-EXPVAL
05 JD-NOMESSIOF
05 FILLER
03 JD-JOB-SUBMITTER.
05 JD-COMMIT
05 JD-COMMITMENT-ID.
07 JD-PROCESSOR-ID
07 JD-COMMIT-ID
07 JD-TPR-ID
47 A2 36UJ Rev05
PIC X(31).
PIC X(78).
PIC X.
PIC X(8).
PIC X(8).
PIC X(18).
PIC
PIC
PIC
PIC
PIC
PIC
PIC
PIC
PIC
PIC
PIC
X.
X.
X.
X.
X.
X(2).
X.
X.
X.
X.
X(4).
PIC
PIC
PIC
PIC
PIC
X.
X(32).
X.
X.
X(14).
PIC X.
PIC X(4).
COMP-2.
COMP-1.
7-59
05
03
03
03
03
7-60
JD-SUBMITTER-ID.
07 JD-USER
07 JD-PROJECT
07 JD-BILLING
07 FILLER
05 FILLER
JD-JOB-OUTPUTS.
05 JD-DESTINATION.
07 JD-PRIMARY-STATION
07 JD-SECONDARY-STATION
05 JD-BANNER
05 JD-BANINF.
07 JD-BANINF1
07 JD-BANINF2
07 JD-BANINF3
07 JD-BANINF4
05 FILLER
JD-GCL-ARGUMENTS.
05 JD-DEBUG-GCL
05 JD-TRACE-GCL
05 JD-SEV
05 FILLER
05 JD-H-BATCH-OPTIONS.
07 FILLER
07 JD-REPEAT-STEP
07 JD-JOURNAL
07 JD-DUMP
07 JD-PRIVATE-DUMP
07 FILLER
07 JD-PRTFILE
05 FILLER
JD-OTHERS.
05 FILLER
JD-VALUES-DESCRIPTION.
05 JD-VALUES-LENGTH
05 JD-VALUES-STRING
PIC
PIC
PIC
PIC
PIC
X(12).
X(12).
X(12).
X(12).
X(22).
PIC X(8).
PIC X(8).
PIC X.
PIC
PIC
PIC
PIC
PIC
X(12).
X(12).
X(12).
X(12).
X(15).
PIC
PIC
PIC
PIC
X.
X.
X.
X(12).
PIC
PIC
PIC
PIC
PIC
PIC
PIC
PIC
X.
X.
X.
X.
X.
X(14).
X(78).
X(16).
PIC X(32).
COMP-1.
PIC X(3000).
47 A2 36UJ Rev05
Programmatic Interface
Comments
MEMBERS
FILE
SELECTION_FLAG
JOB_ID1
JOB_ID2
JOBLANG
HOLDOUT
HOLD
JOR
47 A2 36UJ Rev05
7-61
LIST
7-62
JOBCLASS
PRIORITY
STARTUP
REPEAT
DELETE
HOST
PASS
47 A2 36UJ Rev05
Programmatic Interface
SWITCHES
EXPVAL
NOMESSIOF
COMMIT
COMMITMENT_ID
SUBMITTER_ID
DESTINATION
BANNER
BANINF
47 A2 36UJ Rev05
7-63
7-64
DEBUG_GCL
TRACE_GCL
SEV
REPEAT_STEP
JOURNAL
DUMP
PRIVATE_DUMP
PRTFILE
47 A2 36UJ Rev05
Programmatic Interface
COMP-2.
COMP-2.
COMP-1.
COMP-1.
COMP-2.
COMP-1.
COMP-1.
COMP-1.
COMP-1.
COMP-1.
COMP-2.
Comments
SEG_SIZE
START_TIME
RETCODE
NB_ERROR
47 A2 36UJ Rev05
7-65
7-66
ERROR
NB_JOB_ENTRY
JOB_ENTRY
STATUS
REQID_RON
47 A2 36UJ Rev05
Programmatic Interface
7.10.6
Syntax:
GPL:
$H_LSJDERR ERROR_PTR=I_ERROR_PTR;
COBOL:
Parameters:
I_ERROR_PTR
GPL Ex:
I_LIST
7.10.7
Examples
Each field of the input structure JOB_DESCRIPTION must be initialized. The
blank values mean default values.
The first field (SEG_SIZE) of the input/output structure RESULT must be
initialized to the size of the structure. If the value of NB_ERROR is negative or
greater than 16, the READER will initialize the RESULT structure.
47 A2 36UJ Rev05
7-67
PTR;
PTR;
BEGIN;
L_JDPTR = ADDR(L_JD_JOB_DESCRIPTION);
L_RESPTR = ADDR(L_RES_RESULT);
/*****
Test of $;H_SUBMIT
*****************************************/
L_RES_SEG_SIZE = MEASURE(L_RES_RESULT);
L_RES_NB_ERROR = 0; /* ask the READER to initialize the result structure */
L_JD_JOB_DESCRIPTION = K_JD_JOB_DESCRIPTION;
L_JD_MEMBERS = "JCL_JOB";
L_JD_FILE = "LIBRARY";
L_JD_HOLDOUT = "1";
L_JD_VALUES_LENGTH = 34;
L_JD_VALUES_STRING = "TEST OF GPL MACRO NAME='$;H_SUBMIT'";
$H_SUBMIT
JOBDESC_PTR=L_JDPTR RESULT_PTR=L_RESPTR;
$H_LSJDERR ERROR_PTR=ADDR(L_RES_NB_ERROR);
/*****
Test of $;H_RUN
*****************************************/
JOBDESC_PTR=L_JDPTR RESULT_PTR=L_RESPTR;
$H_LSJDERR ERROR_PTR=ADDR(L_RES_NB_ERROR);
END;
END EJR_RUN_GPL;
7-68
47 A2 36UJ Rev05
Programmatic Interface
IDENTIFICATION DIVISION.
PROGRAM-ID. URUN-COB.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY JOBDESC-COB.
COPY EJRRUNOUT-COB.
77
PROCEDURE DIVISION .
DEBUT.
MOVE SPACE TO JD-JOB-DESCRIPTION.
MOVE "LIBRARY..GCL_JOB" TO JD-FILE.
MOVE "1" TO JD-HOLDOUT.
MOVE "y" TO JD-JOR.
MOVE "A" TO JD-LIST.
MOVE "010010001" TO JD-SWITCHES.
MOVE "0" TO JD-COMMIT.
MOVE "OPERATOR" TO JD-USER.
MOVE "1" TO JD-DEBUG-GCL.
MOVE "LISLIB..RGCL_JOB" TO JD-PRTFILE.
MOVE 0 TO JD-VALUES-LENGTH.
MOVE ZERO TO RES-RESULT.
MOVE 180 TO RES-SEG-SIZE.
CALL "H_IN_URUN" USING JD-JOB-DESCRIPTION RES-RESULT.
IF RES-RETCODE = ZERO
DISPLAY "Job introduced ==> RON:" RES-REQID-RON(1) UPON TERMINAL
ELSE DISPLAY "No job submitted" UPON TERMINAL.
CALL "H_IN_UJDERR" USING RES-ERROR-DESC LIST-ALL-ERR.
STOP RUN.
47 A2 36UJ Rev05
7-69
$JOB JCL_JOB11;
$ENDJOB;
$JOB JCL_JOB12;
$ENDJOB;
$JOB JCL_JOB13;
$ENDJOB;
JCL_JOB2:
$JOB JCL_JOB2;
$ENDJOB;
IDENTIFICATION DIVISION.
PROGRAM-ID. UEJR-COB.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY JOBDESC-COB.
COPY EJRRUNOUT-COB.
77
PROCEDURE DIVISION .
DEBUT.
MOVE SPACE TO JD-JOB-DESCRIPTION.
MOVE "LIBRARY" TO JD-FILE.
MOVE "JCL_JOB*" TO JD-MEMBERS.
MOVE "1" TO JD-SELECTION-FLAG.
MOVE "JCL_JOB12" TO JD-JOB-ID2.
MOVE "1" TO JD-HOLDOUT.
MOVE "C" TO JD-JOBCLASS.
MOVE "RMOT" TO JD-HOST.
MOVE "JOB_OWNER" TO JD-USER.
MOVE "DUMMY" TO JD-PRTFILE.
MOVE 41 TO JD-VALUES-LENGTH.
MOVE "test of H_IN_UEJR entry PROCNAME=UEJR-COB" TO JD-VALUES-STRING.
MOVE ZERO TO RES-RESULT.
MOVE 180 TO RES-SEG-SIZE.
CALL "H_IN_UEJR" USING JD-JOB-DESCRIPTION RES-RESULT.
IF RES-RETCODE = ZERO
DISPLAY "Request introduced ==> JON:" RES-REQID-RON(1) UPON TERMINAL
ELSE DISPLAY "No job submitted" UPON TERMINAL.
CALL "H_IN_UJDERR" USING RES-ERROR-DESC LIST-ALL-ERR.
STOP RUN.
7-70
47 A2 36UJ Rev05
Programmatic Interface
7.10.8
Error Messages
Severity
Class
Number
Message
00
10000
00
10041
00
10201
00
10211
1
1
00
00
10221
10241
00
10251
00
10261
00
10271
00
10281
00
10042
00
10202
00
10212
1
1
00
00
10222
10242
00
10252
00
10262
00
10272
00
10282
47 A2 36UJ Rev05
7-71
7-72
Severity
Class
Number
Message
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
00020
00030
00040
00050
00060
00070
00080
00090
00100
00110
00120
00130
00150
00160
00170
00180
00190
00200
00210
00220
00230
00240
00250
00260
00270
00280
00290
00300
01
00310
3
3
3
3
01
01
02
02
00320
00330
00021
00022
02
00131
02
00141
47 A2 36UJ Rev05
Programmatic Interface
Severity
Class
Number
Message
02
00142
02
00143
02
00181
02
00191
3
3
3
3
3
3
02
02
02
02
02
02
00291
00292
00293
00294
00295
00296
02
00321
3
3
3
03
03
03
10000
10110
10120
03
10130
3
3
03
03
10140
10150
03
10160
03
10170
03
10180
03
10190
47 A2 36UJ Rev05
7-73
7-74
47 A2 36UJ Rev05
Index
#
# system variable 2-56
#ABS builtin 2-79
#AND builtin 2-84
#AUTOLF system variable 2-56
#BILLING builtin 2-102
#BINLIB system variable 2-57
#BINTODEC builtin 2-111
#BLIB system variable 2-57
#BRK system variable 2-58, 4-4
#BRKPMODE system variable 2-58, 4-4
#BYTE builtin 2-111
#CAT builtin 2-86
#CC system variable 2-58
#CHECKSTAR builtin 2-99
#CINLIB system variable 2-58
#CLIB system variable 2-59
#CPU builtin 2-102
#CSET system variable 2-59
#CTN builtin 2-86
#CVBOOL builtin 2-111
#CVDATDEC builtin 2-112
#CVDEC builtin 2-112
#CVDECDAT builtin 2-112
#CVFILE builtin 2-113
#CVFSET builtin 2-113
#CVHEXA builtin 2-113
#CVLIB builtin 2-113
#CVNAME builtin 2-113
#CVOUTPUT builtin 2-113
#CVRFILE builtin 2-114
#CVSTAR builtin 2-114
#CVVOLUME builtin 2-114
47 A2 36UJ Rev05
i-1
i-2
47 A2 36UJ Rev05
Index
A
ABORT basic GCL command 2-5
ABS builtin 2-79
Absentee 1-36
Access to GCOS Files (GCL) 4-1
AI directive 1-19
ALTER_INPUT directive 1-19
AND builtin 2-84
ANFILE File Analysis Primitive 7-47
ANFLFST Fileset Analysis Primitive 7-51
ANFST Fileset Analysis Primitive 7-50
ANSTAR Star Analysis Primitive 7-54
AP MNCMD command 3-15
APPEND MNCMD command 3-15
Arguments of builtins 1-15
Assign value to a variable 1-9
AUTOLF system variable 2-56
B
Basic GCL commands 2-1
BILLING builtin 2-102
BINLIB MNCMD command 3-17
BINLIB system variable 2-57
BINTODEC builtin 2-111
BLIB system variable 2-57
Break processing 4-4
BREC access command 4-8
BRKPMODE system variable 2-58
BRKsystem variable 2-58
BUILD_RECORD access cmd 4-8
Builtin function 1-14, 2-77
BYTE builtin 2-111
47 A2 36UJ Rev05
i-3
D
D MNCMD command 3-32
DATE builtin 2-102
DCANFILE File Analysis Primitive 7-47
DCANFST Fileset Analysis Primitive 7-49
DCANSTAR Star Analysis Primitive 7-53
DCLF access command 4-12
DEBUG system variable 2-60, 6-1
Debugging GCL procedures 6-1
DEC MNCMD command 3-27
DECLARE_FILE access cmd 4-12
DECOMPILE MNCMD command 3-27
DECTOHEXA builtin 2-114
DELETE MNCMD command 3-29
DELETE_ENVT MNCMD cmd 3-31
DELETE_RECORD access cmd 4-16
DI system variable 2-60
DISPLAY MNCMD command 3-32
DISPLAY_SCREEN MNCMD
command 3-33
DIVIDE builtin 2-79
DL MNCMD command 3-29
DLENVT MNCMD command 3-31
DLREC access command 4-16
domain 7-13
Domain 1-24
DOMAIN MNCMD command 3-35
DOMAINID builtin 2-102
domains 3-4
DROP builtin 2-99
DROPGB builtin 2-99
DSCRN MNCMD command 3-33
DUMP command 6-2
i-4
E
ED MNCMD command 3-36
EDFERR access command 4-19
EDIT MNCMD command 3-36
EDIT_FILE_ERROR access cmd 4-19
EDITCTL system variable 2-61
EFN builtin 2-116
ELAPSED builtin 2-103
ELEM builtin 2-94
ELSE basic GCL command 2-13
ENDCASEOF basic GCL cmd 2-14
ENDIF basic GCL command 2-15
ENDPROC basic GCL command 2-16
ENDUNDLIST basic GCL cmd 2-17
ENDUNTIL basic GCL command 2-18
ENDWHILE basic GCL command 2-19
Environment creation 3-38
environments 3-12
ENVT MNCMD command 3-38
ENVT system variable 2-61
EQ builtin 2-82
EXIST builtin 2-100
EXIST_FILE access command 4-22
EXISTF access command 4-22
EXPANDPATH builtin 2-116
Explicit conversions 1-12
Expressions 1-2, 1-14
EXPTABS system variable 2-62
EXTDATE builtin 2-103
F
FB15 builtin 2-114
FB31 builtin 2-115
File Literal 7-43
Fileset Literal 7-48
FMT builtin 2-95
FORMLANG system variable 2-62
FSE MNCMD command 3-40
FSITE builtin 2-116
FW builtin 2-103
47 A2 36UJ Rev05
Index
G
GCL access primitives 7-1
GCL batch job
example 5-2
GCL domains 3-4
GCL Job Statements 5-1
Parameterization of - 5-30
GCL Primitives
Schematic Program of - 7-12
GCL procedure 1-24, 1-28, 3-1
GCL procedure creation 3-25
GCL to access GCOS files 4-1
GCL variable primitives 7-38
GCL variables 7-38
GCLABORT Primitive 7-8
GCLFORM system variable 2-63
GCLINIT Primitive 7-2
GCLREAD Primitive 7-6
GCLRETRY Primitive 7-10
GCOS file access commands 4-7
GCOS file access through GCL 4-1
GE builtin 2-82
GLOBAL directive 1-5
Global variables 1-4
GOTO basic GCL command 2-20
GPL GCL interface 7-1
GT builtin 2-83
J
JCLCOMP system variable 2-64
Job
Execution 5-4
Occurrence Report 5-35
Submission 5-3
Translation 5-4
JOBLANG system variable 2-64
K
KLN builtin 2-91
KWD basic GCL command
1-29, 2-24
L
H
HELP primitive 7-36
help text 7-22
HEXATODEC builtin 2-115
I
IF basic GCL command 2-22
Implicit conversions 1-11
INDEX builtin 2-86
INDEX_SET builtin 2-95
Input Reader Statements 5-5
INVCHAR system variable 2-63
ISITBOOL builtin 2-107
ISITDATE builtin 2-107
47 A2 36UJ Rev05
L builtin 2-91
LABEL basic GCL command 2-31
LANG system variable 2-65
LC builtin 2-87
LCOUNT builtin 2-95
LCTN builtin 2-96
LD MNCMD command 3-50
LE builtin 2-83
LED MNCMD command 3-41
LEDIT MNCMD command 3-41
LENGTH builtin 2-100
LET directive 1-9
libraries 3-11
Libraries of command definitions 1-24
LINDEX builtin 2-96
LINLIB system variable 2-65
i-5
List 1-10
LIST MNCMD command 3-44
LIST_ACCESS MNCMD cmd 3-46
LIST_DECLARED_FILE acc cmd 4-24
LIST_ENVT MNCMD command 3-48
LIST_PROJ MNCMD command 3-49
LISTGB builtin 2-100
LLENGTH builtin 2-96
LLIB system variable 2-66
LOAD MNCMD command 3-50
LOCAL basic GCL command 1-29, 2-32
LS MNCMD command 3-44
LSA MNCMD command 3-46
LSDCLF access command 4-24
LSENVT MNCMD command 3-48
LSPROJ MNCMD command 3-49
LSYS builtin 2-103
LT builtin 2-83
N
NAND builtin 2-84
NE builtin 2-83
NEXIST builtin 2-101
NO system variable 2-67
NOR builtin 2-84
NOT builtin 2-85
NOVICE system variable 2-67
O
Objects (GCL) 1-2
ON_ERROR MNCMD command 3-60
OPEN_FILE access command 4-30
OPENF access command 4-30
OR builtin 2-85
OTHER basic GCL command 2-37
OTHERWISE basic GCL cmd 2-37
M
MAINTAIN_COMMAND 1-24, 1-27
MAINTAIN_COMMAND cmd lang 3-1
MASTER builtin 2-92
MAX builtin 2-79
MAXLLENGTH builtin 2-97
MDA MNCMD command 3-54
MDAY builtin 2-104
MDLK MNCMD command 3-58
MDREC access command 4-26
MENU system variable 2-66
MERGE MNCMD command 3-52
MIN builtin 2-80
MINLLENGTH builtin 2-97
MINUS builtin 2-80
MLENGTH builtin 2-101
MNCMD 1-27
MOD builtin 2-80
MODE builtin 2-104
MODIFY builtin 2-87
MODIFY_ACCESS MNCMD cmd 3-54
MODIFY_LOCK MNCMD cmd 3-58
MODIFY_RECORD access cmd 4-26
MODVAR GCL variable primitive 7-41
MWINLIB BIN command 1-24
i-6
P
PAGEMODE system variable 2-68
PAGETOP system variable 2-68
Parameterization of Example 5-32
GCL Job Statements: 5-30
Input Enclosures 5-31
PL system variable 2-69
PLUS builtin 2-80
POINT_RECORD access cmd 4-34
PR MNCMD command 3-62
PRINT MNCMD command 3-62
PROC basic GCL command 1-28, 2-38
PROJ MNCMD command 3-64
PROJECT builtin 2-104
PROMPT system variable 2-69
PRTLIB system variable 2-69
PTREC access command 4-34
PW system variable 2-70
47 A2 36UJ Rev05
Index
Q
Q MNCMD command 3-66
QUERY builtin 2-92
QUIT MNCMD command 3-66
QUOTE builtin 2-87
R
RDREC access command 4-38
READ builtin 2-92
READ_RECORD access cmd 4-38
Reading from the terminal 1-16
READL builtin 2-93
READVAR GCL variable primitive 7-39
Recovery 5-34
References to lists 1-12
References to variables 1-12
RELEASE_FILE access cmd 4-42
REPLACE builtin 2-97
RESAVE MNCMD command 3-67
RESEQUENCE MNCMD cmd 3-70
RESET MNCMD command 3-71
RESTORE_ACCESS MNCMD 3-72
RETRY basic GCL command 2-43
RETURN basic GCL command 2-45
RETURN_DECLARED_FILE cmd 4-44
RJD builtin 2-115
RLSF access command 4-42
ROLL system variable 2-70
RON builtin 2-104
RSQ MNCMD command 3-70
RSTA MNCMD command 3-72
RSV MNCMD command 3-67
RTDCLF access command 4-44
S
SAVE MNCMD command 3-74
SAVE_ACCESS MNCMD cmd 3-76
SCALL basic GCL command 2-46
Search rules for commands 1-24
SEV system variable 2-71
SIGNUM builtin 2-81
SINLIB system variable 2-71
47 A2 36UJ Rev05
T
TABS system variable 2-73
TERMID builtin 2-104
TIME builtin 2-105
TIMES builtin 2-81
TRACE system variable 2-74, 6-1
TTYPE builtin 2-105
Type (of a variable) 1-11
U
UC builtin 2-89
UNLIST basic GCL command 2-48
UNQUOTE builtin 2-89
UNTIL basic GCL command 2-50
USERID builtin 2-105
i-7
W
WAIT builtin 2-105
WD system variable 2-74
WDAY builtin 2-105
WHILE basic GCL command 2-53
WRITE_RECORD access cmd 4-49
Writing on the terminal 1-16
WRREC access command 4-49
WSTATION system variable 2-75
i-8
Y
YDAY builtin 2-106
YES system variable 2-76
Z
ZOK system variable
2-76
47 A2 36UJ Rev05
Reference N :
47 A2 36UJ 05
Date:
August 1999
ERRORS IN PUBLICATION
Your comments will be promptly investigated by qualified technical personnel and action will be taken as required.
If you require a written reply, please include your complete mailing address below.
NAME :
COMPANY :
ADDRESS :
Please give this technical publication remarks form to your BULL representative or mail to:
Date :
BULL CEDOC
357 AVENUE PATTON
B.P.20845
49008 ANGERS CEDEX 01
FRANCE
CEDOC Reference #
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
_ _
_ _
_ _ _ _
[ _ _ ]
[ _ _ ]
Phone:
FAX:
E-Mail:
+33 (0) 2 41 73 72 66
+33 (0) 2 41 73 70 66
srv.Duplicopy@bull.net
Designation
Qty
NAME:
Date:
COMPANY:
ADDRESS:
PHONE:
E-MAIL:
For Bull Subsidiaries:
Identification:
For Bull Affiliated Customers:
Customer Code:
For Bull Internal Customers:
Budgetary Section:
For Others: Please ask your Bull representative.
FAX:
BULL CEDOC
357 AVENUE PATTON
B.P.20845
49008 ANGERS CEDEX 01
FRANCE
REFERENCE
47 A2 36UJ 05