Same fle being used by two programs in a job.

45 pts.
Tags:
AS/400 Active Jobs
AS/400 jobs
COBOL
COBOL/400
This is in cobol 400. Suppose program A opens a file in input mode and after that program A called program B which again opens the same file in input mode. File got opened successfully. Now assume that file is only getting closed in program A. Is this correct? Are we supposed to close the same file in program B also?

Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.

Depends
If when program A is done, the job is done, then the file will be closed automatically with the ending of the job.
IF A calls B repeatedly, you do not want to open and close the file on everty call. So then if A is not the last program ot run in the job and you need the file closed, you need call call B one more time at EOJ of A with a parm to tell it to close the file (Or seton INLR).

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Note that if program A creates the COBOL run-unit, then ending program A will end the run-unit. Tom
    125,585 pointsBadges:
    report
  • Thotts
    [...] 1. CharlieBrowne and TomLiotta gave some pointers to a member wondering about the same file being used by two programs in a COBOL job. [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following