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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
What is Static,Dynamic linking ?
How to remove 2 duplicate records and copy only one using job control language?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What is Comm?
2 Answers IBM, Kemper Corporation,
what will happen if i give program name and member name as different? program runs successful or w'll abend?
Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display j. para1. Add 5 to j. What’ll be the value after execution of display stmt. A) 35 B) 40 C) 30 D) 25 please explain how?
how would find total records in files using seqientional
What is an in line perform? When would you use it? Anything else you wish to say about it.
01 b pic +9(4) How many bytes it will take for storage???
how can you identify wheather the program is using search or search all in the cobol program?
explain sorting techniques in cobol program?