76 lines
4.6 KiB
HTML
76 lines
4.6 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="task" />
|
|
<meta name="DC.Title" content="Access files" />
|
|
<meta name="abstract" content="A file must exist when compiling a CL module or OPM program that uses it." />
|
|
<meta name="description" content="A file must exist when compiling a CL module or OPM program that uses it." />
|
|
<meta name="DC.Relation" scheme="URI" content="except.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="wfile.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="accessfile" />
|
|
<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>Access files</title>
|
|
</head>
|
|
<body id="accessfile"><a name="accessfile"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Access files</h1>
|
|
<div><p>A file must exist when compiling a CL module or OPM program that
|
|
uses it.</p>
|
|
<div class="section"> <p>The compiler accesses files when compiling a program module that
|
|
has a <span class="cmdname">Declare File (DCLF)</span> command. The file does not have
|
|
to exist when creating a program or service program that uses the module.</p>
|
|
<p>Enter
|
|
Data Description Specifications (DDS) into a source file before creating it.
|
|
The DDS describes the record formats and the fields within the records. Additionally,
|
|
the system compiles this information to create the file object through the <span class="cmdname">Create
|
|
Display File (CRTDSPF)</span> command. </p>
|
|
<div class="note"><span class="notetitle">Note:</span> You can create other
|
|
types of files from DDS, and each type has its own command: <span class="cmdname">Create
|
|
Physical File (CRTPF)</span> and <span class="cmdname">Create Logical File (CRTLF)</span> are
|
|
two that create files that you can use in CL programs and procedures.</div>
|
|
<p>The
|
|
fields that are described in the DDS can be input or output fields (or both).
|
|
The system declares the fields in the CL program or procedure as variables
|
|
when it compiles a program or module. The program manipulates data from display
|
|
through these variables.</p>
|
|
<p>If you do not use DDS to create a physical
|
|
file, the system declares a CL variable to contain the entire record. This
|
|
variable has the same name as the file, and its length is the same as the
|
|
record length of the file.</p>
|
|
<p>CL programs and procedures cannot manipulate
|
|
data in any types of files other than display files and database files, except
|
|
with specific CL commands.</p>
|
|
<p>Deletion of the DDS after creating the file
|
|
is possible but not recommended. You can delete the file after the system
|
|
compiles the CL program or module that refers to the file. This is true provided
|
|
the file exists when the command referring to it, such as a <span class="cmdname">Receive
|
|
File (RCVF)</span>, is processed in the program.</p>
|
|
<p>The rules on qualified
|
|
names that are described here for command definitions also apply to files.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="except.htm" title="To access command definitions or files from a CL program, the command definitions or files must exist at creation time of the program and must exist when the command that refers to them runs.">Access command definitions, files, and procedures</a></div>
|
|
</div>
|
|
<div class="reltasks"><strong>Related tasks</strong><br />
|
|
<div><a href="wfile.htm" title="Two types of files are supported in CL procedures and programs: display files and database files.">Work with files in CL procedures</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |