• Keine Ergebnisse gefunden

Creating Disk and Diskette Files

Im Dokument IBM System/32 (Seite 133-136)

The CATALOG procedure (see index entry: CATALOG procedure) can be used to determine how much space is available on the disk and where available space is.

Space to be allocated to a file must be contained in a single continuous area on the disk. If enough space is available for a file but is not contained in

a

single; contin~ous

area (for example, part of the available spaCe is at one location on the disk and the rest ot'the space is at another location), you can use the COMPRESS procedure (see index entry: COMPRESS procedure) to collect all available space into one area at the high end of the disk. The $FREE (disk reorganization utility) program can also be used to move all data files to the high end of the disk, thus, collecting aU available space into one area at the low end of the disk (between the library and the data files).

If the space required by a file is not available on the disk, you can do one of the following:

• Use the CATALOG procedure to see which files are currently on the disk and use the DE~ETE prqcedure (~~e in<:te,!JUl~ry.; DELEIEprocedllre) to delete any unneeded files, thereby making disk space available for new files.

• Use the SAvE procedure (see index entry: SAVE procedure) to copy from the disk to diskette(s) one or more files that are not needed for the next job. Then, to make space available for new files, use the DELETE procedure to delete the original files. When they are needed, you can return the copied files from disk-ette(s) to the disk by using the RESTORE procedure (see index entry: RESTORE procedure) .

Note: After you delete the original files from the disk, the diskette(s) contain the master copies. You can use the COPYI1 procedure (see index entry: COPYI1 pro-cedure) to create a backup copy of the files you moved to diskette(s).

Describing a File

Use a FILE statement to describe a file to the SCP (see index entry:

II

FILE

state-ment).

The NAME parameter of the FILE statement must identify the file to the program creating the file. The LABEL parameter assigns a name for user identifica-tion of the file on the disk, regardless of the name a pro.gram uses to refer to the file. If the LABEL parameter is omitted from a FILE statement, the name specified by the NAM

E

parameter identifies the file on the disk. Assign names that are re-lated to file contents or to application programs using the files, to make the files easy to identify by programmers and operators.

112

Either the RECORDS or BLOCKS parameter must be used 'to define the size of a file, put both parameters cannot be specified for one file. If R ECOR DS is specif.ied

the system calculates the number of blocks required to contain the file (see Appendix A). !f BLOCKS is used, the system reserves the number of blocks SPecified. FOi ~n indexed file the number of blocks specified is apportioned between index areas and data areas.

Note: If RECORDS is specified, the number of records actually allocated may be larger than the number requested. The system allocates disk space in blocks and always rounds up to the next whole block if part of a block is required.

The LOCATION parameter specifies the block location where the file will begin. If LOCATION is not used, the system places the file as close to the library as possible.

The R ETAI N parameter classifies a file according to its retention status. Permanent files (RETAIN-P) remain on the disk until you delete them by using the DELETE procedure (or $DELET utility pr~g~am-see index entry: $DELET utility program).

A classification of RETAIN-P protects a file from being deleted accidentally.

Temporary files (RETAIN~T) are usually used more than once. You can free the space used by a temporary file at any time by changing its classification to

RETAIN-S, which identifies the file as a scratch file. Scratch files do not exist after the job in which they are created ends.

Three disk work files called $WORK, $WORK2, and $SOURCE are created auto-matically by the System/32 SCP for programs that require this work space. These files ar,e scratch files (with a file size of 24 blocks each), used by source programs to generate an object program. If you need to change the tHe size, or if you want to create the files yourself, you can enter three FI LE statements, one for $WORK, one for $WORK2, and one for $SOURCE, with the RECORDS or BLOCKS parameter to define the file size. You can determine if your program needs space allocated for the disk work files by looking at the library directory entry. A field (ATTR IBUTES) contains two bytes of attributes; the first byte has bit 4 on (set to 1) if a program requires that $WORK and $SOURCE be allocated; the second byte has bit 3 on (set to 1) if a program requires that $WORK2 be allocated. (See index entry: library directory entry for a description of the information contained in library directory entries.)

The disk VTOC can contain up to 200 permanent or temporary files at anyone time (199 user files plus ,the system file #LlBRARY). You can use the CATALOG procedure to determine the number of permanent and temporary files currently on the disk. (For more information, see index entry: CA TALOG procedure.)

DISKETTE FI LE

You must use a FI LE statement to describe each diskette file you want created. The FILE statement for diskette files is described in detail under index entry: II FILE statement. Diskette files are created by IBM system utility programs, described in Part 4, or by offline multivolume file processing. Diskette files created by system utility programs cannot be processed as offline multivolume files, and offline multi-volume files cannot be processed by the system utility programs except by $DUPRD.

The following paragraphs concern using the utility prograrns to create and_proce~s..

diskette files. For a discussion of offline multivolume file processing, see Offline Multivolume File which follows.

Im Dokument IBM System/32 (Seite 133-136)