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

Lack of Freemain in the Commarea


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

New User


Joined: 19 Jul 2018
Posts: 44
Location: Greece

PostPosted: Tue Nov 04, 2025 7:09 pm
Reply with quote

Dear all,

We had a very peculiar case today where two users were using the same transaction with the same data. With the first user it was working but the second user had problems. We found that the program was issuing a GETMAIN for commarea (DFHCOMMAREA) without doing a FREEMAIN at the end. With the FREEMAIN addition looks it is working. Can this be the solution of our problem?

Thank you in advance.
Back to top
View user's profile Send private message
Ziko13

New User


Joined: 19 Jul 2018
Posts: 44
Location: Greece

PostPosted: Wed Nov 05, 2025 2:09 pm
Reply with quote

The answer to this problem is that it was indeed the lack of freemain for the commarea. Please note that you have to do the freemain only if the getmain above is successful.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2272
Location: USA

PostPosted: Thu Nov 06, 2025 12:58 am
Reply with quote

Ziko13 wrote:
Please note that you have to do the freemain only if the getmain above is successful.

Is there anybody in this world who may doubt it?
Back to top
View user's profile Send private message
Ziko13

New User


Joined: 19 Jul 2018
Posts: 44
Location: Greece

PostPosted: Mon Nov 10, 2025 6:24 pm
Reply with quote

Dear all,
Unfortunately this problem persists. It is working in the test region but sometimes it is failing in production with the same data. Test is a mirror or production. We saw today that these programs are not working with DFHCOMMAREA but there is a special copybook in the linkage section with a corresponding WS area. The field we want to pass is the page number so we put that in the end and decreased the filler area after that. Again it is working in test. Any ideas about production ? Is there a reason for this to fail again? I can post my code if needed.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2624
Location: Silicon Valley

PostPosted: Tue Nov 11, 2025 12:00 am
Reply with quote

re: sometimes it is failing in production with the same data

<speculation>
Likely, you are testing without an adequately busy enough workload. Or perhaps there is a rarely used transaction that is not being driven in the test environment.

When I hear of lost storage, I think my own experience where the case was of two parallel tasks that did not share the storage correctly. The developer did not use 'compare and swap' assembler instruction correctly to get ownership of a control block.
</speculation>
Back to top
View user's profile Send private message
Ziko13

New User


Joined: 19 Jul 2018
Posts: 44
Location: Greece

PostPosted: Tue Nov 11, 2025 1:45 am
Reply with quote

A misconfiguration in production maybe? Thank you very much for the responce
Back to top
View user's profile Send private message
Ziko13

New User


Joined: 19 Jul 2018
Posts: 44
Location: Greece

PostPosted: Tue Nov 11, 2025 1:46 am
Reply with quote

We uploaded the code during a weekend where only the tester was online but still there were cases where it didnt work.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1356
Location: Israel

PostPosted: Fri Nov 14, 2025 9:06 pm
Reply with quote

The documentation is clear about this: ending the task that issued the GETMAIN will release the acquired memory.
Unless you used the SHARED parameter.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2624
Location: Silicon Valley

PostPosted: Sat Nov 15, 2025 1:05 am
Reply with quote

re: Unless you used the SHARED parameter

I am only somewhat familiar with the normal assembler macros, where the concern is with the SP (subpool) parameter. The default is subpool 0 that is released when the task ends, but you can specify a subpool that will stay even after the task ends.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10900
Location: italy

PostPosted: Sat Nov 15, 2025 2:27 am
Reply with quote

the topic is about a CICS getmain... not a zOS getmain
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1356
Location: Israel

PostPosted: Tue Nov 18, 2025 2:54 am
Reply with quote

If you want significant help, you have to be more specific and precise.

Ziko13 wrote:
Dear all,
Unfortunately this problem persists. It is working in the test region but sometimes it is failing in production with the same data. Test is a mirror or production.


What "problem" do you have ? What do you mean by failing ?
Do you receive an abend, do you get SOS, do you kill the whole CICS ?

Ziko13 wrote:
We saw today that these programs are not working with DFHCOMMAREA but there is a special copybook in the linkage section with a corresponding WS area. The field we want to pass is the page number so we put that in the end and decreased the filler area after that.


Where is the GETMAIN in all this ? if you can define a "corresponding WS area", why do you need the extra storage ?

Ziko13 wrote:
I can post my code if needed.


Yes please. Which GETMAIN do you use (shared or not), how do you manage the address, how do you pass it to the other program, and how the other program use it.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1356
Location: Israel

PostPosted: Tue Nov 18, 2025 3:03 am
Reply with quote

If you want significant help, you have to be more specific and precise.

Ziko13 wrote:
Dear all,
Unfortunately this problem persists. It is working in the test region but sometimes it is failing in production with the same data. Test is a mirror or production.
What "problem" do you have ? What do you mean by failing ?
Do you receive an abend, do you get SOS, do you kill the whole CICS ?

Ziko13 wrote:
We saw today that these programs are not working with DFHCOMMAREA but there is a special copybook in the linkage section with a corresponding WS area. The field we want to pass is the page number so we put that in the end and decreased the filler area after that.
Where is the GETMAIN in all this ? if you can define a "corresponding WS area", why do you need the extra storage ?

Ziko13 wrote:
I can post my code if needed.
Yes please.
Which GETMAIN do you use (shared or not), how do you manage the address, how do you pass it to the other program, and how the other program use it.

Also, programs can be different in the different environments. Do you recompile your programs when moving to prod (for example: running with NOOPT in test for debugging and with OPT(n) in prod for performance) ?
Back to top
View user's profile Send private message
Ziko13

New User


Joined: 19 Jul 2018
Posts: 44
Location: Greece

PostPosted: Sun Nov 23, 2025 12:15 pm
Reply with quote

Dear all,

Thank you very much for your willingness to help. The change is now one week in production and stable.
Lessons learned regarding commarea :

1. Always look in the linkage section copybooks for special areas that you can use for transfering data and only if there is none then try allocating DFHCOMMAREA.
2. Never Freemain DFHCOMMAREA. Let CICS handle it.

The above are my own assumptions. You are very welcome to share your opinion for the others.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts CICS COMMAREA CICS 3
No new posts COMMAREA and CHANNELS CICS 4
No new posts GETMAIN / FREEMAIN versus STORAGE OBT... PL/I & Assembler 8
No new posts GETMAIN/FREEMAIN query CICS 9
No new posts Doubt on GETMAIN, FREEMAIN behaviour CICS 3
Search our Forums:


Back to Top