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

How to pass data thru COMMAREA more than 64kb


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

New User


Joined: 08 Oct 2004
Posts: 42
Location: chennai, india

PostPosted: Fri Feb 25, 2005 7:41 pm
Reply with quote

Hi,

The size of the commarea is 64 kb if i want to store more than that means is it possible or not.
Back to top
View user's profile Send private message
rick

New User


Joined: 18 Jun 2004
Posts: 59
Location: Chennai

PostPosted: Tue Mar 01, 2005 2:38 pm
Reply with quote

Hi,

It is not possible to have DFHCOMMAREA more than 64KB.


Thanks and Regards,
Rick.
Back to top
View user's profile Send private message
meetsrk

New User


Joined: 13 Jun 2004
Posts: 85

PostPosted: Fri Mar 04, 2005 9:10 pm
Reply with quote

hi,

I suspect its not 64KB, its 32KB.

if u wanna store more than 32KB, then go for TSQ(Temporary storage queue).
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Tue Mar 08, 2005 2:52 am
Reply with quote

Dear Metsrk,

You are correct. The maximum size of DFHCOMMAREA is 32,500 bytes, however it is recommended (by IBM) not to exceed 24K.
Back to top
View user's profile Send private message
ganmain

New User


Joined: 19 Feb 2005
Posts: 28

PostPosted: Sun Mar 13, 2005 1:21 pm
Reply with quote

HI,
I want to know why we are declaring commarea in both working
storage & linkage section(dfhcommarea).

if my cics program is not calling another program
only commarea declaring in working storage section is enough
or
we have to declare both in working storage & linkage section ?

please clarify this doubt
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Sun Mar 13, 2005 3:35 pm
Reply with quote

Quote:
why we are declaring commarea in both working
storage & linkage section


The COMMAREA option of the LINK and XCTL commands specifies the name of a data area (known as a communication area) in which data is passed to the program being invoked.


Quote:
if my cics program is not calling another program only commarea declaring in working storage section is enough


If you are not using any LINK, XCTL or RETURN command in your program, there is no need to worryabout COMMAREA.

Quote:
we have to declare both in working storage & linkage section


In a receiving COBOL program, you must give the data area the name DFHCOMMAREA. In this COBOL program, if a program passes a COMMAREA as part of a LINK, XCTL, or RETURN command,
either the working-storage or the LINKAGE SECTION can contain the data area. A program receiving a COMMAREA should specify the data in the LINKAGE SECTION.
Back to top
View user's profile Send private message
ganmain

New User


Joined: 19 Feb 2005
Posts: 28

PostPosted: Mon Mar 14, 2005 8:04 pm
Reply with quote

thanks for your reply

but still iam having doubt in that
if my program is of psudo conversation ie return(transid) but it is not
calling another program then declaring dfhcommarea in linkage section is necessary or not necessary?

please clarify this
Back to top
View user's profile Send private message
mainframemouli

New User


Joined: 01 Mar 2005
Posts: 52
Location: Mysore

PostPosted: Tue Mar 15, 2005 10:55 am
Reply with quote

Even if you are not including the DFHCOMMAREA the system will automatically include it in the program.

If your program uses a Psued0-conversational then You also include the COMMAREA option to name the area of working storage that will be stored in the CICS communication area between program executions. When the RETURN command is issued in this form, the program associated with the trans-id will be started the next time the user presses an attention key
Back to top
View user's profile Send private message
manoj_madhavan
Warnings : 1

New User


Joined: 07 Mar 2005
Posts: 12

PostPosted: Tue Mar 15, 2005 11:39 am
Reply with quote

but sir ....it is necessary for a commarea declaration only when u pass some value through the commarea...

else is it necessary for a separate definition both in the workin storage as well as linkage section?
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Wed Mar 16, 2005 12:05 am
Reply with quote

Quote:
Is it necessary for a separate definition both in the workin storage as well as linkage section


Yes. if you want to pass X from Program A to B, then

X should be declared in Working Storage Section of Program A and it can be received to a varialbe named DFHCOMMAREA which is declared in the Linkage section of Porgram B.

Code:
?                                                                        ?
?                      Invoking program                                  ?
?   IDENTIFICATION DIVISION.                                             ?
?   PROGRAM ID. 'PROG1'.                                                 ?
?   .                                                                    ?
?   .                                                                    ?
?   .                                                                    ?
?   WORKING-STORAGE SECTION.                                             ?
?   01 COM-REGION.                                                       ?
?       02 FIELD PICTURE X(3).                                           ?
?   .                                                                    ?
?   .                                                                    ?
?   .                                                                    ?
?   PROCEDURE DIVISION.                                                  ?
?       MOVE 'ABC' TO FIELD.                                             ?
?       EXEC CICS LINK PROGRAM('PROG2')                                  ?
?            COMMAREA(COM-REGION)                                        ?
?            LENGTH(3) END-EXEC.                                         ?
?   .                                                                    ?
?   .                                                                    ?
?   .                                                                    ?
?                       Invoked program                                  ?
?   IDENTIFICATION DIVISION.                                             ?
?   PROGRAM-ID. 'PROG2'.                                                 ?
?   .                                                                    ?
?   .                                                                    ?
?   .                                                                    ?
?   LINKAGE SECTION.                                                     ?
?   01 DFHCOMMAREA.                                                      ?
?       02 FIELD PICTURE X(3).                                           ?
?                                                                        ?
?   .                                                                    ?
?   .                                                                    ?
?   .                                                                    ?
?   PROCEDURE DIVISION.                                                  ?
?       IF EIBCALEN GREATER ZERO                                         ?
?       THEN                                                             ?
?           IF FIELD EQUALS 'ABC' ...                                    ?
Back to top
View user's profile Send private message
manoj_madhavan
Warnings : 1

New User


Joined: 07 Mar 2005
Posts: 12

PostPosted: Wed Mar 16, 2005 9:11 am
Reply with quote

i was asking the declaration situation when u dont pass in any parameters.......ie, u dont use commrea for passing values but simply return with a transaction id without any parameters.....

in such a situation is it necessary to have declararion for commarea and dfhcommarea??
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Thu Mar 17, 2005 12:33 am
Reply with quote

Quote:
in such a situation is it necessary to have declararion for commarea and dfhcommarea??


No.
Back to top
View user's profile Send private message
sarma Kappagantu

New User


Joined: 17 Mar 2005
Posts: 22
Location: Bangalore

PostPosted: Thu Mar 17, 2005 11:19 am
Reply with quote

Commarea passed with XCTL & LINK can be 32,673 bytes at the max. (4 bytes less than 32K - 1. However, it is 24K on RETURN command.

CICS Application Programming Guide specifies that "The length of a COMMAREA on a RETURN command can vary from transaction to transaction, up to a theoretical upper limit of 32,763 bytes. However to be safe, you should not exceed 24KB ?, because of a number of factors that can reduce the limit from the theoretical maximum.?

If you wish to pass more than 24 KB, you may use BTS container, if the version of CICS is CICS TS1.3 or higher.
Back to top
View user's profile Send private message
kavi

New User


Joined: 03 Mar 2005
Posts: 2

PostPosted: Thu Mar 17, 2005 3:30 pm
Reply with quote

You can use getmain to get the maximum address and by pointer reference you can acess the data.

The size of the DHFCOMMAREA is 64kb and it is not 32 kb reply to me if i am wrong.
Back to top
View user's profile Send private message
raguibmm

New User


Joined: 16 Mar 2005
Posts: 4

PostPosted: Thu Mar 17, 2005 8:12 pm
Reply with quote

Commarea passed with XCTL & LINK can be 32,673 bytes at the max. (4 bytes less than 32K - 1. However, it is 24K on RETURN command.

CICS Application Programming Guide specifies that "The length of a COMMAREA on a RETURN command can vary from transaction to transaction, up to a theoretical upper limit of 32,763 bytes. However to be safe, you should not exceed 24KB ?, because of a number of factors that can reduce the limit from the theoretical maximum.?

If you wish to pass more than 24 KB, you may use BTS container, if the version of CICS is CICS TS1.3 or higher.



what is bts container?
Back to top
View user's profile Send private message
sarma Kappagantu

New User


Joined: 17 Mar 2005
Posts: 22
Location: Bangalore

PostPosted: Fri Mar 18, 2005 10:11 am
Reply with quote

Lentgth of commarea is not 64K, because the variable used is S9(04) COMP, which can not hold a value higher than 32,677.

Coming to the other issue of using GETMAIN and passing the pointer to pass a larger than 24KB, data - It is OK as long as the two programs communicating are in the same CICS region. However, it fails the moment the other program happens to be in a different CICS region.
Back to top
View user's profile Send private message
UNIVERSE

New User


Joined: 15 Mar 2005
Posts: 11
Location: Mumbai

PostPosted: Fri Mar 18, 2005 4:25 pm
Reply with quote

If ur cics Program is not calling any program/ Invoking any Transaction, there is no need to go for the concept DFHCOMMAREA & LINKAGE SECTION. It becomes the normal CICs pgm.

Regards
UNIVERSE

[quote="ganmain"]HI,
I want to know why we are declaring commarea in both working
storage & linkage section(dfhcommarea).

if my cics program is not calling another program
only commarea declaring in working storage section is enough
or
we have to declare both in working storage & linkage section ?

please clarify this doubt[/quote]
Back to top
View user's profile Send private message
sarma Kappagantu

New User


Joined: 17 Mar 2005
Posts: 22
Location: Bangalore

PostPosted: Fri Mar 18, 2005 7:02 pm
Reply with quote

1. If ur cics Program is not calling any program/ Invoking any Transaction, there is no need to go for the concept DFHCOMMAREA & LINKAGE SECTION. It becomes the normal CICs pgm.

Ans: I believe, generally one will encounter only pesudo-conversational programs and not conversational programs. In a pesudo-conversational program, one should terminate a transaction after sending a screen and specify the next tran to be invoked. Hence, if you wish to write any reasonable program, even with a single screen, you will have to use COMMAREA and DFHCOMMAREA.


2. I want to know why we are declaring commarea in both working
storage & linkage section(dfhcommarea).

Ans: There are a few points to remember here.
(a) In CICS we can pass only one variable to the other program / transaction.

(b) The receiving variable (that receives data from other program / transaction is a variable called DFHCOMMAREA in LINKAGE section. (So, if your program is going to receive some data from other programs / transactions, you shold define DFHCOMMAREA in linkage section.)

(c) generally we do not manipulate DFHCOMMAREA. Another variable is created in WORKING-STORAGE section with the same size as DFHCOMMAREA and data is moved into that variable, before the program uses it and manipulates it.

(d)To pass data from your program to another program, you should have one variable in your program that can hold data that can be used in the XCTL / LINK / RETURN command's COMMAREA option, to pass data. Name of this variable can be any thing, as long as it is an acceptable variable in the host language.


Hence, you are using DFHCOMMAREA variable in LINKAGE section and COMMAREA option in the program. You can use any variable to hold the data that needs to be passed to the other program.
Back to top
View user's profile Send private message
chaitanyav

New User


Joined: 13 May 2008
Posts: 3
Location: Hyderabad

PostPosted: Thu Dec 18, 2008 4:56 pm
Reply with quote

mainframemouli wrote:
Even if you are not including the DFHCOMMAREA the system will automatically include it in the program.


Mouli,

1)
You mean to say even if we include DFHCOMMAREA in the program or not, system will automatically include this in the program linkage section right ?

In case if we include the DFHCOMMAREA in the program does the system will include it again or first the system will check whether the DFHCOMMAREA is included in the program or not and if not then only it will include right ?
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Dec 19, 2008 2:14 am
Reply with quote

There seems to be some confusion on this. Let me try to set the record
straight.

The maximum size of a commarea is 32767, same as maximum size of TSQ or TDQ record.

It is a common practice to limit the size to 32500, but 32767 will work
if needed.

If your CICS program issues:
EXEC CICS RETURN TRANSID('XXXX') commarea(WS-AREA)
EXEC CICS LINK commarea (WS-AREA)
EXEC CICS XCTL commarea (WS-AREA)

you do not need need to specifically define DFHCOMMAREA in linkage section. UNLESS the same program is the recipient of a commarea

This is all basic CICS stuff and explained in many manuals.



as for the original posting on this topic


[/quote]The size of the commarea is 64 kb if i want to store more than that means is it possible or not.
Quote:



64kb is invalid, if you want to store more than 32767 bytes, then either use channels/containers >>
www.redbooks.ibm.com/redbooks/pdfs/sg247227.pdf

or Temporary Storage Queues
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Dec 19, 2008 2:24 am
Reply with quote

Quote:
generally we do not manipulate DFHCOMMAREA. Another variable is created in WORKING-STORAGE section with the same size as DFHCOMMAREA and data is moved into that variable, before the program uses it and manipulates it


FYI: AREAS in a COBOL WORKING STORAGE are known as fields,
and are fixed length. They are not the same as variables found in languages such as JAVA and XMScript.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Dec 19, 2008 4:25 am
Reply with quote

muthukumarapandian wrote:
Hi,

The size of the commarea is 64 kb if i want to store more than that means is it possible or not.


The maximum size of a commarea is 32,763 (CICS owns the last 4-Bytes of EIBCALEN), even though EIBCALEN is a signed Binary halfword.

If you view it as an unsigned Binary halfword, then yes, it can have a maximum of X'FFFF' (decimal 65,535). However, it is signed and therefore, has a maximum of X'7FFF', minus 4.

Carefully review the following LINK as it discusses the COMMAREA alternative, which is ===> CONTAINERS -

ibmmainframes.com/viewtopic.php?p=164265&highlight=#164265

Regards,

Bill
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Dec 19, 2008 5:10 am
Reply with quote

Quote:
The maximum size of a commarea is 32,763 (CICS owns the last 4-Bytes of EIBCALEN), even though EIBCALEN is a signed Binary halfword.


Bill, I stand corrected.


Thanks,
Earl
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 db2 vs static data COBOL Programming 1
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts External data queue (changes?) CLIST & REXX 0
No new posts Pull data using date difference betwe... DB2 6
No new posts fast data scrambling PL/I & Assembler 10
Search our Forums:

Back to Top