title: Comparing 2 PIC X strings of characters in COBOL
body: <p>I'm really new to COBOL and I would like to ask a question. What if I have 2 PIC of characters and I would like to know if they are the same string</p>
  
  <pre class="lang-cobol prettyprint-override"><code>   77 name1 PIC x(20).
     77 name2 PIC x(20).
  
     PROCEDURE DIVISION.
        DISPLAY "Type the first name: " WITH NO ADVANCING
        ACCEPT name1.
        DISPLAY "Type the second name: " WITH NO ADVANCING
        ACCEPT name2.
  </code></pre>
  
  <p>I tried to search on google and found the Search method. But I can't really understand it and I think it will not work on my case since I'm not using a table. </p>