a. Can the OPTIONAL clause in COBOL only be coded for input
files?
b. If it is coded for files opened in OUTPUT, I-O or EXTEND
mode, will it give a compilation error?
c. If there are no compilation errors and if such files are
not coded in the JCL, will the OPEN statement run fine when
these files are opened?
d. How will a WRITE statement work for the above files?
Answer Posted / kb
An OPTIONAL file is being opened as EXTEND or I-O. Optional
files are files that are not necessarily present each time
the program is run. You can define files opened in INPUT,
I-O, or EXTEND mode as optional by using the SELECT OPTIONAL
phrase in the FILE-CONTROL paragraph.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
How arrays can be defined in COBOL?
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
What are the different rules for performing sort operation?
how do you reference the rrds file formats from cobol programs
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
how do you reference the esds vsam file formats from cobol programs
Have you used comp and comp-3 in your project? And how?
What are the different rules of SORT operation?
What is the difference between Global and External Variables?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
Difference between array and sub-script ?
) what is the difference between AID and HANDLE AID?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?