Hello,
arya_starc wrote:...Suppose some file is not given in the dd name of the jcl...
I find this statement tad bit confusing. Generally, imo, application programmers, when they know that a situation may arise that a certain DD statement
can be skipped - either use 'SELECT OPTIONAL' as Mr. Sample has stated, or they code a mechanism to handle it.
Handling can be in the form of:
a. OPEN/READ/WRITE the DS only if a certain flag is present, this flag in turn can be set basis the conditions that identify if the DS in question is to be present for this run or not.
b. Identify the file-status returned (as stated by Mr. Sample) and then reset it to '0' or
handle it. One needs to understand that '
handle' here has its own caveat.
Note that a COBOL program will not abend unless you want it to abend or code an abend routine; though it will set a return code basis the file-access and the code execution flow, which in turn is left to the programmer's discretion to be catered to.