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
 

 

s0c1 abend while executing SQL statement.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
dilip_kumar

New User


Joined: 01 Oct 2011
Posts: 3
Location: india

PostPosted: Fri Oct 14, 2011 11:23 pm    Post subject: s0c1 abend while executing SQL statement.
Reply with quote

Hi,

I am receiving a S0C1 abend while executing db2 sql statement in PGM-B.

EXEC SQL
SET :WS-TIMESTAMP = CURRENT TIMESTAMP
END-EXEC.

WS-TIMESTAMP is declared as ws variable with X(26).

This PGM-B is a called program in PGM-A.

I compiled PGM-B, did bind and then compiled PGM-A, did bind.

After the above steps I executed PGM-A, its abending with s0c1 in PGM-B.

Please provide your valuable suggests.

Thanks & regards,
Dilip
Back to top
View user's profile Send private message

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Fri Oct 14, 2011 11:36 pm    Post subject: Reply to: s0c1 abend while executing SQL statement.
Reply with quote

There is something wrong with your compile or linkedit (or your program). Show us your linkedit output. And show us the details of your abend (PSW, registers, etc...)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Oct 15, 2011 12:01 am    Post subject:
Reply with quote

could be he is making a dynamic call in A (for B), but B is not compiled/linked to be dynamically called.
Back to top
View user's profile Send private message
dilip_kumar

New User


Joined: 01 Oct 2011
Posts: 3
Location: india

PostPosted: Sat Oct 15, 2011 3:51 pm    Post subject: Reply to: s0c1 abend while executing SQL statement.
Reply with quote

Yes, PGM-B is dynamically called, in the sense its initialized value with the PGM-B for ws-variable.

01 WS-PGM-B PIC X(05) VALUE 'PGM-B'.


Call PGM-B USING DFHEIBLK
DFHCOMMAREA
WS-VARIABLES.

And in PGM-B.

PROCEDURE DIVISION USING WS-VARIABLES.

I use chageman tool to compile the programs, first I compile PGM-B and bind and then compile PGM-A and bind.

Unfortunately, I cannot access internet in the machine I program, so I cannot paste the contents of registers and abend info.

Kindly advice.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Oct 15, 2011 4:07 pm    Post subject:
Reply with quote

this really is not a db2 problem.

the CALL USING list suggests that this is a CICS program.

the PROCEDURE DIVISION USING list,
if that is what is in the compile listing,
indicates an inproperly pre-compiled/compiled program.

we need much more infomation,
since the TS apparently has no desire to work with his co-workers
(or possibly they with him/her),
and this
Quote:
Yes, PGM-B is dynamically called, in the sense its initialized value with the PGM-B for ws-variable.
indicates that this thread maybe long and frustrating.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sat Oct 15, 2011 4:28 pm    Post subject: Reply to: s0c1 abend while executing SQL statement.
Reply with quote

There is something you are missing/doing which others at your site are doing correctly. Sit down with a colleague and go through what you are doing/they are doing.

What it "sounds" like is happening is that your B is not compiled DYNAM but your link/bind is only expecting dynam so the address for a call is not "resolved", so remains zero, so S0C1 (PSW finishes with 00000002 doesn't it?) when your program attempts the call to do the SQL. dbz already aluded to this, but it hasn't had much impact yet.

Without being able to see all the output from everything, all the libraries, and - ideally an equivalent that is working as well - then I don't see that we can get you much further with it.

In short, you're doing it different than others at your site. If you do it the same, it'll work. The best (and possibly only) way to find the difference is to talk to a colleague who has one that is working...
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Sun Oct 16, 2011 12:46 am    Post subject: Reply to: s0c1 abend while executing SQL statement.
Reply with quote

It looks like Dynamic call is not proper. Check PROCEDURE DIVISION USING -------- properly.

This Issue could be linking issue.


Quote:
Call PGM-B USING DFHEIBLK
DFHCOMMAREA
WS-VARIABLES
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sun Oct 16, 2011 1:06 am    Post subject: Re: Reply to: s0c1 abend while executing SQL statement.
Reply with quote

vasanthkumarhb wrote:
It looks like Dynamic call is not proper. Check PROCEDURE DIVISION USING -------- properly.

This Issue could be linking issue.


Quote:
Call PGM-B USING DFHEIBLK
DFHCOMMAREA
WS-VARIABLES


It could be a linking issue, but I'm not sure you mean that. I think you mean a "linkage" issue.

The CALL looks like a CALL for a CICS program.

The PROCEDURE DIVISION USING looks like the source would look before it has been through the CICS pre-processor. If this is how the PROCEDURE DIVISION USING looks on the compile listing, then it is wrong, for CICS anyway.

However, that is not in itself going to give a S0C1.

Further however, if using the wrong Compile method (no pre-processor) it is probably also using the wrong link-edit method.

Further further however, without feedback from the TS about a lot of specifics dragged out one-at-a-time all we can do is speculate.

Getting hold of the timestamp is far from being a complex thing. TS has done something wrong in their pre-process/compile/link/bind and we can't say much more than that. Might not even be a CICS program, who knows? TS.
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Sun Oct 16, 2011 1:24 am    Post subject:
Reply with quote

Yes i meant linkage issue b/w two programs. Thanks Bill for more info.
Back to top
View user's profile Send private message
dilip_kumar

New User


Joined: 01 Oct 2011
Posts: 3
Location: india

PostPosted: Sun Oct 16, 2011 1:42 am    Post subject: Reply to: s0c1 abend while executing SQL statement.
Reply with quote

Hi all,

Just to summarize the whole thing what I am trying to do,


PGM-B is a existing CICS module, PGM-A is a new batch module I have written to fetch some fields from db2 tables of other application through PGM-B.

Now, since PGM-B being a CICS module I compile it using db2 precompile and CICS pre compile and then bind it, and then compile PGM-A only with db2 pre compile only since it is a batch module.

Invoke PGM-A using JCL. To get clear picture of whats going wrong I have display statements in PGM-B just before and after this EXEC SQL statement. the before display is coming but not after display.

In listing of PGM-B, I can see PROCEDURE DIVISION USING WS-VARIABLES, WS-VARIABLES is same as the one used in PGM-A while calling PGM-B.

Please let me know if there is anything wrong with the way am doing..
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sun Oct 16, 2011 1:56 am    Post subject: Reply to: s0c1 abend while executing SQL statement.
Reply with quote

Dilip,

If your program B is going through the CICS pre-processor correctly, then you should see three data-names on the USING statement of the PROCEDURE DIVISION, the pre-processor should generate two items in the LINKAGE SECTION for you and insert those in the USING in front of anything that you supply on the USING.

So I don't see how you end up with just USING WS-...

How were you imagining calling CICS from batch would work?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Sun Oct 16, 2011 2:57 am    Post subject:
Reply with quote

Quote:
Please let me know if there is anything wrong with the way am doing..
Yes, there is plenty wrong with your approach. If you site is running, say 100 CICS regions, just how does your batch program get connected to the correct CICS region?

There are well-defined methods for batch programs to interact with CICS programs -- EXCI and FEPI perhaps being the most common -- but just calling a batch program from a CICS program is pretty much guaranteed not to work. Look up EXCI in the CICS External Interface Guide manual (and does the manual title give you a clue?) or find the Front End Programming Interface manual -- either will do what you want.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am


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