View previous topic :: View next topic
|
Author |
Message |
Mohan Makana
New User
Joined: 07 Feb 2006 Posts: 18
|
|
|
|
Hi,
Could you please let me know, whether I can open a file in the subroutine, do process and close the file in there itself.
The actual requirement is ...I have to process a common logic for , different input files, contains some thousands of records. If I open this file in the calling program, for each and every record , the new subroutine will be called i.e. thousands of times this sub routine will be called. I don't want to do like that...I want to open the input file in the subroutine and do the process.
If you have got any questions about this please let me know.
Thanks. |
|
Back to top |
|
|
Aji
New User
Joined: 03 Feb 2006 Posts: 53 Location: Mumbai
|
|
|
|
Hi
The entire process(open-read-close) has to be done in a single programitself (ie In your case the called program). If your doubt is not cleared, please explain in detail about your requirement.
Regards
Aji Cherian |
|
Back to top |
|
|
Mohan Makana
New User
Joined: 07 Feb 2006 Posts: 18
|
|
|
|
Tes you are right, Could you please explain me the process. How do you pass the input file name to the subroutine from main routine and how do you send the resulted output file back top the calling program etc. |
|
Back to top |
|
|
Aji
New User
Joined: 03 Feb 2006 Posts: 53 Location: Mumbai
|
|
|
|
Hi
I didn'y understand your requirement. Please expalin.
ie Why to pass input file name to called program and get the filename back to called program.
You can simply open the input file name in the second program itself.The resultant file in the called program. And if you want the file name from one program to other use linkage section.
Regards
Aji Cherian |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Well, even I didnt understand the requirement correctly.
However if the issue is only to do file processing ( Open Close Write ) in Sub program, then it has to be done in the same way as main program.
In JCL too we need to give the same DD name and just open in Sub routine.
If this is not what you are looking for, then please send the exact details.
Thanks
ap_mainframes |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
Hi,
Even though there is similar logic in processing of different files of different Layouts, You can't open them in the Called programs.I,e (DYNAMICALLY).
You need to Declare the Layout In FD section in the subroutine, and that can't be changed dynamically(You can't change FD in a program), u should have different subroutines for at least for files of Different layouts.
Plz let me know if u r not clear with what i mean.
~Vamsi |
|
Back to top |
|
|
|