Creating a file: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(53 intermediate revisions by 8 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 chapter provides an overview of the CREATE command (as well as a brief discussion of File Groups) 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>
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. For a list of parameters that you can set at file creation time, see </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 the BSIZE, CSIZE, and DSIZE parameters, the default values are used. However, you can calculate and set values for parameters as described in [[ File Size Calculation#File Size Calculation|File Size Calculation]] . </p>
 
<p>FORMAT is the default and causes the CREATE command to physically format the disk space. NOFORMAT suppresses physical formatting. For more information, refer to the <var>Rocket Model&nbsp;204 Parameter and Command Reference</var>.</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>
==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]], [[#Creating Files Manually|Creating Files Manually]].</p>
<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.  
====Resettable FPARMS set by Model 204====
<p>
<p>The following parameter is set by <var class="product">Model&nbsp;204</var> and can be reset by the file manager:</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>
<table>
<table>
<tr>
<tr class="head">
<td>FISTAT  </td>
<th>Parameter</th>
<th>Default</th>
</tr>
</tr>
</table>
 
====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>
<table>
<tr>
<tr>
<td>ADDLVL</td>
<td>For Table A:<br>[[ATRPG parameter|ATRPG]]<br>[[FVFPG parameter|FVFPG]]<br>[[MVFPG parameter|MVFPG]]</td>
<td>PRCLDEF</td>
<td>&nbsp;<br>1<br>1<br>1</td>
</tr>
</tr>
<tr>
<tr>
<td>FILEMODL</td>
<td>[[BSIZE parameter|BSIZE]]</td>
<td>PRIVDEF</td>
<td>5</td>
</tr>
</tr>
<tr>
<tr>
<td>FOPT</td>
<td>[[CSIZE parameter|CSIZE]]</td>
<td>READLVL</td>
<td>1</td>
</tr>
</tr>
<tr>
<tr>
<td>FRCVOPT</td>
<td>[[DSIZE parameter|DSIZE]]</td>
<td>SELLVL</td>
<td>15</td>
</tr>
</tr>
<tr>
<tr>
<td>OPENCTL</td>
<td>[[ESIZE parameter|ESIZE]]</td>
<td>UPDTLVL</td>
<td>0</td>
</tr>
</tr>
<tr>
<tr>
<td>&nbsp;</td>
<td>[[XSIZE parameter|XSIZE]]</td>
<td>VERIFY </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>
<p>
For sizing assistance, see [[File sizing introduction]]. </p>
==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]]. </p>
====Resettable FPARMS set by Model 204====
<p>
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>
====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>
<ul>
<li><var>[[ADDLVL parameter|ADDLVL]]</var></li>
<li><var>[[FILEMODL parameter|FILEMODL]]</var></li>
<li><var>[[FOPT parameter|FOPT]]</var></li>
<li><var>[[FRCVOPT parameter|FRCVOPT]]</var></li>
<li><var>[[OPENCTL parameter|OPENCTL]]</var></li>
<li><var>[[PRCLDEF parameter|PRCLDEF]]</var></li>
<li><var>[[PRIVDEF parameter|PRIVDEF]]</var></li>
<li><var>[[READLVL parameter|READLVL]]</var></li>
<li><var>[[SELLVL parameter|SELLVL]]</var></li>
<li><var>[[UPDTLVL parameter|UPDTLVL]]</var></li>
<li><var>[[VERIFY parameter|VERIFY]]</var> </li>
</ul>
===Date-time stamp field===
===Date-time stamp field===
<p>If you have defined a date-time stamp field to the file, you can enable the date-time stamp field by setting the FOPT parameter to include X'10'. For more information, see [[ Defining Fields Manually#Defining Fields Manually|Defining Fields Manually]] .</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: 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: 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: 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 reset the FOPT parameter to X'01' from its default value of X'00'. Then only users with File Manager privileges will be able to define new fields in a file. For more information, see [[ Defining Fields Manually#Preventing definition of new field names|Preventing definition of new field names]].</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>Most <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 and INMRL parameters described in the Rocket <var class="product">Model&nbsp;204</var> Terminal User's Guide).   </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 BSIZE, CSIZE, and DSIZE can be set to positive numbers at this time. Their respective defaults are 5, 1, and 15. If a file table size parameter is omitted in a CREATE FILE command, the default value of the parameter is used. The ASIZE parameter (default=3) is never set by the user. It is the sum of the three parameters ATRPG, MVFPG, and FVFPG. Each of these has a default value of 1. </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 or D (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 and INITIALIZE commands. See [[ Initializing Files Manually#Initializing Files Manually|Initializing Files Manually]] for information about the INITIALIZE command.   </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 102: 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 124: 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 135: 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 149: 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 or volume, 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 157: 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 165: 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 170: 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 186: Line 268:
<li>Table D</li>
<li>Table D</li>
<li>Table E</li>
<li>Table E</li>
<li>Table X</li>
<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</b>, <b>See PRIVDEF parameter and file privileges</b>, and <b>See File passwords and privileges</b>.</p>
<p>
==File groups==
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>
<p>A file group treats physically separate files as one logical file. File groups cannot be created with the FILEMGMT subsystem facility. To create a file group, you must manually enter input for the CREATE GROUP command.</p>
   
<p>For more information, see [[ Designing Files#File groups|File groups]] and the Rocket <var class="product">Model&nbsp;204</var> System Manager's Guide.</p>
===CREATE GROUP command===
<p>File groups are created using the CREATE GROUP command. The types of groups are:</p>
<table>
<tr class="head">
<th>Type of group</th>
<th>Created...</th>
</tr>
<tr>
<td>Permanent </td>
<td>
<p>By the system manager using the CREATE command.</p>
<p>User access is determined by the privileges defined for the file group.</p>
<p>Use the following syntax to create a permanent group: </p>
<p class="code">CREATE  PERM  GROUP  groupname
 
FROM  {filename  [AT location] [(OPTIONAL)  | (MANDATORY)]}  ,... [PARAMETER  parameter[=value] [PARAMETER  parameter[=value]]...
 
.
 
.
 
.
 
END
</p>
<p>For information about creating permanent groups, see the Rocket <var class="product">Model&nbsp;204</var> Parameter and Command Reference. </p>
</td>
</tr>
<tr>
<td>Temporary</td>
<td>
<p>By an individual user with the CREATE command and can be referenced only by that user. </p>
<p>Temporary group names exist only during the current login session and are deleted automatically when you log out, unless you delete them during the session.   </p>
<p>Use the following syntax to create a temporary group:</p>
<p class="code">CREATE [TEMP] GROUP groupname FROM filename
  [,filename ...][PARAMETER parameter_list]
.   
.
  .
END
</p>
<p>The parameters available for temporary file groups are discussed in the Rocket <var class="product">Model&nbsp;204</var> Parameter and Command Reference.</p>
</td>
</tr>
<tr>
<td>Ad hoc</td>
<td>
<p>Within a User Language request by prefacing a statement with the clause: </p>
<p class="code">IN <var class="term">file1</var>, <var class="term">file2</var> [,<var class="term">file3</var> ...] 
</p>
<p>Ad hoc groups have no name and exist only for the current request. They allow record retrieval from many files at once without defining a group in advance. As in any IN clause, all of the files in an ad hoc group must be opened before the group is mentioned. For more information, see the description of Ad hoc groups in the <var>Rocket Model&nbsp;204 User Language Manual</var>.</p>
</td>
</tr>
</table>
 
==File initialization==
==File initialization==
<p>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 [[ Initializing Files Manually#Initializing Files Manually|Initializing Files Manually]].</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 architecture and management]]
[[Category:Model 204 files]]
[[Category:File management]]

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.