• Aucun résultat trouvé

OAT ASET UTILITIES 6

Dans le document COMPUTER SYSTEMS CRAY-1® (Page 154-162)

Utility control statements provide the user with a convenient means of copying, positioning, or dumping datasets. The following utilities are available to the user:

• COPYR, COPYF, and COPYD allow the user to copy records, files, or datasets, respectively.

• SKIPR, SKIPF, and SKIPD allow the user to skip records, files, or datasets, respectively.

• REWIND positions a dataset at the beginning of data, that is, prior to the first block control word of the dataset.

• WRITEDS is intended for initializing a random dataset but may also initialize a sequential dataset.

All parameters are in keyword form and have default values.

COPYR - COpy RECORDS

The COPYR statement copies a specified number of records from one dataset to another starting at the current dataset position.

Following the copy, the datasets are positioned after the end-of-record for the last record copied.

Format:

COPYR,I=idn,O=odn,NR=n.

SR-OOll

Part 2

6-1 I

Parameters are in keyword form.

I=idn o=odn

NR=n

Name of dataset to be copied. The default is $IN.

Name of dataset to receive the copy. The default is

$OUT.

Decimal number of records to copy. The default is 1.

If the dataset contains fewer than n records, the copy prematurely terminates on the next end-of-file.

End-of-file or end-of-data is not written. If the keyword NR is specified without a value, the copy

terminates at the next end-of-file. If the input dataset is positioned midrecord, the partial record is counted as one record.

COPYF - COpy FILES

The COPYF statement copies a specified number of files from one dataset to another starting at the current dataset position.

Following the copy, the datasets are positioned after the end-of-file for the last file copied.

Format:

COPYF, I~dn , O=odn , NF=n •

Parameters are in keyword form.

I=idn o=odn

NF=n

SR-OOll

Name of dataset to be copied. The default is $IN.

Name of dataset to receive the copy. The default is

$OUT.

Decimal number of files to copy. The default is 1. If the dataset contains fewer than n files, the copy

prematurely terminates on end-of-data. End-of-data is not written. If the keyword NF is specified without a value, the copy terminates at the end-of-data. If the input dataset is positioned midfile, the partial file counts as one file.

Part 2

6-2 I

I

COPYD - COpy DATASET

The COPYD statement copies one dataset to another starting at their current positions. Following the copy, both datasets are positioned after the end-of-file of the last file copied. The end-of-data is not written to the output dataset. Both input and output datasets must be blocked.

Format:

COPYD,I=idn,O=odn.

Parameters are in keyword form.

I=idn Name of dataset to be copied. The default is $IN.

O=odn Name of dataset to receive the copy. The default is $OUT.

SKIPR - SKIP RECORDS

The SKIPR control statement directs the system to bypass a specified number of records from the current position of the named dataset.

Format:

SKIPR,DN=dn,NR=n.

Parameters are in keyword form.

DN=dn Name of dataset to be bypassed. The default is $IN.

NR=n Decimal number of records to skip. The default is 1. If the keyword NR is specified without a value, the system positions dn after the last end-of-record of the current file. If n is negative, SKIPR skips backward on

dn.

SR-OOll

Part 2

6-3 J-Ol

I

I

SKIPR does not bypass an end-of-file or beginning-of-data. If an end-of-file or beginning-of-data is encountered before n records have been bypassed when

skipping backward, the dataset is positioned after the end-of-file or beginning-of-data: when skipping forward, the dataset is positioned after the last end-of-record of the current file. This statement is available for use with online tapes except that a negative value cannot be used for NR.

SKIPF - SKIP FILES

The SKIPF control statement directs the system to bypass a specified number of files from the current position of the named dataset.

Format:

SKIPF,DN=dn,NF=n.

Parameters are in keyword form.

DN=dn

NF=n

SR-OOll

Name of dataset to be bypassed. The default is $IN.

Decimal number of files to bypass. The default is 1. If the keyword NF is specified without a value, the system positions

dn

after the last end-of-file of the dataset.

If

n

is negative, SKIPF skips backward on

dn.

If

dn

is positioned midfile, the partial file skipped counts as one file.

SKIPF does not bypass an end-of-data or beginning-of-data.

If beginning-of-data is encountered before n files have been bypassed when skipping backward, the dataset is positioned after the beginning-of-data: when skipping

forward, the dataset is positioned before the end-of-data of the current file. This statement is available for use with online tapes except that a negative value cannot be used for NF: for interchange format tapes (DF=IC), NF can only be 1.

Part 2

6-4 J-Ol

For example, if

dn

is positioned just after an

end-of-file, the following control statement will position

dn

after the previous end-of-file. If

dn

is positioned midfile,

dn

will be positioned at the beginning of that file.

SKIPF,DN=dn,NF=-l.

SKIPD - SKIP DATASET

The SKIPD control statement directs the system to position a dataset at end-of-data, that is, after the last end-of-file of the dataset. It has

the same effect as the following statement:

SKIPF,DN=dn,NF.

If the specified dataset is empty or already at end-of-data, the statement has no effect.

Format:

SKIPD,DN=dn.

The parameter is ,in keyword form.

DN=dn

Name of dataset to be skipped. The default is $IN.

REWIND - REWIND DATASET

The REWIND control statement positions the named datasets at the

beginning-of-data, that is, prior to the first block control word of the dataset. The $IN dataset represents an exception. After REWIND, $IN is positioned after the control statement file. If any of the named

datasets is not open, REWIND opens it. REWIND is a system verb.

SR-OOll

Part 2

6-5 J

I

I

REWIND causes an end-of-data to be written to the dataset if the previous operation was a write or if the dataset is null. If the dataset is not memory resident, the buffers are flushed to mass storage when REWIND follows a write operation. If the dataset is memory resident, the end-of-data is still placed in the buffer, but the buffer is not

flushed. For an online magnetic tape dataset, REWIND positions the tape dataset to the beginning of the first volume accessed by the user.

Format:

Parameters are in keyword form.

DN=dn.

~ Names of datasets to be rewound. A maximum of eight datasets can be specified, separated by colons.

WRITEDS - WRITE RANDOM OR SEQUENTIAL DATASET

The WRITEDS control statement is intended for initializing a blocked dataset. It writes a dataset containing a single file consisting of a specified number of records of a specified length. This utility is especially useful for random datasets because a record written on a

random dataset must end on a pre-existing record boundary. Direct-access datasets, implemented in eFT as defined by the ANSI x3.9-1978 FORTRAN standard, can be initialized (and even extended) without the help of WRITEDS.

WRITEDS can also be used to write a sequential dataset.

Format:

WRITEDS,DN=dn,NR=np,RL=p~.

Parameters are in keyword form; the only required parameters are DN and NR.

DN=dn Name of dataset to be written. DN is a required parameter.

Part 2

SR-OOll 6-6 J-OI

NR=nra

RL=ral.

I

SR-OOll

Decimal number of records to be written. NR is a required parameter. Set to the largest value that may be needed, since a dataset cannot be extended when it is in random

(ROM) mode.

Decimal record length, that is, the number of words in each record. The default is zero words, which generates a null record.

If the record length is 1 or greater, the first word of each record is the record number as a binary integer starting with 1.

Part 2

6-7 J-Ol

Dans le document COMPUTER SYSTEMS CRAY-1® (Page 154-162)