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

Cobol Error while calling one COBOL-CICS program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prem_ibm

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Sun Oct 23, 2011 9:30 pm
Reply with quote

Hi

I got little strange Error while using Cobol cics program,Inside the Main COB-CICS-DB2 programe we are calling so many programe and while calling one COBOL-CICS programe from the main programe..we got cics response NORMAL..inside that programe we had some logic based on some validation its setting 000 value for 88 level variable and the same 88 variable we are using after call return successfull to main programme and once we are getting Response Normal.

After that we are checking that 88 level variable like below

IF ws-return-status
Perfrom xyz para

Main point :- but we were getting space in that field rather then getting 000 or other then 000 like 002,003 which indiacte casue of our validaion inside of that called programe.

We tried in all ways finally when we change the copy book level issue got resolved.

like earlier all programe copy books present under one 01 level like below

01 GRP
COPY XYZ
COPY ABC
.
.
.
COPY WPW

Finally we change our copy book COPY ABC in another 01 level like below

01 GRP
COPY XYZ

.
.
.
COPY WPW

01 GRP
COPY ABC

then we got status 000 for that 88 level variable..

this is the temporary fixed we have done...still we have to fix permanent
expert please advise on this what wil be the cause for this type of scenario
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: Sun Oct 23, 2011 10:12 pm
Reply with quote

From what I can tell, it might be a WS initialization issue in the CALLED sub-program.

If the WS fields have a VALUE clause and you'd like the VALUE to take effect every time the sub-program is CALLED, then specify -

PROGRAM-ID. "program-name" IS INITIAL.

Mr. Bill
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Oct 23, 2011 10:58 pm
Reply with quote

Can you show us the LINKAGE SECTION of the called program, its PROCEDURE DIVISION USING and the definitions (expanded, not the copybook name) of all the data passed to the called program and the CALL statement.

I assume you changed the CALL, LINKAGE SECTION and the PROCEDURE DIVISION USING for your temporary fix, so please show those as well.
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: Sun Oct 23, 2011 11:51 pm
Reply with quote

Bill,

Glad you were able to decipher this....

Mr. Bill
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 24, 2011 1:10 am
Reply with quote

I was thinking if field A is set in prog B, prog B returns to prog A and field A does not have the value in, then A in prog A is not in the same place as A in prog B.

It looks like there are a load of copybooks under one 01-level. Something is messed-up with this arrangement prior to the copybook with A in. Seperating A form the 01-level and giving it a new 01 (and presumablly doing all the right stuff to be able to use it in prog B) works.

I'd bet that the displacement of A from the 01 it is subordinate to in the Linkage is different form the displacement of A from the 01 it is subordinate to in the Working-Storage of the caller.

That's the easiest thing I can think of that fits what we know. Either order of copybooks different (something below the A copybook in one program, above it in the other) or an extra non-copybook field or just copybooks out of step with a change of length. We'll see, I suppose, if TS gets back to us.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 24, 2011 1:30 am
Reply with quote

why waste time trying to figure out what these rookies did,
until they tell us exactly what was the situation before and after.

if they even know.
Back to top
View user's profile Send private message
prem_ibm

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Mon Oct 24, 2011 5:01 pm
Reply with quote

Thanks a lot to all the Senior Members who has replied to my query by spending their precious time.

1) i have checked in Production for 01 Level...but all the programe have
same type of declaration as i coded in my pgm.
later i added my copybook which causing error under new 01
Level.Except this change i have not changed in Linkage
Secton,Procedure devision etc.

2) i have initialized the copybook variable in main programe.

3) We are moving & seting address as below before call the Sub
programe (called module).

MOVE WL-XYZ TO NJP5500W-STG-ID

SET NJP5500W-COMM-ADDR TO ADDRESS OF COMM-WORK-REC

PERFORM L500-NJPGPRM

IF YHXGPRM-RTUN-NOT-AVAIL
PERFORM PARA XYZ


4) Linkage section of called module (programe).
LINKAGE SECTION.
01 DFHCOMMAREA.
COPY NJP5500W.

Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 24, 2011 5:22 pm
Reply with quote

whew! sure glad that was cleared-up.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 24, 2011 5:25 pm
Reply with quote

prem_ibm wrote:
[...]

MOVE WL-XYZ TO NJP5500W-STG-ID

SET NJP5500W-COMM-ADDR TO ADDRESS OF COMM-WORK-REC

[...]


If NJP5500W-COMM-ADDR is your 01-level, what was it addressing at the time you did the MOVE of WL-XYZ? Unless it was already pointing to COMM-WORK-REC, then you have left NJP5500W-STG-ID behind in the original location.

Code:
01 A at address abcd.
    05  B PIC X.
put something in B.
change address of A.
01  A at new address, efgh.
    05  B PIC X.
B now contains some unknown value.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Error when install DB2 DB2 2
Search our Forums:

Back to Top