Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@INPUT (format 2) - Start @INPUT procedure from DMS file

&pagelevel(3)&pagelevel

This format of the @INPUT statement starts an @INPUT procedure from a SAM or ISAM file. Format 2 is now only supported for reasons of compatibility and should no longer be used. The statements and/or records in the file are processed sequentially. For information on the structure and processing of EDT procedures, see section “EDT procedures”.

Operation

Operands

F mode, L mode

@INPUT

file [(ver)] [lines[,...]] [:cols[,...]:] [{ RECORDS  |  KEY}] [ PRINT]

file

Name of the SAM or ISAM file that is to be read and processed. The name
must correspond to the SDF data type <filename 1..54>.

Here, the symbolic name '/' for a file for which the LINK name EDTSAM
or EDTISAM has been assigned by means of the SET-FILE-LINK command
is not permitted.

If the specified file does not exist or cannot be accessed as required or if the
file cannot be read in successfully then the statement is rejected with a
corresponding error message.

ver

Although this operand may be entered for the purposes of symmetry, it is
completely ignored.

lines

One or more line ranges that are to be processed in the ISAM or SAM file.
If lines is not specified then all the lines in the file are processed.

If symbolic line numbers are specified then their values are taken over from
the current work file and therefore usually have nothing to do with the record
structure of the specified file.
Any lines specification for SAM files is ignored unless one of the keywords
KEY or RECORDS has been specified at the same time.

cols

One or more column ranges containing the statements to be processed.
The ranges may repeat and overlap. If column values which exceed the
record length are specified then blanks are read in their place.
If KEY is specified for SAM files or in the case of ISAM files then the column
count starts after the key in the record.
If no column range is specified then the lines are read in full.

KEY

Specifies that the first 8 characters of each line in a SAM file are to be
interpreted as a line number. In the case of SAM files, this type of record can be
created by specifying @WRITE together with the KEY operand.
If KEY is specified in the @INPUT statement then these numbers are
interpreted as line content rather than line numbers when the file is read.
Otherwise, EDT would consider every line in the file to be a text line.

RECORDS

In the case of SAM files, specifies that a line range (see lines operand) is
to be selected via the logical line number. The logical line number of the 1st
line in the file is 0.0001, the logical line number of the 2nd line in the file is
0.0002 etc.

PRINT

Each line of the procedure should be logged before it is executed. In
interactive mode, the output is written to SYSOUT and in batch mode it is written
to SYSLST.

Specifying PRINT also causes all error messages to be output and sets the
EDT error switch. Normally, the two messages EDT0901 and EDT4932 are
not output in procedures and the EDT error switch is not set (see section
“Message texts”).

The @INPUT statement (format 2) must not be issued in @INPUT or in @DO procedures.

The keywords KEY and RECORDS are ignored in the case of ISAM files. If neither RECORDS nor KEY is specified then any lines specification for a SAM file is ignored, i.e. all the lines in the file are processed.

The execution of an @INPUT procedure is aborted if the @RETURN statement or the last statement in the procedure has been processed.

In the case of ISAM files and SAM files (with the KEY operand), the record key should always contain a valid line number and, when processing SAM files, EDT expects the records to be present in ascending order.

If the file is read without any line range specification then the record keys are simply ignored, i.e. they are not checked. In contrast, if line ranges are specified then EDT processes SAM and ISAM files differently.
In the case of ISAM files, the keys corresponding to the records which are actually read are checked. If a record contains a non-numerical key then execution of the procedure is aborted with error EDT4984.
In the case of SAM files, records with non-numerical keys or with keywords which are smaller than the current lower range boundary are ignored. If the keyword is greater than the current upper range boundary then the record in question and all the records following it are ignored. Furthermore, in the case of SAM files, records that are shorter than 8 characters are also ignored.

If the @INPUT procedure contains records then these are inserted in the current work file in the same way data input in L mode (empty records are ignored). If the current work file is empty and has the character set *NONE then it is assigned the character set of the file if records are inserted. If this character set is *NONE then the work file is assigned the character set EDF03IRV when records are inserted.

The statements or records read from the @INPUT procedure are interpreted in the character set corresponding to the specified file. If this character set is *NONE then EDF03IRV is used.

This character set may differ from the character set used in the current work file. Since statements always apply to the current work file and records are always inserted in the current work file it may therefore be necessary to convert literals in statements or records. If the file contains characters which cannot be displayed in the work file's character set then these are replaced by a substitute character if such a character has been specified (see @PAR SUBSTITUTION-CHARACTER), otherwise execution of the @INPUT procedure is aborted with the error message EDT5453. This also applies if there are invalid characters outside of the column range that is to be read. In contrast, invalid characters outside of the line range that is to be read are ignored.

If the file is present in a Unicode character set and contains an illegal byte sequence, e.g. surrogate characters, then it will be impossible to read it even if SUBSTITUTION-CHARACTERS is specified. In this case, the execution of the @INPUT procedure is aborted with the message EDT5454.

If the statement is interrupted with [K2] and the EDT session is continued with /INFORM-PROGRAM then the processing of the statement is aborted and message EDT5501 is output.

Example

6.     @PRINT
1.0000 @DELETE
2.0000 I AM LINE 1
3.0000 I AM THE SECOND LINE
4.0000 @PRINT 1
5.0000 @PRINT 2
6.     @WRITE 'SAM-INP' KEY --------------------------------------------- (1)
6.     @SAVE 'ISAM-INP' ------------------------------------------------- (2)
6.     @INPUT 'SAM-INP' KEY --------------------------------------------- (3)
1.0000 I AM LINE 1
2.0000 I AM THE SECOND LINE
3.     @INPUT 'ISAM-INP' 1-3,5,4 ---------------------------------------- (4)
2.0000 I AM THE SECOND LINE
1.0000 I AM LINE 1
3.
(1)

The content of the work file is written as a SAM file. When this is done, each line is prefixed by a key calculated on the basis of the current line number.

(2)The content of the work file is written again, but in this case as an ISAM file.
(3)

The complete file SAM-INP is read and executed. Since this file was created using @WRITE together with a KEY specification, KEY must be specified. Otherwise, the stored keys are not converted into line numbers.

(4)

Lines 1-3,5,4 in the file ISAM-INP are to be read and executed in the specified sequence.