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 rules are followed by the search verb.
What is report-item in COBOL?
What is the LINKAGE SECTION used in COBOL?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What is the Purpose of Pointer in the string?
How are the next sentence and continue different from each other?
What type of SDLC u followed? Why?
Name the divisions, which are available in a cobol program?
What is link edit in cobol?
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
Discuss about changing dataset name in proc.
How do you differentiate between cobol and cobol-ii?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?