Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getmain --> Need to Know the actual Size acquired

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Mon Jul 09, 2012 9:48 pm    Post subject: Getmain --> Need to Know the actual Size acquired
Reply with quote

In my code I have

WORKING-STORAGE SECTION.
01 ARRAY-1.
20 ARRAY-11 OCCURS 1 TO 2000 TIMES
DEPENDING ON COUNTER
INDEXED BY INDX1.
50 ARRAY-FIELD PIC (190).

.....

PROCEDURE DIVISION.

....


MOVE 2000 TO COUNTER.

EXEC CICS GETMAIN
SET(ADDRESS OF ARRAY-1)
FLENGTH(LENGTH OF ARRAY-1)
END-EXEC.



I wanted to know how much memory allocation would be reserved on executing this getmain.
On executing this command im not getting any length error or space not available.

Would it be 2000*190 = 380000 bytes of memory reserved?

Appreciate you help..Thanks in advance!!!!
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 09, 2012 9:56 pm    Post subject:
Reply with quote

does not matter what value you use to populate counter.

COBOL ODO Internal Tables always reserve/use the max amount.

the table will always be mapped as 380000 bytes.
if you receive no errors on the GETMAIN, you have your 380,000 bytes.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jul 09, 2012 9:57 pm    Post subject:
Reply with quote

Yes.
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Mon Jul 09, 2012 10:05 pm    Post subject:
Reply with quote

I had populated the max value in depending on Clause as i was not sure...Thanks very much for sharing such valuable information..

Also is there any way in which I could see the actual accquired memory by the program (380000 bytes in this case).

I tried using expeditor but am not able to figure it out..

Appreciate all your help...Thanks very much!!!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 09, 2012 10:15 pm    Post subject:
Reply with quote

This is a discussion of the GETMAIN CICS API and explains how much storage is actually assigned as long as one of these Conditions: LENGERR, NOSTG
are not returned.

Do notice please,
Link provided above wrote:
CICS always allocates on 16-byte boundaries and rounds the requested length up to the nearest 16-byte multiple


by the way, i just noticed that your GETMAIN instruction is wrong.

since you have defined your COBOL ODO Internal Table in working-storage:
1. there is no need to use GETMAIN, only use GETMAIN for Linkage items.

2. I doubt that your GETMAIN instruction compiled.

3. Had you coded the GETMAIN properly,
SET POINTER
you could find the GETMAIN'ed area via the address loaded into the pointer.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jul 09, 2012 10:20 pm    Post subject:
Reply with quote

Subject to dbz's excellent point, the value of the LENGTH OF of your table is available to you. If you don't know how to find it, you can MOVE it to an item in Working-Storage and view that. If you then let the value of the ODO actually vary, you'd be able to see the different lengths going through.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 09, 2012 10:55 pm    Post subject:
Reply with quote

the length of:
01 ARRAY-1. <<<<<<<<< will always be 380000

20 ARRAY-11 <<<<<<<< will always be 190 * COUNTER
by definition: OCCURS 1 TO 2000 TIMES
COUNTER must be between 1 and 2000.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 09, 2012 11:45 pm    Post subject:
Reply with quote

I stand corrected - thx Bill,

the length of:
01 ARRAY-1. <<<<<<<<< will always be 190 * COUNTER

20 ARRAY-11 <<<<<<<< will always be 190 * COUNTER
by definition: OCCURS 1 TO 2000 TIMES
COUNTER must be between 1 and 2000.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Jul 10, 2012 1:22 am    Post subject: Reply to: Getmain --> Need to Know the actual Size acquir
Reply with quote

I don't understand the necessity for a GETMAIN against WS?

At the initial internal load of the program (LE Enclave), all the program's WS has already been fully allocated, so the GETMAIN is unnecessary.

You should move the array to LINKAGE, where dynamic allocation (GETMAIN) of the needed storage makes more sense.

When the program is finished using the storage and you're not at task termination (level 0), then issue an explicit FREEMAIN.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Increase the screen size after split mistah kurtz TSO/ISPF 2 Fri Sep 02, 2016 6:39 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm
No new posts ALTER of an IDMS AREA with NEW/OLD pa... Awanti IDMS/ADSO 2 Mon Mar 14, 2016 10:01 pm
No new posts Add Trailing Zeroes depending upon th... Rohit Umarjikar DFSORT/ICETOOL 3 Fri Oct 23, 2015 1:47 am
No new posts Doubt on GETMAIN, FREEMAIN behaviour Arunkumar Chandrasekaran CICS 3 Sun Aug 30, 2015 9:22 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us