IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to 'call' a CICS statement imbedded subprogram?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon May 14, 2012 2:43 pm
Reply with quote

Bill Woodger wrote:


[...]

The CALL x USING ADDRESS OF y behaves like this:

Cobol tucks tucks the address of your item in a little piece of storage that you have no accesss to. Passing it as a parameter is fine, but attempting to change it in the called program is entirely pointless, as there is no lasting relationship between the tucked-away storage and your definition.

In this instance, since you don't have any storage for that yet, the address would be NULL anyway, so not only useless to the calling program, useless to the called program as well.

[...]


Sorry dejunzhu, I got the above wrong. The description I gave for how it works is for BY CONTENT on the USING. You have, implicitly, BY REFERENCE.

For BY REFERENCE, with an item in the Linkage Section, you can amend the ADDRESS OF in a called program.

There is mention in the manual that "identifier-2" should have addressability prior to the CALL, but it is not clear if this comment applies to the "identifier-2" in the ADDRESS OF. It is also potentially one of those situations where "must" in the Cobol manual means "should".

Now, for problem determination, changing the address of something directly (the program is passing the actual BLL Cell) in another module does not sound like such a good idea to me. It should work, but will have made the logic more obscure.

If you ever do it that way, make sure it is clearly documented/commented for/in the calling and called modules, please.

The clearer way to do it, as dbz already suggested on this point, is to set to a POINTER in the caller, change the value of that in the called, then set the address from the POINTER in the caller when you get back after the call.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts How to avoid duplicating a CICS Web S... CICS 0
Search our Forums:

Back to Top