Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Low-values in linkage parameter

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
geetha001

New User


Joined: 19 Nov 2003
Posts: 4

PostPosted: Thu Feb 28, 2013 2:57 am    Post subject: Low-values in linkage parameter
Reply with quote

I have a batch program (1) which calls another onlilne (2) program, which inturn calls another online(3) program. (All programs are COBOL+DB2).

When (1) calls (2), it passes unit of work timestamp value and current timestamp value. The two values are from the same field.

(2) inturn passes these timestamp values to (3). (3) is like the program inserts/updates DB2 tables.
Eg: In (1), I have code as follows

Code:


MOVE TS TO UOW-TS
MOVE TS TO CURR-TS



(3) has to check to see that the row it is updating has a current TS greater than the row's updated TS. But the check was failing, since current TS was having low-values in (3).
The dump shows UOW-TS value, but shows low-values for CURR-TS.

We had two batch jobs executing the same batch program
1. First job, when the job went down because of the above TS check, we did the following steps
- In the first JCL, we added the joblib for DB2.SDSNLOAD library and restarted at the step it abended, but the job failed again.
- Then we restarted the job from top and the job was successful

2. Second job, added the DB2.SDSNLOAD even before the job ran, but the job failed for the same TS check. (that is when we looked at the dump etc.,)
- Restart of the job at the step it abended did not help.

Next night, both jobs included DB2.SDSNLOAD library and both jobs ran fine without any issue (puzzling isn't it?)

I understand that the SDSNLOAD library is actualy required when running some kind of DB2 utility jobs, but somehow the inclusion has helped.

My questions:
1. When or why a linkage value can get corrupted? Could this be related to DB2 library included?

I am trying to find a meaning ful expalnation for this issue, unable to find so far. Also, not able to reproduce this in dev regions because of the way our shop is set up.

Any feedback would be appreciated.

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

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7912
Location: Bellevue, IA

PostPosted: Thu Feb 28, 2013 3:10 am    Post subject:
Reply with quote

Quote:
I have a batch program (1) which calls another onlilne (2) program, which inturn calls another online(3) program. (All programs are COBOL+DB2).

When (1) calls (2), it passes unit of work timestamp value and current timestamp value. The two values are from the same field.

(2) inturn passes these timestamp values to (3).
1. How does the batch program call the online program?
2. Does the online program (2) call program (3) via EXEC CICS XCTL, EXEC CICS LINK, or COBOL CALL?
3. How do the programs (1) and (2) pass data?
4. Are the data areas the same size for the data passed between program (1) and (2)?
5. Are the data areas the same size for the data passed between program (2) and (3)?
6. What are the differences between the development region set up and the production region set up (e.g., transaction isolation, storage protection, and so forth)?

I'm sure more questions will be asked, but these are a way to start narrowing down where the problem is. And if the two timestamps are separate variables, your statement that they are from the same field is not only completely useless, it may actively mislead people into thinking the problem is related to the single field instead of the separate variables.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Feb 28, 2013 3:32 am    Post subject: Reply to: Low-values in linkage parameter
Reply with quote

You can save yourself parm-passing of the Timestamp by using EXTERNAL storage, defined exactly the same way in the WS of all COBOL programs in the call chain. In other words, once the TS is populated into EXTERNAL storage by the highest COBOL caller, it then becomes automatically addressable in all subsequent COBOL programs which you are currently accessing.
Back to top
View user's profile Send private message
geetha001

New User


Joined: 19 Nov 2003
Posts: 4

PostPosted: Thu Feb 28, 2013 3:33 am    Post subject: Reply to: Low-values in linkage parameter
Reply with quote

Quote:

1. How does the batch program call the online program?
2. Does the online program (2) call program (3) via EXEC CICS XCTL, EXEC CICS LINK, or COBOL CALL?
3. How do the programs (1) and (2) pass data?
4. Are the data areas the same size for the data passed between program (1) and (2)?
5. Are the data areas the same size for the data passed between program (2) and (3)?
6. What are the differences between the development region set up and the production region set up (e.g., transaction isolation, storage protection, and so forth)?


1. It is a COBOL call
2. No CICS is involved here, all calls are a COBOL Call
3. Using the COBOL all, as follows
CALL WS-PGM2 USING TS-AREA
ERROR-AREA
DATA-AREA
4. Yes, the same copybook for TS-AREA and ERROR-AREA
5. Development always has a include member, which has all the load libraries and DB2 libraries listed in the include member. In prod we do not have any explicit include members, but in this job we included the joblib for the SDSNLOAD library explicitly.


Quote:

I'm sure more questions will be asked, but these are a way to start narrowing down where the problem is. And if the two timestamps are separate variables, your statement that they are from the same field is not only completely useless, it may actively mislead people into thinking the problem is related to the single field instead of the separate variables.


It is correct that the two timestamps are separate variables, however the value comes from the same field. That is what I meant here.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7912
Location: Bellevue, IA

PostPosted: Thu Feb 28, 2013 3:38 am    Post subject:
Reply with quote

Is your online system CICS or something else?

And you will need to get your site support group involved, so they can research the differences between your production and development online environments.
Back to top
View user's profile Send private message
geetha001

New User


Joined: 19 Nov 2003
Posts: 4

PostPosted: Thu Feb 28, 2013 5:39 am    Post subject: Reply to: Low-values in linkage parameter
Reply with quote

I may need to clarify that by online, I meant COBOL+DB2 modules that can be called from java directly. They are not exactly stored procedures, but our shop has a special structural design to call these COBOL+DB2 modules.

Online in my case is not CICS. If the online term is misleading, may be I should state in more simpler terms, that my issue is with batch program calling other COBOL +DB2 programs.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Feb 28, 2013 6:25 am    Post subject: Reply to: Low-values in linkage parameter
Reply with quote

You're going to need to show some code.

All the relevant CALL statements. All the relevant LINKAGE SECTION definitions and PROCEDURE DIVISION USING. All of these from the compile listings (so any "pre-processor" data is included). All references to the two fields you have mentioned, either individually or at a group level.

Was this "working" before, or is it "new"? If working before, what has changed in any of the programs. Remember you may be facing a combination of data which is revealing a problem which has always existed, but not come to light before. This may explain the "sometimes it works". When you restarted the job from the top, was all data returned to its original state, or was something already partially updated?
Back to top
View user's profile Send private message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Tue Mar 05, 2013 3:55 am    Post subject:
Reply with quote

First question: Is your compile jcl using the DB2 precompiler before it calls the COBOL compiler? HINT: If you see a step PGM=DSNHPC then the answer is yes

Second question: in your subroutine are you using the linkage section variables in your SQL?

If the answer to both questions is yes then you need to change the subroutines to use working-storage variables for the sql. Move the linkage section variable to working-storage variable before the EXEC SQL call.

The reason has to do with the way the precompiler handles the variables and sets a static addresss. If you are using the integrated compiler then this is no longer a problem.

The current Enterprise COBOL compiler allows for the use of an integrated DB2 compiler which does the DB2 and COBOL compilation in one step. Much easier.

Just a thought.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us