英文:
READ from VSAM file using CICS
问题
如何连续从VSAM文件中读取?
我有一个包含一些记录的VSAM文件。我需要使用CICS命令逐条读取记录,但我不知道文件在哪里结束。是否有一种方法可以发出文件已经到达末尾以停止读取过程。
我尝试过'EXEC CICS READNEXT'。
英文:
How can I read from a VSAM file continuously?
I have a VSAM file contining some records. I need to read records one by using CICS commands, but I dont know where the file ends.Is there any way to signal that the file has reached the end to stop the reading process.
I tried ´EXEC CICS READNEXT
答案1
得分: 1
你使用STARTBR后跟多个READNEXT命令浏览文件,然后是ENDBR命令。你重复执行READNEXT命令以读取文件中的所有记录,当到达文件末尾时,READNEXT命令失败并返回ENDFILE响应。然后,你发出ENDBR命令。
英文:
You browse through a file using STARTBR followed by multiple READNEXT commands and then an ENDBR command. You repeat the READNEXT command to read all the records in the file and when the end of the file is reached the READNEXT command fails with an ENDFILE response. You then issue end ENDBR.
答案2
得分: 0
@Soraya,有几个原因可能导致您收到错误响应代码16 (INVREQ)。如果您在STARTBR命令中指定了RESP2(field-name),您将收到一个值,指示了INVREQ响应的原因。如果您在STARTBR命令中没有编码RESP2操作数,您也可以在EIBRESP2字段中访问此RESP2值。
英文:
@Soraya, there are several reasons why you might receive an error response of 16 (INVREQ). If you specify RESP2(field-name) in your STARTBR command, you will receive a value indicating the reason for the INVREQ response. If you do not code the RESP2 operand on your STARTBR command, you can also access this RESP2 value in the EIBRESP2 field.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论