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 / sandy
OPTIONAL clause can be specified for files opened INPUT,
OUTPUT, I-O and EXTEND modes. It will not give any
compilation error.
If we do not have DD statements for such files during
execution, the following file status code would be obtained
when we open the file.
INPUT (JCL RC = 0)
------
Open statement will give file status of '05'. Open is
successfule but file is not present.
EXTEND (JCL RC = 0)
------
Open statement give file status of '96'. No DDNAME present.
I-O (JCL RC = 0)
------
Open statement give file status of '96'. No DDNAME present.
WRITE (JCL SOC4 ABEND)
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What are the different open modes available in cobol?
Give some examples of command terminators?
What is the LINKAGE SECTION used in COBOL?
What guidelines should be followed to write a structured cobol prgm?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
What is rmode(any) ?
Describe the cobol database components?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
How do define dynamic array in cobol.
IF I mention stop run in CICS what happens?
Write a cobol program making use of the redefine clause.
how do you reference the esds vsam file formats from cobol programs
What is the difference between external and global variables in COBOL?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?