View previous topic :: View next topic
|
Author |
Message |
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
Hi,
I have sub programs , i am getting the input to this sub program thru the
linkage section, how to identify the main program ?
Could you please answer as early as possible.
Thanks |
|
Back to top |
|
|
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 136
|
|
|
|
You need to search subprogram into cobol Library.
You will get main program otherwise You search bindeck also |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
do you need to identify the main program thru subprogram itself or you need to find out manualy. For the second one you need to go for library check |
|
Back to top |
|
|
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
May be you can pass the main program name as a string to the Sub program thru the linkage section.
Dinesh. |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
Quote: |
Maybe you can pass the main program name as a string to the Sub program thru the linkage section. |
...and to do that you would need to identify the main program!
..and to do that you would????? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
That's what we do too:
Code: |
01 WS-PARAM-AREA.
03 WS-CALLING-PROGRAM PIC X(8).
03 WS-PARAMETERS ....
MOVE 'mainprogram' TO WS-CALLING-PROGRAM
CALL 'subprogram' USING WS-PARAM-AREA |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This will work, but will require changing every program that calls the "subprogram". If the called program is some kind of common subroutine (like a date handling routine) it may be called by hundreds of other modules. Changing all of them may not be feasable.
Back to the original request. . . .
Is there a problem in the subprogram caused by the passed-in data? If so, you could cause the subprogram to abend and find the calling module from the dump. If the problem currently causes an abend, you will already have a dump. |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
reddy for what purpose you are looking for name of main module do you need any logical things to be performed within your data or just to find which is the main module. what king of call is used in your program is it static or dynamic |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
To continue with the thought Cobolunni brings up. . .
If you do need to do processing dependng on which module was the "caller", it is time for a new subroutine that has an expanded parameter list (as was described above). This, unless there is the ability to make the change to all of the modules that currently call this subprogram.
If a second subprogram was created, i'd encourage phasing out the original so that 2 of them do not have to be maintained. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Don't forget, the parm list can be optionally longer than all the calling programs know about. The called program can test for its presence and act accordingly. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
As long as the new data is not put first in the parms |
|
Back to top |
|
|
|