View previous topic :: View next topic
|
Author |
Message |
paramoberoi
New User
Joined: 26 Oct 2010 Posts: 12 Location: USA
|
|
|
|
Hi
I am writing a CICS program that recieves input buffer =100 bytes from java front end via DFHCOMMAREA and passes back the reply buffer = 1000 bytes via DFHCOMMAREA using RETURN command. I have defined length of DFHCOMMAREA in my program as 1000 bytes.
When my program is invoked EIBCALEN = 100 bytes as expected. If the prog does INITIALIZE DFHCOMMAREA, after reading the input, it gives ASRA - Storage Violation. I believe this is because prog is trying to access bytes 200-1000 of DFHCOMMAREA whereas EIBCALEN is 100.
But if I make the length of DFHCOMMAREA as 100 bytes then I won't be able to write back the 1000 byte response in DFHCOMMAREA. Can you please advice on how to get over this situation?
Thanks |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
If you only receive 100
you can only return 100.
the java front end has to change and pass you 1000.
that's how to get over this situation.......... |
|
Back to top |
|
|
paramoberoi
New User
Joined: 26 Oct 2010 Posts: 12 Location: USA
|
|
|
|
Thanks. Will make that change. |
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
I'm not quite sure about using a JAVA program as trigger, but in a traditional CICS environment it's very easy to overcome these difficulties.
You have mixed up the receiving and the sending part of a common area.
Your program receives a common area. Thus it is defined in the Linkage Section and made addressable by the USING clause on the Procedure Division. But when your program changes its habit and becomes the sending part, i.e. when issuing the RETURN COMMAREA(group-item), it cannot use data from its Linkage Section. On this command you have to use data defined in your Working Storage Section.
This makes it possible to treat both incoming and outgoing common areas completely separate, for example by using different data lengths.
Summarized: Receive into your Linkage Section, send from your Working Storage Section.
Give it a try. |
|
Back to top |
|
|
paramoberoi
New User
Joined: 26 Oct 2010 Posts: 12 Location: USA
|
|
|
|
Hi Stefan , Thanks for your response.
I believe that EIBCALEN (if < DFHCOMMAREA length) sets the "usable" length of the DFHCOMMAREA in program.
When using RETURN command (without COMMAREA option), data has to be passed via the DFHCOMMAREA.
Therefore I agree with Dick Brenholtz's solution that input and output length need to be same.
Cheers
Param |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Stefan:
Quote: |
But when your program changes its habit and becomes the sending part, i.e. when issuing the RETURN COMMAREA(group-item), it cannot use data from its Linkage Section |
This does NOT agree with the Application Programming Guide manual, section 7.3.2.1, which states
Quote: |
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. |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
|