COBOL code with VSAM gives RC-04 without RECORD VARYING.
Posted: Thu Mar 17, 2016 9:26 pm
I am running one COBOL pgm which is reading one VSAM file. Below is ithe input output section in my pgm.
But at execution, the program failes with RC=04.
When FD is changed to the follwoing, it works:
It works fine.
I did this because, while searching I got some hint that when in FD we have only one record even if the file is VB it treats it is FB.
And FB would have record contains or Varying clause. Is it true? Confusing.
Code: Select all
FILE-CONTROL.
SELECT IN-FILE ASSIGN TO INFILE
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
RECORD KEY IS IN-KEY
FILE STATUS IS WS-IN-STATUS.
FILE SECTION.
FD IN-FILE IS EXTERNAL
COPY INPUTREC.
When FD is changed to the follwoing, it works:
Code: Select all
FILE SECTION.
FD IN-FILE IS EXTERNAL
RECORD VARYING IN SIZE FROM 1 TO 200.
COPY INLAYOUT.
It works fine.
I did this because, while searching I got some hint that when in FD we have only one record even if the file is VB it treats it is FB.
And FB would have record contains or Varying clause. Is it true? Confusing.