      subroutine signat(string,lg)
      integer lg
      character*(*) string
      character*255 str
      integer l

      external kinfo
      character*80 kinfo
      character date*6,heure*12,utili*40

      date=kinfo('DATE')
      heure=kinfo('HEURE')
      utili=kinfo('UTILISATEUR')
      do 1 l=40,1,-1
        if (utili(l:l).ne.' ') goto 2
 1    continue
 2    continue
      write(str,200) date(5:6),date(3:4),date(1:2)
     &  ,heure(1:2),heure(4:5),utili(1:l)
 200  format(a2,'/',a2,'/',a2,', ',a2,':',a2,', ',a)
      string = str
cc      lg = min(len(string),index(str,'r :')+3+l)
      lg = 17+l
      end 
c--------------------------------------------------------------------
      CHARACTER*80 FUNCTION KINFO(MOTCLE)
C
      CHARACTER*(*) MOTCLE
      CHARACTER*80  K_D_JO,K_HE,K_UT
C
C DATE DU JOUR (AAMMJJ)
C AA ANNEE, MM MOIS, JJ JOUR
      IF (MOTCLE.EQ.'DATE') THEN
        KINFO = K_D_JO()
C
C HEURE (HHMMSSFFFFFF)
C HH HEURE DE 00 A 23, MM MINUTE DE 00 A 59, SS SECONDE DE 00 A 59,
C FFFFFF MICROSECONDE, DE 000000 A 999999
      ELSEIF(MOTCLE.EQ.'HEURE') THEN
        KINFO = K_HE()
C
C NOM DE L'UTILISATEUR
      ELSEIF(MOTCLE.EQ.'UTILISATEUR') THEN
        KINFO = K_UT()
C
C ERREUR
      ELSE
        PRINT*,'***KINFO : MOT-CLE INCONNU : ',MOTCLE
        KINFO = ' '
      ENDIF
      END
C-----------------------------------------------------------------------
      CHARACTER*80 FUNCTION K_D_JO()
C
      INTEGER AA,MM,JJ,idat(3)
      CHARACTER*1 CAS(10)
      DATA CAS/'0','1','2','3','4','5','6','7','8','9'/
      call idatec(idat)
      mm = idat(1)
      jj = idat(2)
c
c Y2K !!!
c
      aa = mod(idat(3),100)
      K_D_JO = CAS(AA/10+1) // CAS(MOD(AA,10)+1) //
     +         CAS(MM/10+1) // CAS(MOD(MM,10)+1) //
     +         CAS(JJ/10+1) // CAS(MOD(JJ,10)+1)
      END
C-----------------------------------------------------------------------
      CHARACTER*80 FUNCTION K_HE()
C
      character*8 heure
      call ctimec(heure)
      k_he = heure
      END
C-----------------------------------------------------------------------
      CHARACTER*80 FUNCTION K_UT()
C
      CHARACTER*132 NOM
      call getenvc('LOGNAME'//CHAR(0),NOM,LEN(NOM),IBID)
      if (IBID.LT.0) call getenvc('USER'//CHAR(0),NOM,LEN(NOM),IBID)
      k_ut = nom(1:ibid)
      END
