Creating a file: Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
(35 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
==Overview==
==Overview==
<p>After you have determined the space requirements for your file, and the data you expect it to contain, you can set the file parameters and build the File Control Table (FCT) with the [[CREATE command: File|CREATE command]].</p>
<p>
<p>This topic provides an overview of the CREATE command and its parameters, but for the full description the above link should be followed. </p>
After you have determined the space requirements for your file, and the data you expect it to contain, you can set the file parameters and build the [[File Control Table (File architecture)|File Control Table]] (FCT) with the <var>[[CREATE command: File|CREATE]]</var> command.</p>
<p>For information on creating groups of files, see [[Managing File Groups]].</p>
<p>
This topic provides an overview of the <var>CREATE</var> command and its parameters, but for the full description the above link should be followed. </p>
<p>
For information about creating a file using FILEMGMT ([[File management overview#Dictionary/204 File Management Subsystem facility|Dictionary/204 File Management Subsystem facility]]), see [[File creation overview]].<br>
For information about creating groups of files, see [[Managing file groups]].</p>


==CREATE command==
==CREATE command==
<p>The two variations of the CREATE command can create either [[CREATE command: File|files]] and groups (either [[CREATE command: Permanent group|permanent]] or [[CREATE command: Temporary group|temporary]]. Any user can create a temporary group; only the system manager can create a permanent group. </p>
<p>
The two variations of the <var>CREATE</var> command can create either [[CREATE command: File|files]] and groups (either [[CREATE command: Permanent group|permanent]] or [[CREATE command: Temporary group|temporary]]. Any user can create a temporary group; only the system manager can create a permanent group. </p>
====Syntax====
<p>
The format of the <var>CREATE</var> command to create a file is:</p>


<p>The format of the CREATE command to create a file is:</p>
<p class="syntax">CREATE [FILE] [(FORMAT) <span class="squareb">|</span> (NOFORMAT)] <span class="term">filename
====Syntax====
</span>  [FROM <span class="term">ddname</span> [,<span class="term">ddname</span> ...]]
<p class="code">CREATE [FILE] [(FORMAT) | (NOFORMAT)] <var class="term">filename
   [PARAMETER <span class="term">parameter</span><b></b>=<span class="term">value</span> [,<var class="term">parameter</var><b></b>=<span class="term">value</span> ...] ]
</var>  [FROM <var class="term">ddname</var> [,<var class="term">ddname</var> ...]]
   [PARAMETER <span class="term">parameter</span><b></b>=<span class="term">value</span> [,<span class="term">parameter</span><b></b>=<span class="term">value</span>... ] ]
   [PARAMETER <var class="term">parameter</var><b></b>=<var class="term">value</var> [,<var class="term">parameter</var><b></b>=<var class="term">value</var> ...]
  ...
   | PARAMETER <var class="term">parameter</var><b></b>=<var class="term">value</var>  
END
  [,<var class="term">parameter</var><b></b>=<var class="term">value</var>... ] ]
</p>
</p>
<p>where:</p>
<p>
<p><var class="term">filename</var> is the name of the <var class="product">Model&nbsp;204</var> file that you are creating. The name can be up to 8 characters long. The filename cannot be FILE or GROUP and cannot start with CCA, SYS, OUT, TAPE, or a number. It must start with a letter, and can contain only letters, numbers, and the following special characters:</p>
where:</p>
<ul>
<li><b id="filename"></b><var class="term">filename</var> is the name of the <var class="product">Model&nbsp;204</var> file that you are creating. The name can be up to 8 characters long (7 for DOS systems). The filename cannot be <var>FILE</var> or <var>GROUP</var> and cannot start with <code>CCA</code> (except for [[System requirements for Application Subsystems#Creating CCASYS|CCASYS]]), <code>SYS</code>, <code>OUT</code>, <code>TAPE</code>, or a number. It can contain only uppercase letters, numbers, and the following special characters:
<p class="code">At sign (@)
<p class="code">At sign (@)
Pound sign (#)
Pound sign (#)
Dollar sign ($)  
Dollar sign ($) (alternately displayed as &#163;)
</p>
</p>
<p>The file name by which users refer to the <var class="product">Model&nbsp;204</var> file is simply the <var class="term">ddname</var> of the first (or only) data set in the file. The CREATE command establishes the file name and the <var class="term">ddnames</var> to be used thereafter for all data sets in the file. The <var class="term">filename</var> and <var class="term">ddnames</var> can be changed only by recreating the file or by issuing the <var class="product">Model&nbsp;204</var> DUMP and RESTORE commands (see [[ File Dumping and Restoring#File Dumping and Restoring|File Dumping and Restoring]]). </p>
 
<p><var class="term">ddname</var> is the name of a data set from which to create the file; it is required when the file is being created from more than one data set. The first <var class="term">ddname</var> specified must match the <var class="term">filename</var>.</p>
<p>
<p><var class="term">parameter = value</var> specifies <var class="product">Model&nbsp;204</var> file parameters. Any number of PARAMETER statements can immediately follow the command, and each statement can contain as many parameters in any order as fit on one input line. A list of parameters must be concluded by an END statement. File parameters are optional. </p>
The file name by which users refer to the <var class="product">Model&nbsp;204</var> file is simply the <var class="term">ddname</var> of the first (or only) data set in the file. The <var>CREATE</var> command establishes the file name and the <var class="term">ddnames</var> to be used thereafter for all data sets in the file. The <var class="term">filename</var> and <var class="term">ddnames</var> can be changed only by recreating the file or by issuing the <var class="product">Model&nbsp;204</var> <var>[[DUMP command|DUMP]]</var> and <var>[[RESTORE command|RESTORE]]</var> commands (see [[File dumping and restoring]]). </p></li>
<p>If no values are specified for any of the parameters which are used in calculating table sizes:</p>
 
<li><var class="term">ddname</var> is the name of a data set from which to create the file; it is required when the file is being created from more than one data set. The first <var class="term">ddname</var> specified must match the <var class="term">filename</var>.</li>
 
<li><var class="term">parameter = value</var> specifies <var class="product">Model&nbsp;204</var> file parameters. Any number of <var>PARAMETER</var> statements can immediately follow the command, and each statement can contain as many parameters in any order as fit on one input line. A list of parameters must be concluded by an <var>END</var> statement. File parameters are optional.  
<p>
If no values are specified for any of the following parameters that are used in calculating table sizes, the default values shown here are used:</p>
<div id="Default sizes"></div>
<div id="Default sizes"></div>
<table>
<table>
<tr class="head">
<th>Parameter</th>
<th>Default</th>
</tr>
<tr>
<tr>
<td>For Table A:<br>[[ATRPG parameter|ATRPG]],<br>[[FVFPG parameter|FVFPG]],<br>[[MVFPG parameter|MVFPG]]</td>
<td>For Table A:<br>[[ATRPG parameter|ATRPG]]<br>[[FVFPG parameter|FVFPG]]<br>[[MVFPG parameter|MVFPG]]</td>
<td>Default 1 each</td>
<td>&nbsp;<br>1<br>1<br>1</td>
</tr>
</tr>
<tr>
<tr>
<td>[[BSIZE parameter|BSIZE]]</td>
<td>[[BSIZE parameter|BSIZE]]</td>
<td>Default 5</td>
<td>5</td>
</tr>
</tr>
<tr>
<tr>
<td>[[CSIZE parameter|CSIZE]]</td>
<td>[[CSIZE parameter|CSIZE]]</td>
<td>Default 1</td>
<td>1</td>
</tr>
</tr>
<tr>
<tr>
<td>[[DSIZE parameter|DSIZE]]</td>
<td>[[DSIZE parameter|DSIZE]]</td>
<td>Default 15</td>
<td>15</td>
</tr>
</tr>
<tr>
<tr>
<td>[[ESIZE parameter|ESIZE]]</td>
<td>[[ESIZE parameter|ESIZE]]</td>
<td>Default 0</td>
<td>0</td>
</tr>
</tr>
<tr>
<tr>
<td>[[XSIZE parameter|XSIZE]]</td>
<td>[[XSIZE parameter|XSIZE]]</td>
<td>Default 0</td>
<td>0</td>
</tr>
</tr>
</table>
</table>
In the case of [[Table E (File architecture)|Table E]] and [[Table X (File architecture)|Table X]], the default is zero, and so, by default, Large Objects may not be used, nor will extension records be stored away from [[Table B (File architecture)|Table B]], unless these options are overridden.
<li><var>FORMAT</var> is the default and causes the <var>CREATE</var> command to physically format the disk space. <var>NOFORMAT</var> suppresses physical formatting and is recommended when the file being created is using the same physical space before and after the <var>CREATE</var>. For more information, refer to the [[CREATE command: File|CREATE command]].</li>
</ul>


the default values are used. In the case of Tables E and X, the default is zero, and so, by default, Large Objects may not be used, nor will extension records be stored away from Table B, unless these options are overridden.
<p>
<p>For sizing assistance, see [[ File Size Calculation#File Size Calculation|File Size Calculation]]. </p>
For sizing assistance, see [[File sizing introduction]]. </p>
 
<p>FORMAT is the default and causes the CREATE command to physically format the disk space. NOFORMAT suppresses physical formatting and is recommended when the file being created is using the same physical space before and after the CREATE. For more information, refer to the [[CREATE command: File|CREATE command]].</p>


==File parameters you can set at creation time==
==File parameters you can set at creation time==
<p>This section describes parameters that the file manager can set when creating a file. Most of these parameters can be reset later; some cannot, as described below. For a listing of all parameters set at file creation time, see [[ FPARMS and TABLES File Parameters#Overview|Overview]]. </p>
<p>
This section describes parameters that the file manager can set when creating a file. Most of these parameters can be reset later; some cannot, as described below. For a listing of all parameters set at file creation time, see [[FPARMS and TABLES file parameters]]. </p>
====Resettable FPARMS set by Model 204====
====Resettable FPARMS set by Model 204====
<p>The following parameter is set by <var class="product">Model&nbsp;204</var> and can be reset (with great care: see the [[FISTAT parameter]]) by the file manager:</p>
<p>
<table>
The <var>[[FISTAT parameter|FISTAT]]</var> parameter is set by <var class="product">Model&nbsp;204</var> and can be reset (with great care) by the file manager.</p>
<tr>
<td>[[FISTAT parameter|FISTAT]]</td>
</tr>
</table>
====Resettable FPARMS set during file creation====
====Resettable FPARMS set during file creation====
<p>The following parameters can be set during file creation and can be reset by the file manager:</p>
<p>
<table>
The following parameters can be set during file creation and can be reset by the file manager:</p>
<tr>
<ul>
<td>[[ADDLVL parameter|ADDLVL]]</td>
<li><var>[[ADDLVL parameter|ADDLVL]]</var></li>
<td>[[FILEMODL parameter|FILEMODL]]</td>
<li><var>[[FILEMODL parameter|FILEMODL]]</var></li>
<td>[[FOPT parameter|FOPT]]</td>
<li><var>[[FOPT parameter|FOPT]]</var></li>
<td>[[FRCVOPT parameter|FRCVOPT]]</td>
<li><var>[[FRCVOPT parameter|FRCVOPT]]</var></li>
</tr>
<li><var>[[OPENCTL parameter|OPENCTL]]</var></li>
<tr>
<li><var>[[PRCLDEF parameter|PRCLDEF]]</var></li>
<td>[[OPENCTL parameter||OPENCTL]]</td>
<li><var>[[PRIVDEF parameter|PRIVDEF]]</var></li>
<td>[[PRCLDEF parameter|PRCLDEF]]</td>
<li><var>[[READLVL parameter|READLVL]]</var></li>
<td>[[PRIVDEF parameter|PRIVDEF]]</td>
<li><var>[[SELLVL parameter|SELLVL]]</var></li>
<td>[[READLVL parameter|READLVL]]</td>
<li><var>[[UPDTLVL parameter|UPDTLVL]]</var></li>
</tr>
<li><var>[[VERIFY parameter|VERIFY]]</var> </li>
<tr>
</ul>
<td>[[SELLVL parameter|SELLVL]]</td>
<td>[[UPDTLVL parameter|UPDTLVL]]</td>
<td>[[VERIFY parameter|VERIFY]] </td>
</tr>
</table>
===Date-time stamp field===
===Date-time stamp field===
<p>If you have defined a [[Field Design (File Management)#An alternate approach to adding a date-time stamp field to your files|date-time stamp field]] to the file, you must enable the automatic update of this field by setting the FOPT parameter to include X'10'. </p>
<p>
If you have defined a [[Field design#An alternate approach to adding a date-time stamp field to your files|date-time stamp field]] to the file, you must enable the automatic update of this field by setting the <var>[[FOPT parameter|FOPT]]</var> parameter to include X'10'. </p>
===Non-resettable parameters===
===Non-resettable parameters===
<p>The following parameters are set at file creation and cannot be reset:</p>
<p>
The following parameters are set at file creation and cannot be reset:</p>
<ul>
<ul>
<li>[[FILEORG parameter|FILEORG]]: Specifies the file (Table B) organization type: Entry order, Unordered, Hash key, or Sorted. For a discussion of these files types, see [[ Planning Files#Summary of file organization types|Summary of file organization types]] and [[ Designing Files#File organization types|File organization types]].</li>
<li><var>[[FILEORG parameter|FILEORG]]</var>: Specifies the file (Table B) organization type: Entry order, Unordered, Hash key, or Sorted. For a discussion of these files types, see [[File design#Choosing a file_organization|Choosing a file organization type]].</li>
<li>[[LANGFILE parameter|LANGFILE]]: Specifies the language for file processing operations such as ordering of data and processing LIKE and LANGLIKE patterns, character storage, and uppercase or lowercase translation. The LANGFILE parameter determines the character set in a file. U.S. English is the default and is the only language supported for sorted files.</li>
 
<li>[[IVERIFY parameter|IVERIFY]]: Verifies that all file pages written out on disk during file initialization have been written accurately. Rocket Software recommends that you use the default value, N. The computer does its own verification of disk updates, so this option is no longer necessary and likely to cause overhead.</li>
<li><var>[[LANGFILE parameter|LANGFILE]]</var>: Specifies the language for file processing operations such as ordering of data and processing <var>LIKE</var> and <var>LANGLIKE</var> patterns, character storage, and uppercase or lowercase translation. The <var>LANGFILE</var> parameter determines the character set in a file. U.S. English is the default and is the only language supported for sorted files.</li>
 
<li><var>[[IVERIFY parameter|IVERIFY]]</var>: Verifies that all file pages written out on disk during file initialization have been written accurately. Rocket Software recommends that you use the default value, N. The computer does its own verification of disk updates, so this option is no longer necessary and likely to cause overhead.</li>
</ul>
</ul>
===Preventing field definition by users===
===Preventing field definition by users===
<p><var class="product">Model&nbsp;204</var> permits a user to define new fields at any time. If your site does not want users to add new field names, you can include the value of x'01' when setting / resetting the [[FOPT parameter]]. With that bit set, only users with File Manager privileges (see the [[PRIVDEF parameter]]) will be able to define new fields in a file. </p>
<p>
<var class="product">Model&nbsp;204</var> permits a user to define new fields at any time. If your site does not want users to add new field names, you can include the value of X'01' when setting / resetting the <var>[[FOPT parameter|FOPT]]</var> parameter. With that bit set, only users with File Manager privileges (see the <var>[[PRIVDEF parameter|PRIVDEF]])</var> parameter will be able to define new fields in a file. </p>


==Files with a single data set==
==Files with a single data set==
<p>Often <var class="product">Model&nbsp;204</var> files need only one data set. Samples of a job step that creates such a file from a preallocated data set for z/OS, z/VSE, and z/VM operating systems are illustrated in this section.</p>
<p>
<p>The CREATE command in the following examples specifies the file name of the <var class="product">Model&nbsp;204</var> file being created: PEOPLE. The PARAMETER settings set the various file parameters to the values that you calculated previously. There can be as many PARAMETER statements as necessary, and each can contain as many parameters in any order that fit on one input line (determined by the [[INCCC parameter|INCCC]] and [[INMRL parameter]]s.   </p>
Often <var class="product">Model&nbsp;204</var> files need only one data set. Samples of a job step that creates such a file from a preallocated data set for z/OS, z/VSE, and z/VM operating systems are illustrated in this section.</p>
<p>The parameters for the table sizes can be set to positive numbers at this time. If a file table size parameter is omitted in a CREATE FILE command, the [[#Default sizes|default value]] of the parameter is used. </p>
<p>
<p>Any unassigned pages left over in the data set are assigned to free space, which can be used later to expand Tables B, D, E or X(see [[ Managing File and Table Size Manually#Overview|Overview]]). </p>
The <var>CREATE</var> command in the following examples specifies the file name of the <var class="product">Model&nbsp;204</var> file being created: <code>PEOPLE</code>. The <var>PARAMETER</var> settings set the various file parameters to the values that you calculated previously. There can be as many <var>PARAMETER</var> statements as necessary, and each can contain as many parameters in any order that fit on one input line (determined by the <var>[[INCCC parameter|INCCC]]</var> and <var>[[INMRL parameter|INMRL]]</var> parameters. </p>
<p>The END statement indicates the end of both the PARAMETER statements and the CREATE command.     </p>
<p>
<p>CREATE builds the file parameter list (FPL), the first page of the file control table, and, for most devices, physically formats the entire data set. The file must then be opened and initialized using the [[OPEN FILE command|OPEN FILE]] and [[INITIALIZE command]]s. </p>
<p>Examples of using CREATE and specifying a single data set follow.</p>
The parameters for the table sizes can be set to positive numbers at this time. If a file table size parameter is omitted in a <var>CREATE FILE</var> command, the [[#Default sizes|default value]] of the parameter is used. </p>
<p>
Any unassigned pages left over in the data set are assigned to free space, which can be used later to expand Tables B, D, E or X (see [[Managing file and table sizes#Overview of capabilities|Overview of capabilities]]). </p>
<p>
The <var>END</var> statement indicates the end of both the <var>PARAMETER</var> statements and the <var>CREATE</var> command. </p>
<p>
<var>CREATE</var> builds the file parameter list (FPL), the first page of the file control table, and, for most devices, physically formats the entire data set. The file must then be opened and initialized using the <var>[[OPEN FILE command|OPEN FILE]]</var> and <var>[[INITIALIZE command|INITIALIZE]]</var> commands. </p>
<p>
Examples of using <var>CREATE</var> and specifying a single data set follow.</p>
====z/OS example====
====z/OS example====
<p class="code">// JOB CREATE PEOPLE FILE
<p class="code">// JOB CREATE PEOPLE FILE
// EXEC...                    (Include here the basic JCL or
// EXEC...                    (Include here the basic JCL or
                               cataloged procedure invocation  
                               cataloged procedure invocation
                               provided by the Model 204 system
                               provided by the Model 204 system
                               manager to run BATCH204.)
                               manager to run BATCH204.)
 
//PEOPLE  DD  DSN=M204.FILE.PEOPLE,DISP=SHR
//PEOPLE  DD  DSN=M204.FILE.PEOPLE,DISP=SHR
//CCAIN    DD  *
//CCAIN    DD  *
Line 129: Line 169:
CLOSE PEOPLE
CLOSE PEOPLE
EOJ
EOJ
/*  
/*
</p>
</p>
====z/VSE example====
====z/VSE example====
<p class="code">// JOB CREATE PEOPLE FILE
<p class="code">// JOB CREATE PEOPLE FILE
// DLBL PEOPLE,'M204.FILE PEOPLE',,DA
// DLBL PEOPLE,'M204.FILE PEOPLE',,DA
// EXTENT SYSnnn,volser
// EXTENT SYSnnn,volser
 
// EXEC BATCH204,SIZE=AUTO
// EXEC BATCH204,SIZE=AUTO
PAGESZ=6184, MAXBUF=20
PAGESZ=6184, MAXBUF=20
Line 151: Line 192:
/&amp;
/&amp;
</p>
</p>
====z/VM example====
====z/VM example====
<p>In z/VM, using the FILEDEF command to assign and define files is equivalent to the DD DSN assignment in z/OS and the DLBL and EXTENT with the DEFINE DATASET command in z/VSE.</p>
<p>In z/VM, using the <var>FILEDEF</var> command to assign and define files is equivalent to the DD DSN assignment in z/OS and the DLBL and EXTENT with the DEFINE DATASET command in z/VSE.</p>
<p class="code">&amp;CONTROL OFF
<p class="code">&amp;CONTROL OFF
FILEDEF * CLEAR
FILEDEF * CLEAR
 
FILEDEF CCAPRINT DISK PEOPLE CCAPRINT A
FILEDEF CCAPRINT DISK PEOPLE CCAPRINT A
FILEDEF CCASNAP PRINTER
FILEDEF CCASNAP PRINTER
Line 162: Line 204:
FILEDEF PEOPLE M DSN M204 FILE PEOPLE
FILEDEF PEOPLE M DSN M204 FILE PEOPLE
FILEDEF CCAIN DISK PEOPLE CCAIN A
FILEDEF CCAIN DISK PEOPLE CCAIN A
 
 
&amp;STACK SYSOPT 128 LIBUFF 255
&amp;STACK SYSOPT 128 LIBUFF 255
</p>
</p>
Line 176: Line 218:
EOJ
EOJ
</p>
</p>
==Files with several data sets==
==Files with several data sets==
<p>If the file requires more than one data set, a data set definition statement for each must be included. </p>
<p>
<p>Examples of using CREATE and specifying multiple data sets follow.</p>
If the file requires more than one data set, a data set definition statement for each must be included. </p>
<p>
Examples of using <var>CREATE</var> and specifying multiple data sets follow.</p>
====z/OS====
====z/OS====
<p class="code">//PEOPLE  DD  DSN=M204.FILE.PEOPLE,DISP=SHR
<p class="code">//PEOPLE  DD  DSN=M204.FILE.PEOPLE,DISP=SHR
Line 184: Line 230:
//PEOPLE3  DD  DSN=M204.FILE.PEOPLE3,DISP=SHR
//PEOPLE3  DD  DSN=M204.FILE.PEOPLE3,DISP=SHR
</p>
</p>
====z/VSE====
====z/VSE====
<p class="code">// DLBL PEOPLE,'M204.FILE.PEOPLE',,DA
<p class="code">// DLBL PEOPLE,'M204.FILE.PEOPLE',,DA
Line 192: Line 239:
// EXTENT SYSnnn,volser
// EXTENT SYSnnn,volser
</p>
</p>
====z/VM====
====z/VM====
<p class="code">FILEDEF PEOPLE  M DSN M204 FILE PEOPLE
<p class="code">FILEDEF PEOPLE  M DSN M204 FILE PEOPLE
Line 197: Line 245:
FILEDEF PEOPLE3 M DSN M204 FILE PEOPLE3
FILEDEF PEOPLE3 M DSN M204 FILE PEOPLE3
</p>
</p>
===Requirements===
===Requirements===
<p>Data set names cannot start with SYS, CCA, OUT, or TAPE. z/VSE data set names must be seven or fewer characters. Otherwise, there are no other naming restrictions.</p>
<p>
<p>An example of the CREATE command with multiple data sets follows:</p>
Data set names cannot start with SYS, CCA, OUT, or TAPE. z/VSE data set names must be seven or fewer characters. Otherwise, there are no other naming restrictions.</p>
<p>
An example of the <var>CREATE</var> command with multiple data sets follows:</p>
<p class="code">CREATE FILE PEOPLE FROM PEOPLE, PEOPLE2, PEOPLE3
<p class="code">CREATE FILE PEOPLE FROM PEOPLE, PEOPLE2, PEOPLE3
</p>
</p>
<p>If you need to list more data sets than fit on a single input line, use the continuation character (-) to continue the data set listing onto the following line.</p>
<p>
<p>Also include PARAMETER statements as described for a single data set in the previous section.</p>
If you need to list more data sets than fit on a single input line, use the continuation character (<tt>-</tt>) to continue the data set listing onto the following line.</p>
<p>When several data sets are used, the first data set, which has the same data set name as the file name, contains the first page of the File Control Table, which in turn contains the data set names of all the other data sets in the file. All <var class="product">Model&nbsp;204</var> runs that use the file must have all the data set definition statements present in the job control statements.</p>
<p>
<p>Pages are allocated to data sets in the following order:</p>
Also include <var>PARAMETER</var> statements as described for a single data set in the previous section.</p>
<p>
When several data sets are used, the first data set, which has the same data set name as the file name, contains the first page of the File Control Table, which in turn contains the data set names of all the other data sets in the file. All <var class="product">Model&nbsp;204</var> runs that use the file must have all the data set definition statements present in the job control statements.</p>
<p>
Pages are allocated to data sets in the following order:</p>
<ul>
<ul>
<li>FCT</li>
<li>FCT</li>
Line 216: Line 271:
<li>Free space</li>
<li>Free space</li>
</ul>
</ul>
<p>When one data set fills, the next page is allocated to the next data set specified by the CREATE command. Table boundaries and data set boundaries need not coincide. </p>
<p>
When one data set fills, the next page is allocated to the next data set specified by the <var>CREATE</var> command. Table boundaries and data set boundaries need not coincide. </p>
 
==File security==
==File security==
<p>When you first create a file with the CREATE command, or after the file is created, you can limit access to the file by setting two system parameters, OPENCTL and PRIVDEF. You can also ask the system manager to enter one or more file passwords in the password table. For more information, see <b>See [[OPENCTL parameter|OPENCTL]]</b>, <b>See [[PRIVDEF parameter|PRIVDEF]] and file privileges</b>, and <b>See [[LOGCTL command|File passwords and privileges]]</b>.</p>
<p>
 
When you first create a file with the <var>CREATE</var> command, or after the file is created, you can limit access to the file by setting two system parameters, <var>OPENCTL</var> and <var>PRIVDEF</var>. You can also ask the system manager to enter one or more file passwords in the password table. For more information, see <var>[[OPENCTL parameter|OPENCTL]]</var>, <var>[[PRIVDEF parameter|PRIVDEF]]</var> and file privileges, and file passwords and privileges.</p>
==File initialization==
==File initialization==
<p>As shown in the sample jobs above, before you can use a newly created file, you will need to open and initialize it. Until you initialize the file, you do not have access to it; that is, you cannot define fields, store procedures, or perform any other file-level functions. If you try to use an uninitialized file, you might be logged out and softly restarted. For information about initializing files, see the [[INITIALIZE command]] or [[ Initializing Files#Initializing Files|Initializing Files]].</p>
<p>
 
As shown in the sample jobs above, before you can use a newly created file, you will need to open and initialize it. Until you initialize the file, you do not have access to it; that is, you cannot define fields, store procedures, or perform any other file-level functions. If you try to use an uninitialized file, you might be logged out and softly restarted. For information about initializing files, see the [[INITIALIZE command]] or [[Initializing files]].</p>
 
[[Category:File management]]
[[Category:Model 204 files]]

Latest revision as of 20:26, 26 September 2016

Overview

After you have determined the space requirements for your file, and the data you expect it to contain, you can set the file parameters and build the File Control Table (FCT) with the CREATE command.

This topic provides an overview of the CREATE command and its parameters, but for the full description the above link should be followed.

For information about creating a file using FILEMGMT (Dictionary/204 File Management Subsystem facility), see File creation overview.
For information about creating groups of files, see Managing file groups.

CREATE command

The two variations of the CREATE command can create either files and groups (either permanent or temporary. Any user can create a temporary group; only the system manager can create a permanent group.

Syntax

The format of the CREATE command to create a file is:

CREATE [FILE] [(FORMAT) | (NOFORMAT)] filename [FROM ddname [,ddname ...]] [PARAMETER parameter=value [,parameter=value ...] ] [PARAMETER parameter=value [,parameter=value... ] ] ... END

where:

  • filename is the name of the Model 204 file that you are creating. The name can be up to 8 characters long (7 for DOS systems). The filename cannot be FILE or GROUP and cannot start with CCA (except for CCASYS), SYS, OUT, TAPE, or a number. It can contain only uppercase letters, numbers, and the following special characters:

    At sign (@) Pound sign (#) Dollar sign ($) (alternately displayed as £)

    The file name by which users refer to the Model 204 file is simply the ddname of the first (or only) data set in the file. The CREATE command establishes the file name and the ddnames to be used thereafter for all data sets in the file. The filename and ddnames can be changed only by recreating the file or by issuing the Model 204 DUMP and RESTORE commands (see File dumping and restoring).

  • ddname is the name of a data set from which to create the file; it is required when the file is being created from more than one data set. The first ddname specified must match the filename.
  • parameter = value specifies Model 204 file parameters. Any number of PARAMETER statements can immediately follow the command, and each statement can contain as many parameters in any order as fit on one input line. A list of parameters must be concluded by an END statement. File parameters are optional.

    If no values are specified for any of the following parameters that are used in calculating table sizes, the default values shown here are used:

    Parameter Default
    For Table A:
    ATRPG
    FVFPG
    MVFPG
     
    1
    1
    1
    BSIZE 5
    CSIZE 1
    DSIZE 15
    ESIZE 0
    XSIZE 0

    In the case of Table E and Table X, the default is zero, and so, by default, Large Objects may not be used, nor will extension records be stored away from Table B, unless these options are overridden.

  • FORMAT is the default and causes the CREATE command to physically format the disk space. NOFORMAT suppresses physical formatting and is recommended when the file being created is using the same physical space before and after the CREATE. For more information, refer to the CREATE command.

For sizing assistance, see File sizing introduction.

File parameters you can set at creation time

This section describes parameters that the file manager can set when creating a file. Most of these parameters can be reset later; some cannot, as described below. For a listing of all parameters set at file creation time, see FPARMS and TABLES file parameters.

Resettable FPARMS set by Model 204

The FISTAT parameter is set by Model 204 and can be reset (with great care) by the file manager.

Resettable FPARMS set during file creation

The following parameters can be set during file creation and can be reset by the file manager:

Date-time stamp field

If you have defined a date-time stamp field to the file, you must enable the automatic update of this field by setting the FOPT parameter to include X'10'.

Non-resettable parameters

The following parameters are set at file creation and cannot be reset:

  • FILEORG: Specifies the file (Table B) organization type: Entry order, Unordered, Hash key, or Sorted. For a discussion of these files types, see Choosing a file organization type.
  • LANGFILE: Specifies the language for file processing operations such as ordering of data and processing LIKE and LANGLIKE patterns, character storage, and uppercase or lowercase translation. The LANGFILE parameter determines the character set in a file. U.S. English is the default and is the only language supported for sorted files.
  • IVERIFY: Verifies that all file pages written out on disk during file initialization have been written accurately. Rocket Software recommends that you use the default value, N. The computer does its own verification of disk updates, so this option is no longer necessary and likely to cause overhead.

Preventing field definition by users

Model 204 permits a user to define new fields at any time. If your site does not want users to add new field names, you can include the value of X'01' when setting / resetting the FOPT parameter. With that bit set, only users with File Manager privileges (see the PRIVDEF) parameter will be able to define new fields in a file.

Files with a single data set

Often Model 204 files need only one data set. Samples of a job step that creates such a file from a preallocated data set for z/OS, z/VSE, and z/VM operating systems are illustrated in this section.

The CREATE command in the following examples specifies the file name of the Model 204 file being created: PEOPLE. The PARAMETER settings set the various file parameters to the values that you calculated previously. There can be as many PARAMETER statements as necessary, and each can contain as many parameters in any order that fit on one input line (determined by the INCCC and INMRL parameters.

The parameters for the table sizes can be set to positive numbers at this time. If a file table size parameter is omitted in a CREATE FILE command, the default value of the parameter is used.

Any unassigned pages left over in the data set are assigned to free space, which can be used later to expand Tables B, D, E or X (see Overview of capabilities).

The END statement indicates the end of both the PARAMETER statements and the CREATE command.

CREATE builds the file parameter list (FPL), the first page of the file control table, and, for most devices, physically formats the entire data set. The file must then be opened and initialized using the OPEN FILE and INITIALIZE commands.

Examples of using CREATE and specifying a single data set follow.

z/OS example

// JOB CREATE PEOPLE FILE // EXEC... (Include here the basic JCL or cataloged procedure invocation provided by the Model 204 system manager to run BATCH204.) //PEOPLE DD DSN=M204.FILE.PEOPLE,DISP=SHR //CCAIN DD * PAGESZ=6184, MAXBUF=20 CREATE FILE PEOPLE PARAMETER ASTRPPG=345, ATRPG=2, FVFPG=3 PARAMETER MVFPG=10, BRECPPG=23 PARAMETER BSIZE=704, BRESERVE=268 PARAMETER CSIZE=78, DSIZE=470 END OPEN PEOPLE INITIALIZE CLOSE PEOPLE EOJ /*

z/VSE example

// JOB CREATE PEOPLE FILE // DLBL PEOPLE,'M204.FILE PEOPLE',,DA // EXTENT SYSnnn,volser // EXEC BATCH204,SIZE=AUTO PAGESZ=6184, MAXBUF=20 CREATE FILE PEOPLE PARAMETER ASTRPPG=345, ATRPG=2, FVFPG=3 PARAMETER MVFPG=10, BRECPPG=23 PARAMETER BSIZE=704, BRESERVE=268 PARAMETER CSIZE=78, DSIZE=470 END OPEN PEOPLE INITIALIZE CLOSE PEOPLE EOJ /* /&

z/VM example

In z/VM, using the FILEDEF command to assign and define files is equivalent to the DD DSN assignment in z/OS and the DLBL and EXTENT with the DEFINE DATASET command in z/VSE.

&CONTROL OFF FILEDEF * CLEAR FILEDEF CCAPRINT DISK PEOPLE CCAPRINT A FILEDEF CCASNAP PRINTER FILEDEF CCATEMP M DSN WORK CCATEMP FILEDEF CCAAUDIT DISK PEOPLE CCAAUDIT A FILEDEF PEOPLE M DSN M204 FILE PEOPLE FILEDEF CCAIN DISK PEOPLE CCAIN A &STACK SYSOPT 128 LIBUFF 255

where the CCAIN input in file PEOPLE CCAIN A is:

CREATE FILE PEOPLE PARAMETER ASTRPPG=345,ATRPG=2,FVFPG=3 PARAMETER MVFPG=10,BRECPPG=23,BSIZE=704 PARAMETER BRESERVE=268,CSIZE=78,DSIZE=470 END OPEN PEOPLE INITIALIZE EOJ

Files with several data sets

If the file requires more than one data set, a data set definition statement for each must be included.

Examples of using CREATE and specifying multiple data sets follow.

z/OS

//PEOPLE DD DSN=M204.FILE.PEOPLE,DISP=SHR //PEOPLE2 DD DSN=M204.FILE.PEOPLE2,DISP=SHR //PEOPLE3 DD DSN=M204.FILE.PEOPLE3,DISP=SHR

z/VSE

// DLBL PEOPLE,'M204.FILE.PEOPLE',,DA // EXTENT SYSnnn,volser // DLBL PEOPLE2.'M204.FILE.PEOPLE2',,DA // EXTENT SYSnnn,volser // DLBL PEOPLE3,'M204.FILE.PEOPLE3',,DA // EXTENT SYSnnn,volser

z/VM

FILEDEF PEOPLE M DSN M204 FILE PEOPLE FILEDEF PEOPLE2 M DSN M204 FILE PEOPLE2 FILEDEF PEOPLE3 M DSN M204 FILE PEOPLE3

Requirements

Data set names cannot start with SYS, CCA, OUT, or TAPE. z/VSE data set names must be seven or fewer characters. Otherwise, there are no other naming restrictions.

An example of the CREATE command with multiple data sets follows:

CREATE FILE PEOPLE FROM PEOPLE, PEOPLE2, PEOPLE3

If you need to list more data sets than fit on a single input line, use the continuation character (-) to continue the data set listing onto the following line.

Also include PARAMETER statements as described for a single data set in the previous section.

When several data sets are used, the first data set, which has the same data set name as the file name, contains the first page of the File Control Table, which in turn contains the data set names of all the other data sets in the file. All Model 204 runs that use the file must have all the data set definition statements present in the job control statements.

Pages are allocated to data sets in the following order:

  • FCT
  • Table A
  • Table B
  • Table C
  • Table D
  • Table E
  • Table X
  • Free space

When one data set fills, the next page is allocated to the next data set specified by the CREATE command. Table boundaries and data set boundaries need not coincide.

File security

When you first create a file with the CREATE command, or after the file is created, you can limit access to the file by setting two system parameters, OPENCTL and PRIVDEF. You can also ask the system manager to enter one or more file passwords in the password table. For more information, see OPENCTL, PRIVDEF and file privileges, and file passwords and privileges.

File initialization

As shown in the sample jobs above, before you can use a newly created file, you will need to open and initialize it. Until you initialize the file, you do not have access to it; that is, you cannot define fields, store procedures, or perform any other file-level functions. If you try to use an uninitialized file, you might be logged out and softly restarted. For information about initializing files, see the INITIALIZE command or Initializing files.