| Record Locks |
|
|
| Written by Admin (Chamara) | ||
| May 05, 2009 at 01:03 PM | ||
|
Skip past locked records. If you are processing records in a primary file and you want to just skip any records that get input errors, you can code an INFSR subroutine for the file. On the ENDSR of the subroutine, code '*GETIN'. That will cause control to go to the part of the cycle that gets the next record. Fmyfile ip e disk infsr(myinfsr) C myinfsr begsr C ... file error C endsr '*GETIN' If you also want to ignore program errors encountered when processing the data in a record, code a *PSSR subroutine the same way. If you don't have any file-specific processing in your INFSR subroutine, you can use the *PSSR as the INFSR. Fmyfile ip e disk infsr(*pssr) C *pssr begsr C &n ... general error C  bsp;; endsr '*GETIN' If you don't always want to just go straight to the next record, you can soft-code the return point on the ENDSR. Fmyfile ip e disk infsr(myinfsr) D infsrEnd s 6a D recordLock c 1218 C myinfsr begsr C eval infsrEnd = '*CANCL' C if %status(myfile) = recordLock C eval infsrEnd = '*GETIN' C endif C endsr infsrEnd |
||
| <Previous | Next> |
|---|