 |
» |
|
|
 |
Introduction |  |
You have had a brief introduction to different types of files:
permanent, temporary, and formal. In lesson 2, you will learn how
to use the BUILD command and the following options to create customized files: The BUILD command is useful when you need to change the file's format so that another
program or subsystem can accept the format. For example, using the editor, you can only display and edit files
that contain data in a particular format. If you "inherit"
a file from another system, it may not be in the correct format.
For example, suppose that you enter the command: This command generates a temporary file called LISTFILE. The > causes MPE/iX to put the display from this command into a temporary file.  |  |  |  |  | NOTE: If you
try to edit LISTFILE you will find that the editor truncates some of the lines if they are too long for the editor. For many temporary text files, this presents no problem. If you suspect that truncation will cause a problem, then change the file format
by building a new file with the appropriate format. Copy the temporary file into the new file. Then edit the new file. Your original temporary file keeps its format while you edit the copy. |  |  |  |  |
The BUILD command allows you to specify the "shape" of a file that as yet contains no information. Using BUILD is much like creating a container into which liquid will be poured; the contents will conform to the dimensions of the container. In the BUILD situation, data will conform to the characteristics of the empty file created by the BUILD command. The following illustration shows how the data in a file will take on the characteristics of its "container." Generally speaking, as a general user, you are not so much concerned with the characteristics of a file, as with the data in it. Usually,
the subsystem that you are using (for example, some editor) automatically
creates files with the appropriate characteristics that determine
how the contents are stored on disk. As you become a more experienced
user, you may become concerned with how to make programs run
most efficiently by defining a file's characteristics more precisely. Although you cannot alter the physical characteristics of an existing
file, you can create a new file with the desired characteristics
(using BUILD) and then copy the contents of the existing file into the new one (using FCOPY). The new file contents then have the appropriate characteristics. The FCOPY command is
covered in module 4, File Transfer. Lockword |  |
You've already worked with passwords at the account, group, and user
level. MPE/iX provides a further level of security, lockwords. These are file "passwords," which restrict access to a particular file.
This means that even if you know the account, group, and user passwords,
you will not be able to access a particular file unless you know the
lockword. When using the BUILD or RENAME command, use a
forward slash (/) to delimit the lockword. The slash is not part
of the lockword.  |  |  |  |  | NOTE: A user with SM capability can use LISTFILE,3 with the ;PASS option to
display the lockword. |  |  |  |  |
For example, suppose you build a file called SECRETS: Whenever you try to view SECRETS, you must also specify the lockword, KEY. For example, suppose that you accidentally type: You may think you have a file called MYFILE; however, the system
interprets a file called MY with a lockword of FILE. Record size |  |
Record size refers to the number of bytes or words per record. Record
size is important because certain applications can read only records
of a certain size. You may find that if a file has records of a
different size, you will not be able to display or edit that file. This record size may vary according to the utility or program
that created the file. For example, a file created
with the editor will have a different record size than one created by LISTFILE > filelist. A positive record size indicates the number of two-byte words
in the record. A negative record size indicates the number of bytes in the record. File data type |  |
Text files that you can view and edit tend to be ASCII.
Executable program files and graphics files tend to be binary.
In the next lesson you will have an opportunity to create some binary files. Other BUILD options |  |
There are several other options that you may occasionally wish to specify
in the BUILD command: - TEMP
User-defined temporary file
- CCTL/NOCCTL
Carriage control or no carriage control characters
- STD/MSG/CIR
Standard, message, or circular file
- KSAMXL/SPOOL
KSAM or spool file
- DEV
Device
- CODE
File code identifying the specific type of file
(for example, the editor file or executable code).
Exercise 2-2: creating a file to specification ********** End of Exercise 2-2 ********** Lesson summary |  |
The BUILD command lets you create a file with specific characteristics. The following BUILD options can be used to specify the file characteristics: record size (REC=) blocking factor record type (F,V,U) file type (ASCII,BINARY) device (DEV) file code
|