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

Issues after online called from Batch


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

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Thu Jul 28, 2011 3:04 pm
Reply with quote

Hi,
The requirement is: An online program has to perform web service calls to get some data from external system. This is achieved by manually triggering the transaction in the online region. The requirement is to automate the process such as code a batch program to call online program with some parameters and schedule the batch program. To achieve this, a new batch and online programs have been developed. The call to online program is successful (the online program is triggered and able to debug through intertest). But the issue I am facing is, the COMMAREA which is passed from batch is not captured in online and EIBCALEN is 0 (which means no data received).
I am not sure what could be the issue? Please guide me.

The call to online from batch is as follows
Code:

LINKAGE SECTION.                                 
 01  DFHCOMMAREA.                                 
     05 WS-REG-NAME                 PIC X(2).     
     05 WS-MTH-END-DATE             PIC 9(6).     
     05 WS-RET-CODE                 PIC 9(2).     
     05  FILLER            PIC X(110).             

Procedure division.
EXEC CICS LINK PROGRAM(WS-PGM-NAME)           
               APPLID(WS-APPLID)               
               TRANSID(WS-TRANID)             
               COMMAREA(DFHCOMMAREA)           
               LENGTH(WS-COMMAREA-LTH)         
               RETCODE(EXCI-EXEC-RETURN-CODE) 
               SYNCONRETURN                   
END-EXEC.     


Online program linkage section:
Code:

 LINKAGE SECTION.                                             
/                                                             
 01  DFHCOMMAREA.                                               
     05  WS-REG-NAME           PIC X(02).                     
     05  WS-MNTH-END-DATE      PIC 9(06).                     
     05  WS-RET-CODE           PIC 9(02).                     
     05  FILLER                PIC X(110).                   
     EJECT                                                   
/                                                             
 01 SOAP-RESPONSE-BODY.                                       
    02 FILLER               PIC X OCCURS 1 TO 100000         
                                DEPENDING ON DOCUMENT-SIZE.   
                                                             
 01 AUI-RESPONSE-BODY.                                       
    02 FILLER               PIC X OCCURS 1 TO 100000         
                                DEPENDING ON AUI-DOC-SIZE.   


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: Thu Jul 28, 2011 4:12 pm
Reply with quote

Have your CICS Sysprog or Tech Support personnel ensure that whatever the value of WS-TRANID is defined, that it points to program DFHMIRS in the PCT entry. Ensure this PCT entry uses transid CPMI as a template.

Just as a precaution, there's also a DATALENGTH keyword for EXCI/DPL and it must be the same value as the commarea-length.

To trace it, issue a CEDX "Your Transid Name" on the CICS (server side), then invoke the Batch JOB. A CEDX session will then be started.

HTH....

Bill
Back to top
View user's profile Send private message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Thu Jul 28, 2011 5:19 pm
Reply with quote

Thank you Bill.
I will check if the tranid is pointing to the transaction I am using and get back to you.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Jul 30, 2011 12:57 am
Reply with quote

cicswiki.org/cicswiki1/index.php?title=How_do_I_interact_with_a_transaction_from_a_batch_program%3F
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Jul 30, 2011 1:00 am
Reply with quote

how is WS-COMMAREA-LTH field defined in your batch program AND
did you move a value to it before the batch link is performed ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 30, 2011 1:34 am
Reply with quote

If this is truly your batch program call to the online module, it is very wrong:
Code:
LINKAGE SECTION.                                 
 01  DFHCOMMAREA.                                 
     05 WS-REG-NAME                 PIC X(2).     
     05 WS-MTH-END-DATE             PIC 9(6).     
     05 WS-RET-CODE                 PIC 9(2).     
     05  FILLER            PIC X(110).             

Procedure division.
EXEC CICS LINK PROGRAM(WS-PGM-NAME)           
               APPLID(WS-APPLID)               
               TRANSID(WS-TRANID)             
               COMMAREA(DFHCOMMAREA)           
               LENGTH(WS-COMMAREA-LTH)         
               RETCODE(EXCI-EXEC-RETURN-CODE)
               SYNCONRETURN                   
END-EXEC.
1. You pass DFHCOMMAREA, yet you reference the length of WS-COMMAREA-LTH. There is no way to ensure that these values are synchronized.

2. DFHCOMMAREA is in the LINKAGE SECTION. You did not show us, nor indicate anywhere, how the lLINKAGE SECTION items in the batch program are given addressability. Remember, LINKAGE SECTION is used for variables that are defined (hence the storage for them is located) in another program. Unless another program is calling your batch program and your batch program has PROCEDURE DIVISION USING DFHCOMMAREA coded -- or you acquire storage (e.g., through LE) and set a pointer variable to address DFHCOMMAREA -- your code is guaranteed to fail.

3. The interface routines such as FEPI and EXCI are there for a purpose. In not using them, you vastly raise the chances that your programs will fail -- possibly spectacularly -- by a great deal.
Back to top
View user's profile Send private message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Fri Aug 26, 2011 12:11 pm
Reply with quote

@Bill,
It took sometime to check this and get back to you. After my program is made to point to DFHMRIS it started working fine and even I could debug the program with the help of CICS Support person.

Thank you.
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
No new posts Issues with VIEW DATASET Command CLIST & REXX 2
Search our Forums:

Back to Top