Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
The DD name may or may not be coded in JCL depends on what exactly the COBOL program is doing.
We can write Assembler program to read the files from COBOL program dynamically, in this case NO DD name statement is coded in the JCL.
Suppose if i have 3 files which is being used in both programs A and B. Then will it be sufficient for me to keep 3 DD statement seperately in JCL and file declaration (FD) have to defined seperately in both the programs (A and B)?
Please advise my understanding is correct or not?
I taught of writing my doubt/question in seperate query/thread. And i found a discussion was already done about this topic. So i included my doubt with this.
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
Yes it is possible for the calling program and the called program to use the same 3 DDs. You may need to have the files closed in the calling program while the called program is running and vise versa. You could also declare the files to be external. It all depends on how you need to use the files. In many cases it is clearer to have 1 of the programs do all of the file access for files in common between calling and called programs.