Password Protection of Files

IBM DOS/VS COBOL implements password protection for files. You may put a PASSWORD clause into a SELECT statement, but only when the compiler is in the IBM DOS/VS COBOL compatibility mode. A SELECT statement (also called a file-control-entry) for a password-protected file must contain a PASSWORD clause of the following format:

     PASSWORD IS data-name-1

Here, data-name-1 is the name of an alphanumeric data item in the WORKING-STORAGE section of the Data Division. This data item must contain a valid password when the file is opened; otherwise, the OPEN statement fails.

To be compatible with IBM DOS/VS, ACUCOBOL-GT ignores the PASSWORD clause when in IBM DOS/VS compatibility mode.

Put the PASSWORD clause in any convenient spot after the ASSIGN clause.