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 

Batchprogram calling a vsam submodul

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
chkmhae
Beginner


Joined: 27 May 2005
Posts: 2
Topics: 1

PostPosted: Fri May 27, 2005 3:54 am    Post subject: Batchprogram calling a vsam submodul Reply with quote

I work on a program which calling a submodul to read on a vsam file. My problem is, that I have to program the hole logic (open file, read ) in the main programm and not in a subprogram because I lost the fileconection.

The idea behind I ask for help is, that I have the mainprogram and then I will call the submodul which will check if the file is open and give me one record back. The mainprogram work on that record and ask the submodul for the next recorde (and so on) until to the end. Then the file has to be closed.

The submodul should be usable for other mainprograms wihtout big changes in the mainsource code of the caller program.

Have anybody an idea or a solution for that kind of problem. Many thanks.
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Fri May 27, 2005 1:33 pm    Post subject: Reply with quote

Not totally clear on what you want to do , but would suggest that you look at the EXTERNAL clause (as coded on the FD) I think. This allows you to open a file in one program, and perform other I/O functions in another module.

hope this helps
DTF
________
Ford Aerostar


Last edited by dtf on Tue Feb 01, 2011 1:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
chkmhae
Beginner


Joined: 27 May 2005
Posts: 2
Topics: 1

PostPosted: Mon May 30, 2005 1:18 am    Post subject: Batchprogram Reply with quote

Thanks for your input. That I know already. My idea is that I have a mainprogram which calls a submodul. The submodul have to open, read and close the file. That means that I will have all the logic in the submodul (to reuse).
I will not adapt the mainprogram with a lot of new code. In DB2 that isn't a problem to program that stuff above.

Another idea is to move all data into a copybook and move that data to the mainprogram(caller). Is that a useful solution. Rolling Eyes
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 -> Data Management 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