Page 1 of 2

Issue in getting unique pointer address in a CICS reentrant

PostPosted: Fri Jun 01, 2012 10:09 am
by Prads
I have a CICS-COBOL program- PROGA. This is invoked by transaction ABCD. This program is a re-entrant program (compiled using LIB,OBJECT,APOST,MAP,RENT,XREF,OFFSET,OPT, DATA(31), RMODE=ANY), linked using (LIST,XREF,RENT,RES).

The purpose of this program is to get the pointer addresses to a set of 01 level copy book variables for the application and then call a COBOLprogram passing the pointer addresses in an array.

The issue we are facing is that when 2 user run the transaction(ABCD) the pointer address provided by the program is not unique, no matter where the copy books have been placed, be it in working storage or local storage.

Can you please let me know why is this happening??

Ideally we would have expected that every time the program is invoked the addresses of WS-USER-ID and WS-USER-ID-1 be different for a CICS-COBOL program which is a REENTRANT, but that is not the case here.

The program is invoked using the transaction (ABCD) it is not "called" / "linked".

Below is a sample code in the program.

WORKING-STORAGE SECTION.
01 WS-USER-ID PIC X(08) VALUE SPACES.
01 WS-POINTER USAGE POINTER.

LOCAL-STORAGE SECTION.
01 WS-USER-ID-1 PIC X(08) VALUE SPACES.
01 WS-POINTER-1 USAGE POINTER.


Code present in PROGA:

SET WS-POINTER-1 TO ADDRESS OF WS-USER-ID-1.

SET WS-POINTER TO ADDRESS OF WS-USER-ID.

DISPLAY " ADDRESS OF USER ID IN WORKING STG: " WS-POINTER.
DISPLAY " ADDRESS OF USER ID IN LOCAL STG: " WS-POINTER-1.


CICS LOG



USER: XYZ
0249ABCD 20120525001955 ADDRESS OF USER ID IN WORKING STG: 0741383608
0249ABCD 20120525001955 ADDRESS OF USER ID IN LOCAL STG: 0741402808
0249ABCD 20120525001955 ***********
0249ABCD 20120525001955 ADDRESS OF 1 0741754816
0249ABCD 20120525001955 ADDRESS OF 2 0741403264
0249ABCD 20120525001955 ADDRESS OF 3 0741701072
0249ABCD 20120525001955 ADDRESS OF 4 0741704256
0249ABCD 20120525001955 ADDRESS OF 5 0741705248
0249ABCD 20120525001955 ADDRESS OF 6 0741706432
0249ABCD 20120525001955 ADDRESS OF 7 0741706808
0249ABCD 20120525001955 ADDRESS OF 8 0741707152
0249ABCD 20120525001955 ADDRESS OF 9 0741741032
0249ABCD 20120525001955 ADDRESS OF 10 0741741576
0249ABCD 20120525001955 ***********
0249ABCD 20120525001955 GETMAIN ADDRESS0741754816
0249ABCD 20120525001955 ADMIN-PARM: XYZ LOGEVENTMNEV 3270

USER: ABC
0251ABCD 20120525002258 ADDRESS OF USER ID IN WORKING STG: 0741383608
0251ABCD 20120525002258 ADDRESS OF USER ID IN LOCAL STG: 0741402808
0251ABCD 20120525002258 ***********
0251ABCD 20120525002258 ADDRESS OF 1 0741754816
0251ABCD 20120525002258 ADDRESS OF 2 0741403264
0251ABCD 20120525002258 ADDRESS OF 3 0741701072
0251ABCD 20120525002258 ADDRESS OF 4 0741704256
0251ABCD 20120525002258 ADDRESS OF 5 0741705248
0251ABCD 20120525002258 ADDRESS OF 6 0741706432
0251ABCD 20120525002258 ADDRESS OF 7 0741706808
0251ABCD 20120525002258 ADDRESS OF 8 0741707152
0251ABCD 20120525002258 ADDRESS OF 9 0741741032
0251ABCD 20120525002258 ADDRESS OF 10 0741741576
0251ABCD 20120525002258 ***********
0251ABCD 20120525002258 GETMAIN ADDRESS0741754816
0251ABCD 20120525002258 ADMIN-PARM: ABC LOGEVENTMNEV 3270

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 10:47 am
by Monitor
I didnt look into your results in full detail, but every user/transaction always gets its own copy of the original Working-Storage.
If you run a series of transactions you might end up in using the same storage-adresses again and again, as the storage is released at task termination and allocated again.
If you test your transaction(s) in paralell, using e.g. EDF, you will find, and visually see in real-time, that the different occurances of the same transaction-id will use different storage areas. If not, I am as puzzeled as you!

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 11:06 am
by Prads
Here is the situation, I have 2 user invoking the transaction ABDC from two different terminal , the program PROGA gets invoked the address assigned to the variable is same for both. Its not a case where I am running the transaction for a user after some time. We know that in multi threading the CICS reentrant program creates copies of work storage variables when the users invoke same transaction concurrently but what seem to be happening here is that that the address of the copy remains the same for both the users kinda of undoing the feature of Reentrant.

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 12:06 pm
by Monitor
The REENTRANT ensures the CODE is not modified during execution. As CICS uses the same copy of the CODE, programs must be reentrant.
Different tasks never share the same Ws, so your experience is new to me. I´ll do som digging when time permits and get back with the result of my test, with the same code.

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 12:59 pm
by BillyBoyo
What on Earth are you trying to do?

You have a perfectly good bit of storage for holding stuff related to the "user". There is a reason it is done that way.

What do you think you'll achieve by trying to get working-storage at a "user" level. I suggest you investigate the "reentrant" fully.

You'd best explain to us what you are trying to do, otherwise you'll end up wasting a lot of time.

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 2:26 pm
by Prads
The PROGA is a driver reentrant CICS-COBOL program & I indent to get some pointer address for a set of 01 variables and send the pointer address to another program which can deference the pointer and process the data.
The issue is that for concurrent users I am not able to get unique address allocated by CICS.

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 2:36 pm
by Monitor
Did you try using EDF as I suggested, to really see values?

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 2:51 pm
by Prads
CEDF has been disable on the system, hence using display statements

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 3:24 pm
by BillyBoyo
We know what you are trying to do, you have told us that. You haven't told us what you are trying to achieve.

How come everyone else and their dog is happy using the approved method and you want to do something different and just expect it to work?

Well, time for you to think again. On your own if you don't want to reveal further information.

What you are trying to do will not work that way.

Re: Issue in getting unique pointer address in a CICS reentr

PostPosted: Fri Jun 01, 2012 9:02 pm
by dick scherrer
Hello,

Why does someone believe that your transaction needs to treat reentrancy differently than all of the other online cics programs run on your system?

What does reentrant mean to you? Possibly you have something that is different than most of us understand as reentrancy.

As was asked earlier - what are you trying to accomplish?