In Cobol, draft the code that will declare the student record as described below
ID: 3870414 • Letter: I
Question
In Cobol, draft the code that will declare the student record as described below and read in the records from the file STUDENT-FILE-IN (STUFILE.TXT on the N drive). For each record you read in, you must display the student name on the monitor. The input record (STUDENT-RECORD-IN has the following structure.
STUDENT NAME 30 bytes alphameric
STUDENT ADDRESS
STREET 20 bytes alphameric
CITY 15 bytes alphameric
PROVINCE 10 bytes alphameric
POSTAL CODE 6 bytes alphameric
Assume that the code to open the file and terminate the program has been coded already. Concentrate on the Data Division entry for the file and record, the module to read the record in, and the module to display the name.
Explanation / Answer
03 student-address.
05 street pic x(20).
05 city pic x(15).
05 province pic x(10).
05 postal-code pic x(6).