READ statement.

For sequential access, the READ statement makes available the next logical record from a file. For random access, the READ statement makes available a specified record from a mass storage file.

Format 1.

          READ file-name-1 [ NEXT     ] [ RECORD ] [ INTO identifier-1 ]
                           [ PREVIOUS ]

                [ [ AT ] END imperative-statement-1 ]
                [ NOT [ AT ] END imperative-statement-2 ]

                [ END-READ ]

Format 2.

          READ file-name-1 [ RECORD ] [ INTO identifier-1 ]

                [ KEY [ IS ] data-name-1 ]

                [ INVALID [ KEY ] imperative-statement-1 ]
                [ NOT INVALID [ KEY ] imperative-statement-2 ]

                [ END-READ ]