MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Writing in Subprogram while opening in Main Program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
karavi2000
Beginner


Joined: 17 Aug 2003
Posts: 51
Topics: 26
Location: Chennai

PostPosted: Fri Apr 30, 2004 2:31 am    Post subject: Writing in Subprogram while opening in Main Program Reply with quote

Hi,

This is a requirement which was already posted in this forum. There were no clear answers into how to go into the problem. I just want to refresh it as I have a similiar requirement like this now.

This is my requirement. The file should be opened and closed in the main program but will be written into in a subroutine.
How many ways this can be accomplised?

Please let me know.

Thanks & Regards,
Ravishankar
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Apr 30, 2004 4:43 am    Post subject: Reply with quote

karavi2000,

Quote:

This is a requirement which was already posted in this forum. There were no clear answers into how to go into the problem


Can you post the link you are refering to ? I did a search and could not find any thing related to your requirement.

To answer your question you can define the files as "EXTERNAL" . For every program with the cobol run unit the file defined as external will have access to the file. You can open and close in the main program and IO operations like read and write can be done in sub programs.

Check this link for a detailed explanation of Sharing files between programs (external files)

The above link also has an example

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Fri Apr 30, 2004 5:06 am    Post subject: Reply with quote

Hi,

same option works for PL/I programs.

Other possibility:

Pass the file handle as parameter from the main program to the subprogram.

If need PL/1 sample code, pls let me know.

Regrads,
J. Bauer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group