                           C B L U T I L


      This routine can be recalled from a Cobol or an Assembler program
and its purpose is give some services to process strings, that usually
are not available in these languages.


  Use in cobol:

    CALL 'CBLUTIL' USING COMMAND LEN1 STRING1 [LEN2 STRING2 [POSIT]]

  Some commands require only three parameters (that is only variables
  COMMAND, LEN1 e STRING1), others five or six.
  Mean of these parameters follows:

    COMMAND : action to do (this action can be shorted up to three
              characters); see later
    LEN1    : length of STRING1 following; for some commands in this 
              variable is returned a requested value (or an return code
              error); is a Fullword binary.
    STRING2 : string of characters to process
    LEN2    : length of STRING2, as Fullword
    STRING2 : string of characters to process
    POSIT   : position, requested by commands POS, OVERLAY, SUBSTR,
              DELSTR, INSERT e WINDEX; is a fullword binary.

          COMMAND    PIC     X(8).
          LEN1       PIC    S9(7)   COMP.
          STRING1    PIC     X(nnn).
          LEN2       PIC    S9(7)   COMP.
          STRING2    PIC     X(nnn).
          POSITION   PIC    S9(7)   COMP.

  According to type of command, variabes STRING1 or STRING2 can be in
  input and / or in output.
  Maximum length of strings is 256 characters.

  Available commands:
  with only one string: (three parameters)

      ADDR    : return in LEN1 address of variable STRING1
                (useful only for assembler programmers)
      CENTRE/CENTER: center the contents in the middle
      REVERSE : if input is  I'M ADAM, is returned MADA M'I
      RIGHT   : right justify, removing blanks
      LEFT    : left justify, removing  blanks
      UPPER   : transform string in upper case
      LOWER   : transform string in lower case
      LENGTH  : return in LEN1 string length, that is the position of
                the last character not blank
      E2A     : transform from EBCDIC to ASCII
      A2E     : transform from ASCII  to EBCDIC
      WORDS   : in LEN1 is returned number of words (delimited by blank)

  In this functions, variable STRING1 is both in input and in output 
  (except for commands ADDR, LENGTH and WORD, in which output is 
  only LEN1)


  With two strings: (five parameters)

      OR      : logical OR is performed bit by bit between two strings
                and result is in STRING1;
                in LEN1 is returned the length of shortest string
      AND     : logical AND is performed bit by bit between two strings
                and result is in STRING1;
                in LEN1 is returned the length of shortest string
      XOR     : logical XOR is performed bit by bit between two strings
                and result is in STRING1;
                in LEN1 is returned the length of shortest string
      SQUEEZE : remove from STRING1 all characters present in 
                STRING2 (whit movement to left)
      C2X     : convert STRING1 in hexadecimal, putting result in
                STRING2 (that must have length double of STRING1)
      X2C     : convert STRING1 from hexadecimal in characters
                putting result in STRING2


  With two strings and six parameters:

      POS     : find the first occurrence of STRING1 in STRING2
                starting from 'POSIT' (that usually is 1) and
                return position in  POSIT (0 if not found)
      SUBSTR  : extract from STRING2 a substring starting from 'POSIT'
                with length 'LEN1' and put it in STRING1
      DELSTR  : delete from STRING2 a substring starting from
                'POSIT' with length 'LEN1'
      INSERT  : insert in STRING2 the substring STRING1 starting from
                'POSIT' shifting to right of LEN1 characters the 
                remaining characters (the most right are losen)
      OVERLAY : overlay in STRING2 substring STRING1 starting from
                'POSIT' replacing 'LEN1' characters
      WINDEX  : return in STRING1 the n-th word in STRING2,
                with n specified in 'POSIT'; in LEN1 there is length
                of the returned string






