Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is perform what is varying?

1156


Name the divisions, which are available in a cobol program?

1228


what is the use of outrecord?

2204


How do define dynamic array in cobol.

1123


What is redefines clause in COBOL?

1284


Can we change the password using ALTER? anyone tried and changed?

2008


In COBOL programming, what is PERFORM? What is VARYING?

1140


How to print 10 to 1 if the input have only 10 digit number?

1254


For rewrite, why is it mandatory that file needs to be opened?

1101


State the various causes of s0c1, s0c5 and s0c7.

1075


What is cobol?

1236


What are different data types in cobol?

1305


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

1224


Write a cobol program making use of the redefine clause.

1163


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

1426