Creating a file

From m204wiki
Revision as of 22:55, 11 December 2013 by ELowell (talk | contribs)
Jump to navigation Jump to search

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 on 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.

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.

If no values are specified for any of the parameters which are used in calculating table sizes:

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

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 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 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 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).

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.