      SUBROUTINE PLU.HEX.TO.BASE64(SRC,DST)
*PIC-LAN
*
*ALL
*PC
*N
*
*
*
*
*
      OPEN 'BASE64,ENCODE' TO ENC.FD ELSE CALL PLXX.STOP(201,'BASE64,ENCODE')
*
      DST = ''
      DD = ''
*
      I1 = LEN(SRC)
      FOR I = 1 TO LEN(SRC) STEP 96
         S = SRC[I,96]
         D = ''
         J1 = LEN(S)
         FOR J = 1 TO J1 STEP 6
            READV T0 FROM ENC.FD , S[J,3] , 1 THEN
               READV T1 FROM ENC.FD , S[J+3,3] , 1 THEN
                  D = D : T0 : T1
               END
            END
         NEXT J
         IF LEN(DD) > 4000 THEN
            DST<-1> = DD : AM : D
            DD = ''
         END ELSE
            DD<-1> = D
         END
      NEXT I
*
      IF DD <> '' THEN
         DST<-1> = DD
      END
*
      RETURN
   END
