IDENTIFICATION DIVISION.
PROGRAM-ID. A-DoubleHelix.
 
DATA DIVISION.
WORKING-STORAGE SECTION.
01 B      PIC X.
01 ENKI   PIC X(4) VALUE 'ACGT'.
01 I      PIC 9.
 
PROCEDURE DIVISION.
  ACCEPT B.

  PERFORM VARYING I FROM 1 BY 1
    UNTIL (I > 4) OR (B = ENKI(I:1))
  END-PERFORM.

  DISPLAY ENKI(5 - I:1).

  STOP RUN.
