Search code examples
cobolzosvsamracf

How to store the credentials of a VSAM password file in COBOL?


This is the code which IBM official page recommends to handle a VSAM password protected file:

INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT LIBFILE
      ASSIGN TO PAYMAST
      ORGANIZATION IS INDEXED
      RECORD KEY IS EMPL-NUM
         PASSWORD IS BASE-PASS
      ALTERNATE RECORD KEY IS EMPL-PHONE
         PASSWORD IS PATH1-PASS
. . .
WORKING-STORAGE SECTION.
01  BASE-PASS          PIC X(8) VALUE "25BSREAD".
01  PATH1-PASS         PIC X(8) VALUE "25ATREAD".

But as you can see, the password is in plain text. What is the most elegant way to store this kind of credentials in zOS so I can access from a COBOL program?


Solution

  • Don't do this. Use your External Security Manager (probably ACF2, RACF, or Top Secret) instead. Talk to your shop's security people.