Storing Passwords within A Command Module

In this example, a user is to be allowed to execute an application that accesses protected data but should not know the password.  The data is to be viewed only through the program.

*USE DBL BOOKS
*PERMIT PASSWORD IS EVERYONEPASS
*DEFINE PM VIEWAUTH
--INPUT
00001   CONTROL SECTION
00002
00003   RELATE DS AUTHORS AS AUX1 FOR UPDATE
.
.
.
--SAVE

The command is given to protect the Process Module (PM).

*SECURE PM VIEWAUTH PASSWORD IS REVIEWIT

Next, the Command Module (CM) is defined.

*DEFINE CM STARTUP--INSERT00001   DISABLE INTERRUPTS00003   PERMIT PASSWORD IS BIGNAMES !password of DS AUTHORS00004   PERMIT PASSWORD IS REVIEWIT !password of PM VIEWAUTH00005   USE PM VIEWAUTH00006   PERMIT CLEAR PASSWORD IS BIGNAMES00007   PERMIT CLEAR PASSWORD IS REVIEWIT00008   ENABLE INTERRUPTS00009   END--SAVE

Now the command is given so that the user has EXECUTE privilege on the CM STARTUP.

*SECURE CM STARTUP PASSWORD IS LIMITEDACCESS PRIVILEGE IS& EXECUTE

The user can now start ACCENT R, enter the Data Base Library (DBL) cipher key 'HIDE THE PROGRAM TEXT' in a PERMIT DBL command and enter the CM password LIMITEDACCESS in a PERMIT PASSWORD command before executing the CM STARTUP.  The CM STARTUP will give the passwords for the Data Set (DS) AUTHORS and the PM VIEWAUTH, execute VIEWAUTH, and then clear access to these objects when the PM has completed execution.

The statement DISABLE INTERRUPTS is used so that the user cannot use Control-C to abort the operation and still have the security access that was granted during the CM.