tips:Record Locks

发表于:2007-06-08来源:作者:点击数: 标签:
byBarbaraMorris Ifyouareprocessingrecordsinaprimaryfileandyouw ant tojustskipanyrecordsthatgetinputerrors,youcancodeanINFSRsubroutineforthefile.OntheENDSRofthesubroutine,code'*GETIN'.Thatwillcausecontroltogotothepartofthecyclethatgetsthene

by Barbara Morris

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.
[code:1:cffb8a82d5]
Fmyfile    ip   e             disk    infsr(myinfsr)
C     myinfsr       begsr
C                   ... file error
C                       endsr     '*GETIN'[/code:1:cffb8a82d5]
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.
[code:1:cffb8a82d5]
Fmyfile    ip   e             disk    infsr(*pssr)
C     *pssr         begsr
C                   ... general error
C                   endsr     '*GETIN'[/code:1:cffb8a82d5]
If you don't always want to just go straight to the next record, you can soft-code the return point on the ENDSR.
[code:1:cffb8a82d5]
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
 [/code:1:cffb8a82d5]

【发表回复】【查看CU论坛原帖】【添加到收藏夹】【关闭】
 michael9406 回复于:2003-12-31 14:33:38
这么好的贴子是该设为精华了。

 yoyoage 回复于:2003-12-31 15:17:31
:oops: 没错,可是 :em06: ,不是原创阿 :em06: 。。。
多谢老大鼓励~

 stephenxie2003 回复于:2003-12-31 16:11:13
鼓励鼓励!
 :)

 riancy1106 回复于:2003-12-31 16:51:31
永远支持

 sean810 回复于:2004-01-02 09:21:54
Very Good!

 yj2yq 回复于:2004-01-02 09:43:28
支持!大家一起来!

 stephenxie2003 回复于:2004-01-02 14:38:34
建议:
用中文也写一下吧!
来个双语版的!

 yoyoage 回复于:2004-01-02 15:31:54
有时间写好了再给大家:----我担心的是,英文的海勉强可以看懂,被我一折腾成中文的,就没人看懂了HOHO~

 andrewleading_he 回复于:2004-01-03 16:16:23
支持!

原文转自:http://www.ltesting.net