• Keine Ergebnisse gefunden

Specifications for Existing Files

Im Dokument 0 0 (Seite 123-126)

The third parameter of the LFD job control statement provides five different options:

INIT, EXTEND, PREP, IGNORE, and ID.

The INIT option is used to initialize an existing disk file; that is, INIT causes all information except the allocated space and file identifier to be discarded when the program using that file opens it. When you specifSr INIT for an output file, the output will start at the beginning of the file. When INIT is specified for an input file, an end-of-file will be indicated when your program reads the first record. You can specifSr INIT for all disk and diskette files.

Suppose you already reserved for the old file rather than allocate a new one? In this way, you are not leaving dead space on the disk volume.

We’ll assume that the file name is SORTOUT. The device assignment set to reuse WORK2 on disk volume DPSO28 would look like this:

II DVC 50 If VOL DSPO28 If LBL WORK2

II LFD SORTOUT,,INIT

Notice the logical unit number for the DVC job control is 50. This indicates any disk device can be used. Also note the absence of an EXT job control statement. It wasn’t needed; specifications for the new file are the same as the old one.

Note: The INIT parameter must not be used for a file that contains checkpoint records. The use of this parameter causes writing to begin at the start offile every time you log a checkpoint record to the file, thus overwriting any checkpoint records already existing on the file.

The EXTEND option allows you to add information to the present end of an existing output file if the instructions in your program allow you to do so. EXTEND has no effect on input files.

You can specify EXTEND for tape files; EXTEND logically does not affect disk and diskette files.

Suppose you allocated four cylinders for your file, but filled only two cylinders with information. Now, you have more information to add to this file, and your program allows you to do so. You must also instruct job control that you intend to do this.

70044623-000 4-45

Getting the Most Out of the Basic Job Control Statements

If the file name were ADDON, you could extend the file like this:

II LFD ADDON,,EXTEND

Remember, whether or not youcan actually extend a file depends on the instructions given in your program. In COBOL, for example, an OPEN OUTPUT statement does not permit file extension even if you specify the EXTEND parameter on the LFD statement.

The IGNORE option lets you specify that a file is an optional file. This means youcan decide at job execution time, without having to change the program, whether accesses to the file should be processed or ignored based on the file resources that are available.

This option should be used only with consolidated data management. It is ignored if specified for a file that is accessed using basic data management (including SAT files).

When the IGNORE option is specified, the following status is returned to the executing program:

• File initialization (OPEN) -successful status

• Input operation -end of file (EOF) indication

• Allother operations-successful status (request is ignored)

Use this option when a program reads or writes multiple filesandit is not necessary thatallof the files be accessed. For example, a program updates some files and.

produces a report, but the report is not always needed. You would specify IGNORE in the II LFD statement of the printer device assignment set. Another example is where the program reads multiple input files, but one of them is not available at the time andis not essential to the execution of the program.

When this option is specified for an input file, the program should be performing sequential retrieval; otherwise, it may not be expecting an EOF indication.

Indicating Where the Load Module Is Located

An EXECjob control statement is required to call a load module and initiate execution. Once again, the format is:

Il[symbol] EXEC program-name

(j

Ilibrary-name 11,[)switchpriority]1,ABI4ORM=tabet]

I

$Y$RUW

L

[.$Y$LOD

The second parameter indicates the name of the library (on disk) containing the load module. Thiscanbe either $Y$LOD, $Y$RUN, or the LFD name of the alternate load library you have previously specified in the control stream.

C

4-46 70044623-000

Getting the Most Out of the Basic Job Control Statements

As you can see, the shaded default option is $Y$LOD. This is where you would store most of your programs. When you omit the second parameter, $Y$LOD is searched.

If the load module is not found here, then the job’s $Y$RUN file is searched.

Another choice you have is the job’s $Y$RUN file, which is where the linkage editor stores your load module if you have not indicated a specific library. You would code

$Y$RUN in the EXEC job control statement if you have a load module with the same program name in $Y$LOD. Let’s assume that you have a load module named

PAYROL in $Y$LOD and that you want to make some changes to this program. Take the source deck, make the necessary changes, and compile it with the same program name: PAYROL. When it comes time to execute, the system is told that the load module to fetch is PAYROL. Without specifying the library name on the EXEC job control statement, the default ($Y$LOD) is assumed, so the system fetches the

PAYROL load module from $Y$LOD. But, you wanted the one from the job’s $Y$RUN file. You are going to receive the wrong load module. So, in this case, you had better indicate that you want to fetch from the job’s $Y$RUN file. Remember, the job’s

$Y$RUN file is only a temporary file. Any load module you store here is available only during that job.

Let’s say your load module is named PAYROL and it is loaded in the job’s $Y$RUN file. It would be coded as follows:

.11 EXEC PAYROL,$YSRUN

If the load module cannot be found in the job’s $Y$RUN file, $Y$LOD is searched to see if it was stored there.

The remaining choice for this parameter,library-name,is used when the load module is stored in a private load library of your own. if you do this, you must define this library in a device assignment set, and thelibrary-namemust agree with the file name on the LFD job control statement. Normally, if the module is not found in this library, $Y$LOD and then $Y$RUN are searched. If, however, you specify NSRCH on the OPTION job control statement, only the library named on the EXEC statement is searched for the load module; $Y$RUN and $Y$LOD are not searched. (See “Selecting Optional Features” in Section 6.)

Let’s say the load module is named PAYROL, and it is stored in a library with a file identifier of PAYLIBRARYMAST, on disk volume DISKO1. You used PAYLIB as the file name on the LFD job control statement, and, as the file identifier on the LBL job control statement, you would, of course, have to use PAYLIBRARYMAST. The device assignment set and the EXEC job control statement would be coded as:

II DVC 50

Getting the Most Out of the Basic Job Control Statements

If this library is not accessed by your program (if it is only accessed by the system to obtain the load module named on the EXEC job control statement), the file name on the LFD job control statement need not agree withanyspecification within your program. It serves only to associate the library in the device assignment set with the library on the EXEC job control statement. As the file name on our LFD job control statement, we could have used any name as long as it agrees with the specification on the EXEC job control statement.

If the load module is not located, $Y$LOD and then the job’s $Y$RUN file is searched.

Im Dokument 0 0 (Seite 123-126)