从VSAM文件中使用CICS读取

huangapple go评论53阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年6月12日 14:55:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76454223.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定