View previous topic :: View next topic
|
Author |
Message |
Poha Eater
New User
Joined: 31 Aug 2016 Posts: 74 Location: India
|
|
|
|
Hi All,
I wanted your inputs for a certain situation. There is a program 'PGMA' which can either call 'PGM1' or 'PGM2' based on certain condition.
There is a PS file, FILE1, which is being written when it is going in PGM1 or PGM2 and the records will keep appending until the termination of the program. So in which program i need to define the FILE CONTROL for the file definition of FILE1 when the program is being compiled using DYNAM option.
1. In PGMA only ?
2. In PGM1 and PGM2 ?
3. In PGMA, PGM1 and PGM2 ?
In case of NODYNAM compiler option i think we need to define the FILE CONTROL only in PGMA in above scenario. Please correct me if i am mistaken. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Have you looked at the EXTERNAL file example starting on page 518 of the Enterprise COBOL V6R2 Programming Guide manual? If not, you should look at it. The FILE-CONTROL, FILE SECTION, and WORKING-STORAGE file status variable are repeated in every program referencing the file via use of a copy book to standardize their access.
Quote: |
In case of NODYNAM compiler option i think we need to define the FILE CONTROL only in PGMA in above scenario. Please correct me if i am mistaken. |
So according to the manual, you are mistaken -- FILE-CONTROL must be present in PGMA, PGM1, PGM2 (along with the FILE SECTION and the WORKING-STORAGE file status variable). Note that none of the manuals discuss EXTERNAL in reference to the NODYNAM compile option, so it would appear there is no relationship between NODYNAM and EXTERNAL files. |
|
Back to top |
|
|
Poha Eater
New User
Joined: 31 Aug 2016 Posts: 74 Location: India
|
|
|
|
Hi Robert,
Thanks for pointing out the exact topic in the Manual and sharing the answer. Really thanks for the guidance. It provides the required information.
Thanks Rohit for your reply. |
|
Back to top |
|
|
|