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
how can i see junk values in dclgen or in hostvariable of comp ?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
Which is not true about evaluate statement
How to use the same COBOL program in Batch and CICS on lines? explain with an example
How are the next sentence and continue different from each other?
what is search and searchall?what is the diffrence between them?give an best example?
What are the rules of the move verb?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What is the LINKAGE SECTION used in COBOL?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
What are declaratives and what are their uses in cobol?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
Can a Search can be done on a table with or without Index?
IF I mention stop run in CICS what happens?
Name the sections present in data division.