Page 1 of 1

about commarea

PostPosted: Tue Apr 06, 2010 6:35 pm
by pradeepgowda
what happens if length in 01 DFHCOMMAREA is less than the length passed through commarea option

eg:
PGM A:
01 ws-comm pic x(30).

exec cics return
transid('ppre')
commarea(ws-comm)
end-exec

PGM B:
linkage section
01 DFHCOMMAREA
05 ws-lk-comm pix x(15).

Re: about commarea

PostPosted: Tue Apr 06, 2010 6:48 pm
by Robert Sample
1. What do you think happens?
2. What does the manual tell you happens?

Re: about commarea

PostPosted: Wed Apr 07, 2010 11:47 am
by pradeepgowda
i think data truncation will happen. please suggest. i have doubt whether it abends.
it was asked in interview

Re: about commarea

PostPosted: Wed Apr 07, 2010 4:24 pm
by Robert Sample
If the length were longer, you could get an abend but if the length is shorter, there is no reason for an abend. EIBCALEN contains the length passed from the calling program, but your program is not required to access all those bytes -- if you limit the size, you just cannot access the last N bytes (15 in your example).

Re: about commarea

PostPosted: Wed Apr 07, 2010 5:15 pm
by pradeepgowda
thanks Robert