Getting the data through CICS Retrieve from different region



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Getting the data through CICS Retrieve from different region

Postby deen67 » Sun Mar 04, 2012 11:41 am

Program A & B are written in C language and works perfectly.
Program A
EXEC CICS START TRANSID(ABCD)
INTERVAL(0)
FROM (WS-ARRAY)
LENGTH (SOME-LENGTH);

Program B
EXEC CICS RETRIEVE
set(dfheptr) commarea(pcomptr)

my problem is when i try to change prog B to COBOL, no data retrieved. always get garbage. my eibcalen is 0,resp & resp2 are 0.
EXEC CICS RETRIEVE
INTO (WS-ARRAY)
LENGTH(LENGTH OF WS-ARRAY)
END-EXEC.

and try this also, still no luck
EXEC CICS RETRIEVE
SET ADDRESS(WS-ARRAY)
LENGTH(LENGTH OF WS-ARRAY)
END-EXEC.

any helps/advice are welcome. thanks
deen67
 
Posts: 10
Joined: Mon Jul 11, 2011 2:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting the data through CICS Retrieve from different re

Postby Robert Sample » Sun Mar 04, 2012 6:50 pm

I think you have a very fundamental misconception. If you are using EXEC CICS START FROM and EXEC CICS RETRIEVE, the expected value for EIBCALEN will be ZERO. You have no DFHCOMMAREA, so the DFHCOMMAREA length should be zero. Retrieve fetches data but not from a DFHCOMMAREA.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Getting the data through CICS Retrieve from different re

Postby deen67 » Sun Mar 04, 2012 7:46 pm

robert, thanks for reply. truly speaking i'm new in cobol cics. any help much appreciated, is there any site/links that can help me about this. already look at public.boulder.ibm.

The RETRIEVE command retrieves data stored by expired START commands. It is the only method available for accessing such data.
deen67
 
Posts: 10
Joined: Mon Jul 11, 2011 2:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Getting the data through CICS Retrieve from different re

Postby Robert Sample » Sun Mar 04, 2012 9:30 pm

Your best bet would be to find and take a training course; hands-on experience can be very beneficial. If a training course is not possible, there are books about CICS on the market. Or, you could find some CICS COBOL programs at your site and study how they are put together.

One basic flaw your posted code has: there's no RESPONSE variable coded. You should get in the habit of using RESPONSE for every CICS command. If you use CEDF to debug your program, you can see the RESPONSE value for each CICS command and sometimes the response code alone tells you what the problem is. And without knowing the RESPONSE code, it is impossible to say what your problem is since the CICS Application Programming Reference manual lists SIX possible error responses for EXEC CICS RETRIEVE.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Getting the data through CICS Retrieve from different re

Postby deen67 » Mon Mar 05, 2012 5:36 am

thanks for advice & guideline. will debug my program again to see the response-code that i overlooked. thanks again.
deen67
 
Posts: 10
Joined: Mon Jul 11, 2011 2:47 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post