You do NOT code this in COBOL. You could use BPXWDYN for dynamic allocation, but usually you would just allocate the files in your JCL just as if directly executing the program.when we call a LOAD MODULE ABC in cobol to execute, but ABC need some DATASETs as input or output files( for example SYSIN, FILEIN), so how can we code this in COBOL?
It is not clear what you are asking. If you are asking about ABC calling COBOL program XYZ, and ABC opens the files for XYZ -- then the answer is no, this cannot be done. A COBOL program pretty much needs to define and use its own files. If you are asking about ABC calling COBOL program XYZ, and where to place the DD statements for XYZ -- then the answer is in the JCL that executes ABC. What happens if programs ABC and XYZ use the same DD name? Then you have to change one of them so each DD name is unique -- or you accept that ABC cannot call XYZ.Can we call ABC and configure it with FILEIN, FILEOUT AND SYSIN in COBOL to make it run?
Yup . . . probably.Maybe I need more learning about Mainframe.