Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Identifying the main program thru sub program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Mar 02, 2007 10:03 am    Post subject: Identifying the main program thru sub program
Reply with quote

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
View user's profile Send private message

vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Fri Mar 02, 2007 11:41 am    Post subject:
Reply with quote

You need to search subprogram into cobol Library.

You will get main program otherwise You search bindeck also
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Mon Mar 05, 2007 10:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dineshness

New User


Joined: 25 Dec 2006
Posts: 63
Location: Perambalur

PostPosted: Tue Mar 06, 2007 1:02 am    Post subject: Re: Identifying the main program thru sub program
Reply with quote

May be you can pass the main program name as a string to the Sub program thru the linkage section.

Dinesh.
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Tue Mar 06, 2007 5:25 pm    Post subject: Re: Identifying the main program thru sub program
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1252
Location: Israel

PostPosted: Tue Mar 06, 2007 7:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 06, 2007 10:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Tue Mar 06, 2007 11:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2007 12:48 am    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Mar 07, 2007 4:25 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2007 5:16 am    Post subject:
Reply with quote

As long as the new data is not put first in the parms icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts Identifying Interfaces in CICS/mainframe Ashishpanpaliya CICS 5 Fri Oct 13, 2017 3:21 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us