Page 1 of 1

Getting the data through CICS Retrieve from different region

PostPosted: Sun Mar 04, 2012 11:41 am
by deen67
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

Re: Getting the data through CICS Retrieve from different re

PostPosted: Sun Mar 04, 2012 6:50 pm
by Robert Sample
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.

Re: Getting the data through CICS Retrieve from different re

PostPosted: Sun Mar 04, 2012 7:46 pm
by deen67
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.

Re: Getting the data through CICS Retrieve from different re

PostPosted: Sun Mar 04, 2012 9:30 pm
by Robert Sample
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.

Re: Getting the data through CICS Retrieve from different re

PostPosted: Mon Mar 05, 2012 5:36 am
by deen67
thanks for advice & guideline. will debug my program again to see the response-code that i overlooked. thanks again.