Creating a file
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 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.
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.
The format of the CREATE command to create a file is:
Syntax
CREATE [FILE] [(FORMAT) | (NOFORMAT)] filename [FROM ddname [,ddname ...]] [PARAMETER parameter=value [,parameter=value ...] | PARAMETER parameter=value [,parameter=value... ] ]
where:
filename is the name of the Model 204 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:
At sign (@) Pound sign (#) Dollar sign ($)
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. For a list of parameters that you can set at file creation time, see
If no values are specified for any of the parameters which are used in calculating table sizes:
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.
For sizing assistance, see File Size Calculation .
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 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 Overview.
Resettable FPARMS set by Model 204
The following parameter is set by Model 204 and can be reset (with great care: see the FILESTAT parameter) by the file manager:
FISTAT |
Resettable FPARMS set during file creation
The following parameters can be set during file creation and can be reset by the file manager:
ADDLVL | PRCLDEF |
FILEMODL | PRIVDEF |
FOPT | READLVL |
FRCVOPT | SELLVL |
|OPENCTL | UPDTLVL |
VERIFY |
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 Summary of file organization types and File organization types.
- 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 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 Preventing definition of new field names.
Files with a single data set
Most 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 described in the Rocket Model 204 Terminal User's Guide).
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.
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 Overview).
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 and INITIALIZE commands. See Initializing Files Manually for information about the INITIALIZE command.
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 or volume, 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
- 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 See OPENCTL parameter, See PRIVDEF parameter and file privileges, and See File passwords and privileges.
File groups
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.
For more information, see File groups and the Rocket Model 204 System Manager's Guide.
CREATE GROUP command
File groups are created using the CREATE GROUP command. The types of groups are:
Type of group | Created... |
---|---|
Permanent |
By the system manager using the CREATE command. User access is determined by the privileges defined for the file group. Use the following syntax to create a permanent group: CREATE PERM GROUP groupname FROM {filename [AT location] [(OPTIONAL) | (MANDATORY)]} ,... [PARAMETER parameter[=value] [PARAMETER parameter[=value]]... . . . END For information about creating permanent groups, see the Rocket Model 204 Parameter and Command Reference. |
Temporary |
By an individual user with the CREATE command and can be referenced only by that user. 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. Use the following syntax to create a temporary group: CREATE [TEMP] GROUP groupname FROM filename [,filename ...][PARAMETER parameter_list] . . . END The parameters available for temporary file groups are discussed in the Rocket Model 204 Parameter and Command Reference. |
Ad hoc |
Within a User Language request by prefacing a statement with the clause: IN file1, file2 [,file3 ...] 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 Rocket Model 204 User Language Manual. |
File initialization
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.