ibm-information-center/dist/eclipse/plugins/i5OS.ic.rbam6_5.4.0.1/clpro.htm

174 lines
12 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="CL programming" />
<meta name="abstract" content="This provides tasks and concepts specific to CL programming." />
<meta name="description" content="This provides tasks and concepts specific to CL programming." />
<meta name="DC.subject" content="control language (CL), program, description, CL procedure, introduction, control language (CL), purpose, CL procedure, advantages for using, restriction" />
<meta name="keywords" content="control language (CL), program, description, CL procedure, introduction, control language (CL), purpose, CL procedure, advantages for using, restriction" />
<meta name="DC.Relation" scheme="URI" content="rbam6clmain.htm" />
<meta name="DC.Relation" scheme="URI" content="creat.htm" />
<meta name="DC.Relation" scheme="URI" content="comds.htm" />
<meta name="DC.Relation" scheme="URI" content="workp.htm" />
<meta name="DC.Relation" scheme="URI" content="workv.htm" />
<meta name="DC.Relation" scheme="URI" content="contp.htm" />
<meta name="DC.Relation" scheme="URI" content="valvz.htm" />
<meta name="DC.Relation" scheme="URI" content="crpro.htm" />
<meta name="DC.Relation" scheme="URI" content="clcompiling.htm" />
<meta name="DC.Relation" scheme="URI" content="cflow.htm" />
<meta name="DC.Relation" scheme="URI" content="clpgcomm.htm" />
<meta name="DC.Relation" scheme="URI" content="cmdinfodoc.htm" />
<meta name="DC.Relation" scheme="URI" content="clpgcmdAPIs.htm" />
<meta name="DC.Relation" scheme="URI" content="allow.htm" />
<meta name="DC.Relation" scheme="URI" content="pmenu.htm" />
<meta name="DC.Relation" scheme="URI" content="cmdanalyz.htm" />
<meta name="DC.Relation" scheme="URI" content="apgmdbcs.htm" />
<meta name="DC.Relation" scheme="URI" content="loadrunap.htm" />
<meta name="DC.Relation" scheme="URI" content="tfrct.htm" />
<meta name="DC.Relation" scheme="URI" content="sampl.htm" />
<meta name="DC.Relation" scheme="URI" content="defmlclhll.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="clpro" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>CL programming</title>
</head>
<body id="clpro"><a name="clpro"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">CL programming</h1>
<div><p>This provides tasks and concepts specific to CL programming.</p>
<p>A <em>CL procedure</em> is a group of CL commands that tells the system where
to get input, how to process it, and where to place the results. The procedure
is assigned a name by which it can then be called by other procedures or bound
into a program and called. As with other kinds of procedures, you must enter
CL procedure source statements, compile, and bind them before you can run
the procedure.</p>
<p>When you enter CL commands individually (from the Command Entry display,
for instance, or as individual commands in an input stream), each command
is separately processed. When you enter CL commands as source statements
for a CL procedure, the source remains for later modification if you choose,
and the commands are compiled into a module. This module remains as a permanent
system object that can be bound into other programs and run. Thus, CL is actually
a high-level programming language for system functions. CL procedures ensure
consistent processing of groups of commands. You can perform functions with
a CL procedure that you cannot perform by entering commands individually,
and the CL program or procedure provides better performance at run time than
the processing of several separate commands.</p>
<p>CL procedures can be used in batch or interactive processing. Certain
commands or functions are restricted to either batch or interactive jobs. CL
source statements consist of CL commands. You cannot use all CL commands as
CL source statements, and you can use some of them only in CL procedures or
OPM programs. CL source statements can be entered in a database source member
either interactively from a workstation or in a batch job input stream from
a device. To create a program using CL source statements, you must enter the
source statements into a database source member. You can then create an ILE
program by compiling the source member into a module and binding the module
into a program object.</p>
<p>CL procedures can be written for many purposes, including: </p>
<ul><li>To control the sequence of processing and calling of other programs or
procedures.</li>
<li>To display a menu and run commands based on options selected from that
menu. This makes the workstation user's job easier and reduces errors.</li>
<li>To read a database file.</li>
<li>To handle error conditions issued from commands, programs or procedures,
by monitoring for specific messages.</li>
<li>To control the operation of an application by establishing variables used
in the application, such as date, time, and external indicators.</li>
<li>To provide predefined functions for the system operator, such as starting
a subsystem or saving files. This reduces the number of commands the operator
uses regularly, and it ensures that system operations are performed consistently.</li>
</ul>
<p>There are many advantages in using CL procedures for an application. For
example: </p>
<ul><li>Because the commands are stored in a form that can be processed when the
program is created, using programs is faster than entering and running the
commands individually.</li>
<li>CL procedures are flexible. Parameters can be passed to CL procedures
to adapt the operations performed by the procedure to the requirements of
a particular use.</li>
<li>CL procedures can be tested and debugged like other high-level language
programs and procedures.</li>
<li>CL procedures and programs can incorporate conditional logic and special
functions not available when commands are entered individually.</li>
<li>CL procedures can be bound with procedures of other languages.</li>
</ul>
<p>You cannot use CL procedures to: </p>
<ul><li>Add or update records in database files.</li>
<li>Use printer or ICF files.</li>
<li>Use subfiles within display files.</li>
<li>Use program-described display files.</li>
</ul>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="creat.htm">Create a CL procedure</a></strong><br />
All programs are created in steps.</li>
<li class="ulchildlink"><strong><a href="comds.htm">Commands used in CL procedures</a></strong><br />
A CL procedure can contain only CL commands.</li>
<li class="ulchildlink"><strong><a href="workp.htm">Use CL procedures</a></strong><br />
This gives an overview of the types of operations performed using CL procedures</li>
<li class="ulchildlink"><strong><a href="workv.htm">Use variables</a></strong><br />
CL procedures consist of CL commands, and the commands themselves consist of the command statement, parameters, and parameter values.</li>
<li class="ulchildlink"><strong><a href="contp.htm">Control processing within a CL procedure</a></strong><br />
You can use commands to change the flow of logic within your CL procedure.</li>
<li class="ulchildlink"><strong><a href="valvz.htm">Retrieve values that can be used as variables</a></strong><br />
This addresses how to retrieve values such as system values and job attributes to use as variables in a procedure. Note that not every possible retrieve value is included.</li>
<li class="ulchildlink"><strong><a href="crpro.htm">Compile CL procedures</a></strong><br />
A CL source procedure must be compiled into a module and bound into a program before it can be run.</li>
<li class="ulchildlink"><strong><a href="clcompiling.htm">Compile source programs for a previous release</a></strong><br />
The <span class="cmdname">Create Control Language Program (CRTCLPGM)</span> command
allows you to compile CL source programs to use on a previous release by using
the target release (TGTRLS) parameter. </li>
<li class="ulchildlink"><strong><a href="cflow.htm">Control flow and communicate between programs and procedures</a></strong><br />
You can use the <span class="cmdname">Call Program (CALL)</span>, <span class="cmdname">Call
Bound Procedure (CALLPRC)</span>, and <span class="cmdname">Return (RETURN)</span> commands
to pass control back and forth between programs and procedures. </li>
<li class="ulchildlink"><strong><a href="clpgcomm.htm">Communicate between programs and procedures</a></strong><br />
This gives information about how programs and procedures can communicate using data queues and data areas.</li>
<li class="ulchildlink"><strong><a href="cmdinfodoc.htm">Define and document commands</a></strong><br />
This describes how you can define your own commands and provide documentation for them.</li>
<li class="ulchildlink"><strong><a href="clpgcmdAPIs.htm">Use command-related APIs</a></strong><br />
This describes application programming interfaces (APIs) and programs that can be used when working with commands.</li>
<li class="ulchildlink"><strong><a href="allow.htm">Prompt for user input at runtime</a></strong><br />
You can prompt the workstation user for input to a CL procedure or program.</li>
<li class="ulchildlink"><strong><a href="pmenu.htm">Enter program source</a></strong><br />
You can enter program source using the programmer menu.</li>
<li class="ulchildlink"><strong><a href="cmdanalyz.htm">Use command analyzer exit points</a></strong><br />
The exit program registration facility provides two exit points for the system.</li>
<li class="ulchildlink"><strong><a href="apgmdbcs.htm">Application programming for DBCS data</a></strong><br />
Special considerations must be made when designing application programs to process double-byte data or converting alphanumeric application programs to double-byte programs.</li>
<li class="ulchildlink"><strong><a href="loadrunap.htm">Load and run an application from tape or optical media</a></strong><br />
The <span class="cmdname">Load and Run Media Program (LODRUN)</span> command
allows the user to load and run an application written by another user or
a software vendor from tapes or optical media supplied by the other user.</li>
<li class="ulchildlink"><strong><a href="tfrct.htm">Transfer control to improve performance</a></strong><br />
The <span class="cmdname">Transfer Control (TFRCTL)</span> command calls
the program specified on the command, passes control to it, and removes the
transferring program from the call stack. </li>
<li class="ulchildlink"><strong><a href="sampl.htm">Examples: CL programs and procedures</a></strong><br />
These sample programs demonstrate the flexibility, simplicity, and versatility of CL programs.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbam6clmain.htm">Control language</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="defmlclhll.htm" title="This describes the format in which elements in a mixed list are passed when a command is run using CL or a high-level language.">Use CL or HLL for mixed lists</a></div>
</div>
</div>
</body>
</html>