title: Why do i get error 138 when doing a find followed by a create?
body: <p>I have the following code block which when run, gives error 138 and the create is actually failing. Any help would be appreciated.</p>
  
  <pre><code>FIND PSESCDel EXCLUSIVE-LOCK
               WHERE PSESCDel.EmployeeCode    = PSESC.EmployeeCode
                 AND PSESCDel.ServiceCoverRef = PSESC.ServiceCoverRef NO-ERROR.
  
  
          IF NOT AVAILABLE PSESCDel THEN
          DO:
              IF PSESC.EmployeeCode = "0358" THEN
                      MESSAGE "RM NOT AV" PSESC.ServiceCoverRef.
  
              CREATE PSESCDel.
              ASSIGN PSESCDel.EmployeeCode    = PSESC.EmployeeCode
                     PSESCDel.ServiceCoverRef = PSESC.ServiceCoverRef
                     PSESCDel.DeletedDate     = TODAY.
  
              IF PSESC.EmployeeCode = "0350" THEN
              DO:
                      MESSAGE "RM IT CAME TO CREATE".
                      IF ERROR-STATUS:ERROR OR ERROR-STATUS:NUM-MESSAGES &gt; 0 THEN DO:
                              MESSAGE "RM ERROR NUMBER" STRING(ERROR-STATUS:GET-NUMBER(1)).
                              MESSAGE "RM ERROR MESSAGE" ERROR-STATUS:GET-MESSAGE(1).
                      END.
              END.
  
  
  
          END.
  </code></pre>