 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Enterprise Cobol obtaining calling program name</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/enterprise-cobol-obtaining-calling-program-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/enterprise-cobol-obtaining-calling-program-name/</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 07:52:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: meandyou</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/enterprise-cobol-obtaining-calling-program-name/#comment-73398</link>
		<dc:creator>meandyou</dc:creator>
		<pubDate>Thu, 04 Feb 2010 14:30:38 +0000</pubDate>
		<guid isPermaLink="false">#comment-73398</guid>
		<description><![CDATA[In MVS (z/OS) COBOL, this would be quite a trick.  it isn&#039;t easy even in Assembler.  

You will need to access the CDE chain and dig thru protected memory.   This is the calling chain that you see in a dump.

Or maybe it could be done by accessing the savearea of the calling program and determine which program owns that piece of storage;  not sure how to code that.

I know I have seen code pieces that address this, but it has been a LONG time.  You might try some more mainframe centric sites like IBM&#039;s DeveloperWorks.  

Some people make it a practice to include the name of the caller in the parms passed to the called module.  maybe like this:
&lt;pre&gt;
   IDENTIFICATION DIVISION.
   PROGRAM-ID.   PROG001.

   WORKING STORAGE SECTION.
   01  PARMS-PASSED.
       05  CALLER              PIC X(8)    VALUE &#039;PROG001&#039;.
       05  REAL-DATA        PIC ....
 
   PROCEDURE DIVISION.
   ...
   CALL &#039;PROG002&#039; USING PARMS-PASSED.
&lt;/pre&gt;

This would be a lot of work to retro-fit into an existing application system.  But you might remember it for the future.]]></description>
		<content:encoded><![CDATA[<p>In MVS (z/OS) COBOL, this would be quite a trick.  it isn&#8217;t easy even in Assembler.  </p>
<p>You will need to access the CDE chain and dig thru protected memory.   This is the calling chain that you see in a dump.</p>
<p>Or maybe it could be done by accessing the savearea of the calling program and determine which program owns that piece of storage;  not sure how to code that.</p>
<p>I know I have seen code pieces that address this, but it has been a LONG time.  You might try some more mainframe centric sites like IBM&#8217;s DeveloperWorks.  </p>
<p>Some people make it a practice to include the name of the caller in the parms passed to the called module.  maybe like this:</p>
<pre>
   IDENTIFICATION DIVISION.
   PROGRAM-ID.   PROG001.

   WORKING STORAGE SECTION.
   01  PARMS-PASSED.
       05  CALLER              PIC X(8)    VALUE 'PROG001'.
       05  REAL-DATA        PIC ....
 
   PROCEDURE DIVISION.
   ...
   CALL 'PROG002' USING PARMS-PASSED.
</pre>
<p>This would be a lot of work to retro-fit into an existing application system.  But you might remember it for the future.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/8 queries in 0.029 seconds using memcached
Object Caching 269/270 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 08:34:03 -->