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
 

 

DB2 -981 crashes one cobol program with no affect on another

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

New User


Joined: 26 Feb 2012
Posts: 3
Location: Chicago

PostPosted: Tue Feb 28, 2012 5:57 am    Post subject: DB2 -981 crashes one cobol program with no affect on another
Reply with quote

Hi, this is my first post here.

I have a cobol DB2 programA compiled with NODYNAM that gets a sql -981 when executed.

-981 says (THE SQL STATEMENT FAILED BECAUSE THE RRSAF CONNECTION IS NOT IN A STATE THAT
ALLOWS SQL OPERATIONS).

I have another cobol DB2 programB that executes perfectly when compiled with NODYNAM.

Both programs are compiled, linked, bound and executed using the same JCL.

I have to use NODYNAM because I am calling the setenv module that sets environment variables and creates datasets from COBOL versus from JCL. IBM requires NODYNAM.

ProgramA crashes on the first DB2 statement.
ProgramB fly's right threw the first DB2 statement. The DB2 statement is the same in both programs.

When I remove NODYNAM and rerun ProgramA it runs successfully. When I put the NODYNAM back it crashes with -981 again.

Can anyone make suggestions to help me here ?

Thanks a million in advance.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Feb 28, 2012 8:09 am    Post subject:
Reply with quote

how are you making the RRASF connection?
in both cases?
Back to top
View user's profile Send private message
anthonykitmcinnis

New User


Joined: 26 Feb 2012
Posts: 3
Location: Chicago

PostPosted: Tue Feb 28, 2012 8:55 am    Post subject:
Reply with quote

I am not certain.
After seeing the sqlcode description I searched RRASF and saw someone was connecting using the following inside a cobol program:

CALL 'DSNRLI' USING IDFYFN SSNM RIBTPR EIBPTR STARTECB RETCODE REASCODE.

CALL 'DSNRLI' USING SIGNONFUNC CORRID ACCTTKN ACCTINT
RETCODE REASCODE.

CALL 'DSNRLI' USING CREATETHREADFUNC PLAN COLLID REUSE RETCODE REASCODE.


I am not sure what these calls do however I do know that nothing like this is done inside my program.

Does that help ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Feb 28, 2012 9:14 am    Post subject:
Reply with quote

yes you are correct,
the code is used to connect to RRS.

so, does the module that runs ok CALL this cobol module that you found?

normally, a site is smart enough to create one module that is CALLed
to accomplish the connect.
your site apparently is not one.

if you are really interested in learning about RRS, the books found at this link will explain.

I would suggest that you mention to whoever is in charge of making important decisions at your site,
to create a CALLable module which makes the connect,
otherwise you will need to replicate the working-storage,
and the access of the plan, ssid, and other values required in making the connection
as well as the code to CALL the attachment facility and handle any error codes involved.

you are in a truly terrible situation with what appears to be dumb-ass managers.

either that, or you have not been listening to your lead programmers.

good luck.

by the way, for a price, i can provide a CALLable module.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Feb 28, 2012 9:30 am    Post subject:
Reply with quote

by the way, what different resources is your program using?

db2
mqs
ims

??????
Back to top
View user's profile Send private message
anthonykitmcinnis

New User


Joined: 26 Feb 2012
Posts: 3
Location: Chicago

PostPosted: Tue Feb 28, 2012 10:09 am    Post subject:
Reply with quote

Both programs make a quick db2 select to make sure a date read from a file is properly formatted.

After that programB calls the putenv c program to set an env variable to create a dataset. ProgramB Then loops and write a timestamp to the new dynamically created dataset. This This program is compile nodynam.

ProgramA also makes a quick DB2 select to format a date also however it crashes on the -981 during this select. I am at a second job right now and cannot view the code at my day job however I am very certain nothing happens in this program accept db2 selects and sequential dataset writes.

ProgramA has to be compiled nodynam just like programB. I use the same compile and bind jcl for each. I use the same jcl to execute them.

When I get to my day job in the morning I will confirm that nothing is happening other than db2. I wrote so I am already certain of it though.

Does this help ?

Thanks so much for responding.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Feb 28, 2012 10:22 am    Post subject:
Reply with quote

yes it does.

rrsaf is used when you use more than one resource (db2, mqs, ims,...)
since you are only using db2
you can make a simple CAF connection
(IKJEFT.., with a dsn parm)

though dynam and nodynam may affect your putenv bs,
it has no effect on the connect you make with db2.

i would suggest talking to your co-workers, lead programmers
as all this stuff is really, very basic.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Feb 28, 2012 12:26 pm    Post subject:
Reply with quote

additional notes:

you are CALLing db2 with thru DSNRLI (rrsaf connection) instead of DSNALI (CAF interface)

this could be due to either
the TSO ATTACH parameter in you pre-compile
or pointing to the incorrect load library.

again,
you need to find out your site standards.
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 DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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