C H A P T E R  3

UNIX File Utilities

Use the UNIX File Utilities Menu to perform operations on files from within the Sun MTP environment. Utilities that use a default editor invoke vi. Refer to your UNIX documentation for instructions on using the vi editor. To change the default editor, refer to the Sun Mainframe Transaction Processing Software Administrator's Guide.

This chapter contains the following topics:


UNIX File Utilities Menu

FIGURE 3-1 illustrates the menu structure.

  FIGURE 3-1 UNIX File Utilities Menu Map

Diagram showing the actions performed when you make a selection on the UNIX File Utilities menu.

procedure icon  To Display the File Utilities Menu

single-step bulletPress the PF2 key on the Development System main menu.

The menu (FIGURE 3-2) is a variation of the Sun MTP standard file selection screen.

  FIGURE 3-2 UNIX File Utilities Menu

Screen shot showing the UNIX File Utilities menu.

The three display criteria fields at the top of the screen are described in the first three rows of TABLE 2-1. The Select field lists the options you can apply to the listed files. The file display area contains the same fields described in TABLE 2-2.


procedure icon  To Apply an Option

single-step bulletType the option letter (the letter in parentheses) in the selection column next to the desired file.

Be sure to use uppercase.

You can only apply one option to each file, but you can apply the same option to multiple files. You can also specify different options on the same screen. After you press Enter, the options execute sequentially.

The following function keys are active on the UNIX File Utilities Menu.

TABLE 3-1 UNIX File Utilities Menu Function Keys

Function Key

Action

PF3

Closes the UNIX File Utilities Menu and returns to the Development System main menu.

PF4

Refreshes the data in the file list portion of the screen. After you modify a file, press PF4 to display any changes to the file's information.

PF7

Displays the previous page of files. If the top of the file list is displayed, this message is displayed:

Beginning of data reached.

PF8

Displays the next page of files. If the bottom of the file list is displayed, this message is displayed:

End of data reached.

PF9

Redisplays the contents of the directory, sorted by file name.

PF10

Redisplays the contents of the directory, sorted by the file's last modification date.

PF11

Redisplays the contents of the directory, sorted by file size.



Using the File Utilities

This section describes how to use the file utilities.

Browse Option (B)

The Browse option runs the kixbrw shell script, which opens the selected file in the specified editor as a read-only file.

Copy Option (C)

Use the Copy option to copy a single file. When you select a file to copy and press Enter, the screen in FIGURE 3-3 is displayed.

  FIGURE 3-3 UNIX File Utilities-- File Copy Screen


The File Copy screen has two sections:

Field Name

SOURCE

DESTINATION

Directory

Directory where the source file is located

Defaults to the source directory, but can be changed to any directory.

Filename

Name of source file

You must type a file name. If you do not, a prompt is displayed.

Replace

 

Indicates whether to replace an existing file with the destination file:

  • N: Existing files are not replaced. If a file with the same name exists, an error message is displayed prompting you to change the replace option or type a new file name.
  • Y: Existing files are automatically replaced.



caution icon

Caution - When copying with the replace option set to Y, no confirmation prompt is displayed. If you later realize that you overwrote the file by mistake, you can only restore the original file from a backup.



After you finish data entry and press Enter, the kixcopy shell script is run to perform the copy.

Rename Option (R)

Use the Rename option to rename a single file. When you select a file to rename and press Enter, the following screen is displayed.

  FIGURE 3-4 UNIX File Utilities--Rename Screen


The File Rename screen is similar to the File Copy screen and is divided into two sections:

Field Name

SOURCE

DESTINATION

Directory

Directory where the source file is located

Defaults to the source directory, but can be changed to any directory.

Filename

Name of source file

You must type a file name. If you do not, a prompt is displayed.

Replace

 

Indicates whether to replace an existing file with the destination file:

  • N: Existing files are not replaced. If a file with the same name exists, an error message is displayed prompting you to change the replace option or type a new file name.
  • Y: Existing files are automatically replaced.



caution icon

Caution - When renaming with the replace option set to Y, no confirmation prompt is displayed. If you later realize that you renamed the file by mistake, you can only restore the file from a backup.



After you finish data entry and press Enter, the kixrnm shell script is run to rename the file.

Search Option (S)

The Search screen is displayed when you select one or more files to search and then press Enter. Use this option to search the selected files for an occurrence of the search pattern.

  FIGURE 3-5 UNIX File Utilities-- Search Screen

Screen shot showing the Search Screen.[ D ]

The only option on the Search screen is the search pattern, and it is required. If you do not enter a pattern, an error message is displayed prompting for a search pattern.

The Search option runs the kixgrep shell script to search the selected files for the search pattern. The output of the search is written to a temporary file that is displayed on your screen in the default editor.



Note - The search is case-sensitive, so you must type the search pattern exactly as it appears in the file.



You can change the search utility and the editor used to display the results of the search by modifying the kixgrep shell script. Refer to the Sun Mainframe Transaction Processing Software Administrator's Guide for more information about customizing shell scripts.

Concatenate Option (A)

The Concatenate option joins multiple files into one file. FIGURE 3-6 shows the Concatenate screen, which is displayed when you select multiple files to concatenate and then press Enter.

  FIGURE 3-6 UNIX File Utilities--Concatenate Screen


The fields on the Concatenate screen are listed in the following table:

Field Name

Description

Directory

Directory where the source files are located

Files to Concatenate

Lists the selected files. You can select a maximum of 10 files for concatenation. However, for each concatenation, you can only select files from a single page on the UNIX File Utilities Menu.

Output Directory

Defaults to the source directory, but you can change it.

Output File

Indicates the file name for the concatenated file.

Replace

Indicates whether to replace an existing file with the file named in the Output field.

  • N: An existing file is not replaced. If a file with the same name exists, an error message is displayed prompting you to change the replace option or type a new file name.
  • Y: An existing file is automatically replaced.



caution icon

Caution - When concatenating files with the replace option set to Y, no confirmation prompt is displayed. If you later realize that you performed the concatenation incorrectly, you can only restore the replaced file from a backup.



Press Enter to run the kixcat shell script to concatenate the files. The results of the concatenation are displayed, by default, in the editor specified in the kixcat shell script.

If any errors occur during the concatenation procedure, the error messages are displayed and the Concatenate Screen is redisplayed.

Print Option (P)

The Print option runs the kixprt shell script to perform printing. The files are printed as soon as you press Enter. No further action is required. You can modify this shell script to select a certain printer or printer options. Refer to the Sun Mainframe Transaction Processing Software Administrator's Guide for more information about customizing shell scripts.

Delete Option (D)

The Delete option runs the kixdlt shell script. The files are deleted as soon as you press Enter on the UNIX File Utilities Menu. No further action is required.



caution icon

Caution - There is no confirmation with the Delete option. If you select a file to delete and press Enter, the file is immediately deleted. You can only restore it from a backup.