NET/MASTER Network Control Language (NCL) Reference Manual
FILE GET
Verbs
3–78 106126 Tandem Computers Incorporated
FILE GET The FILE GET verb retrieves a record from the current file or pair of files. You can use
the FILE GET verb on key-sequenced, entry-sequenced, or edit files. When you
retrieve records by using the FILE GET verb, each field within the record can be
returned in variables that you specify.
File processing supports the retrieval of records from key-sequenced files by both full
and partial keys. In a full key, all the characters required for the FILE GET operation
are present. In a partial key, only some of the leading characters required for the FILE
GET operation are present. Retrieval by partial key would normally be used if the
entire key is not known, or if many records have keys that are similar and only differ
as necessary to ensure uniqueness.
For key-sequenced files in a pair of files, FILE GET attempts to retrieve the record from
the first file, then the second file, as follows:
If the record is in neither file, the operation fails.
If the record is in the first file but not the second file, the record is retrieved from
the first file.
If the record is in the second file but not the first file, the record is retrieved from
the second file.
If the record is in both files, the record is retrieved from the first file.
On completion of FILE GET, the &SYS.VARCNT system variable is set to the number
of variables created or modified by the operation. In addition, you can always obtain
the full key of the record returned from the &SYS.FILE.KEY system variable. The
&SYS.FILE.PATH system variable contains the number of the file from which the
record was retrieved (ONE or TWO).
A record retrieved by a FILE GET can be rewritten to a file by using a FILE PUT verb,
without designating a key with the KEY=
keydata
operand. Alternatively, you can
delete the record by issuing a FILE DEL verb without specifying the KEY=
keydata
operand.
FILE GET [ ALTKEY=
altkey
]
[ GENLEN=
num
]
[ ID=
fileid
]
[ KEY=
keydata
]
[ OPT={ BWD | END | FWD | KEL | KEQ | KEX | KGE |
KGT | KLE | KLT | SAVE | SEQ | UPD } ]
[ PATH={ ANY | ONE | TWO } ]
[ UPDATE ]
{ MDO=
mdo-name
[ HEADER={ NO | YES } ] |
ARGS [ RANGE=(
start
,
end
) ] [ SEGMENT=
n
] |
VARS={
input-vars-list
|
variable*
}
[ RANGE=(
start
,
end
) ]
[ SEGMENT=
n
] }