• Keine Ergebnisse gefunden

Different Versions of a File

Im Dokument 0 0 (Seite 117-121)

Ordinarily, only one generation of a file is used by a program. There are instances, however, when more than one generation of the same file may be needed. For

example, one generation contains payroll deductions only used in January, March, and May, and another generation has the payroll deductions used only in February, April, and June. To indicate the different generations of a file, you can use the 1- to 4-digit generation-numberparameter of the LBL job control statement. This is used only

with tape files, and is the sixth parameter shown in the format. By using this parameter, you can be sure the correct generation is used.

Suppose you did have two different generations of the payroll deduction file, with a file identifier of CUSTMAST, and you want to use the second generation. This would be coded as:

II LBL CUSTMAST,,,,,2

if you omit this parameter, data management assumes 0001.

Let’s go one step further. Each generation of a file can have several different versions.

Again, we have these two different generations of the CUSTMAST payroll deduction file. Generation 1 is used in January, March, and May, and generation 2 is used in February, April, and June. But, suppose each of these generations had two unique sections. Version 1 is used in odd-numbered years, and version 2 is used in even-numbered years.

We could use the 1- to 2-digitversion-number parameter to do this.

Suppose it is January, 1990. We need generation 1 (January) and version 2 (1990 is even numbered). This would be coded as:

II LBL CUSTMAST,,,,,1,2

If theversion-number parameter is omitted, data management assumes 01.

70044623-000 439

Getting the Most

Out

of

the

Basic Job Control Statements

Changing the Label of a Disk File C

The REN statement is used to permanently change the label of adiskfile through job control-a simpler procedure than the alternative methods for renaming disk files.

The format of REN is:

II[symbo[) REN tfdname, mew-labeL

1

[SNTERM]

l’new-Label

‘1

The lfdnameparameter identifies the file to be renamed. It must match thelfdname in the LFD statement for the file.

The file’s new label is specified in thenew-labelparameter. New-labelreplaces the existing label identified in the device assignment set for the file. If new-label contains embedded blanks, it must be enclosed by single quotation marks. It may be from 1 to 44alphanumericcharacters inlength.

Specifring optional parameterNTERMcauses any fatal errors encountered during the renaming process to be ignored, but permits the job to continue. If this parameter is present, the job continues running if a renaming error occurs, but the file is not renamed. IfNTERMis omitted, the job terminates at the point of error.

The REN statement is checked forsyntax errorsby the run processor during job stream validation. If no errors are detected, the job is queuedandbecomes a

scheduling candidate. The run processor passes information from the REN statement to the step processor, which performs the actual renaming during job execution.

The device assignment set for the file to be renamed must precede the REN

statement. It is a good idea to place the REN statement within the control stream as close to the device assignment set for the file as possible, sinceIIREN is only effective against files on volumes mounted when the REN statement is encountered.

A file is renamed in the job step containing// REN, prior to execution of the program for that step, or prior to job termination if no EXEC statement followsIIREN.

Subsequent references to the renamed file must usenew-labelin the LBL statement of the device assignment set for the renamedfile.

Notes:

1. The REN statement is used only to rename disk or format-label-diskette files; it may not reference device assignment sets for data-set-label diskette or tape volumes.

2. REN statements are not permitted against files on SYSRES that begin with $Y$, or against files on SYSRUN that begin with $Y$R.

3. Don’t use /1 SKIP to bypass a device assignment set referenced by a REN statement that is not also bypassed. Ifyou do, you’ll get an error during the renaming process. (See “Adding Cards to a Stored Control Stream” in Section 6 for more information.)

4.40 . 7004 4623-000

Getting the Most Out of the Basic Job Control Statements

4. Ifyou rename a cataloged file, you must recatalog the file under the new name.

Suppose you have a program that calculates the engineering department’s payrolland outputs a disk file labeled EGRPAY. The control stream to rename the file EGRCOST looks like this:

II DVC 50 II VOL DSKO1 /1 LBL EGRPAY II LFD DSKO1JT

II REN DSKOUT,EGRCOST

The file’s label is now EGRCOST. Suppose that a subsequent job step uses EGRCOST as input for calculating company-wide costs. Building on our first example, the

renamed file is referenced subsequently in the control stream like this:

II DVC 50 /1 VOL DSKG1 If LBL EGRPAY /1 LFD DSKOUT

/1 REN DSKOUT,EGRCOST

• II DVC 50 II VOL DSKO1 II LBL EGRCOST II LFD DSKIN

7004 4623-000 4-41

Getting

the

Most

Out

of

the

Basic Job Control Statements

A single REN statement applies only to the first volume in a multivolume file. To

C

rename a multivolume file, therefore, you must specify a unique REN statement for each volume in the file.

If EGRPAY in our first example had been a multivolume file, we would have renamed it this way:

1/ DVC 50 If VOL DSKO1 1/ LBL EGRPAY II LFD DSKOUT1

II DVC 51 If VOL DSKO2 If LBL EGRPAY 1/ LFD DSKOUT2

If REN DSKOUT1,EGRCOST 1/ REN DSKOtJT2,EGRCOST

Use the REN statement carefully to avoid renaming a file concurrently used by another job. To help prevent this problem, establish nonsharable status (using the NS option of the VOL statement) for endangered disk volumes, or use passwords known only to selected personnel.

4-42 7004 4623-000

Getting the Most Out of the Basic Job Control Statements

Im Dokument 0 0 (Seite 117-121)