View previous topic :: View next topic |
Author |
Message |
chkmhae Beginner
Joined: 27 May 2005 Posts: 2 Topics: 1
|
Posted: Fri May 27, 2005 3:54 am Post subject: Batchprogram calling a vsam submodul |
|
|
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 |
|
 |
dtf Beginner
Joined: 10 Dec 2004 Posts: 110 Topics: 8 Location: Colorado USA
|
Posted: Fri May 27, 2005 1:33 pm Post subject: |
|
|
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 |
|
 |
chkmhae Beginner
Joined: 27 May 2005 Posts: 2 Topics: 1
|
Posted: Mon May 30, 2005 1:18 am Post subject: Batchprogram |
|
|
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.  |
|
Back to top |
|
 |
|
|