Hi,
In one of the COBOL programs, it reads a VSAM dataset. When the file is empty program ends with a VSAM status code. The file is opened in INPUT or I-O mode. I see STAYS code handling in COBOL program but I do not want to handle it in program rather in a JCL. Can I do that? Can you please suggest any way using that VSAM file can be checked if it is empty or not?
How to handle VSAM status code in JCL itself?
-
- Registered Member
- Posts: 24
- Joined: Thu Jul 11, 2013 6:28 pm
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to handle VSAM status code in JCL itself?
The easiest and simplest way is to change the IDCAMS that deletes / defines the VSAM data set to include a REPRO of a dummy record. Then the COBOL program won't have to deal with an empty VSAM data set and the first thing the program can do is delete the dummy record.
-
- Registered Member
- Posts: 24
- Joined: Thu Jul 11, 2013 6:28 pm
Re: How to handle VSAM status code in JCL itself?
That is a good idea. But apart from that can JCL never know about such a case?
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to handle VSAM status code in JCL itself?
JCL doesn't "know" anything. It is written to allocate resources and run programs, period.
And the issue arises due to the way VSAM works. Short of redesigning VSAM (which is not likely), the problem of opening an empty VSAM data set for input does NOT depend upon the tool used; it is ALWAYS an issue.
And the issue arises due to the way VSAM works. Short of redesigning VSAM (which is not likely), the problem of opening an empty VSAM data set for input does NOT depend upon the tool used; it is ALWAYS an issue.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute