Page 1 of 1

Error in calling a program

PostPosted: Tue Oct 01, 2013 11:50 am
by pulsar22
Hi,

I have two pgms PGM1(Cobol-DB2) & PGM2(Cobol). PGM1 calls PGM2 by passing a variable as defined below:
WORKING-STORAGE SECTION.

01 WS-VAR PIC X(80).

PROCEDURE DIVISION.

MOVE ZEROES TO WS-VAR
CALL "PGM2" USING WS-VAR.

=================PGM2==================
LINKAGE SECTION.
01 WS-VAR PIC X(80)

PROCEDURE DIVISION USING WS-VAR.

MOVE 'IBM MAINFRAME' TO WS-VAR
GOBACK.

Both the codes compile successfully, but while executing the code the job abends - ABENDU4095. The reason in sysout is - "The module PGM2 was not found."
I have searched net for reasons for this problem, but everything looks fine. Also, when i called another program from PGM1, job executed fine. help required.

Re: Error in calling a program

PostPosted: Tue Oct 01, 2013 12:06 pm
by BillyBoyo
Most likely is that you are using two different JCL decks to compile/link - one for DB2 and one for non-DB2, and that the non-DB2 is linkedited/binded to a different loadlibrary which is not included on your STEPLIB/JOBLIB (or you don't have STEPLIB/JOBLIB).

Re: Error in calling a program

PostPosted: Tue Oct 01, 2013 1:27 pm
by pulsar22
I am generating these elements in Endevor and the JCLs used are exactly same.

Re: Error in calling a program

PostPosted: Tue Oct 01, 2013 1:38 pm
by BillyBoyo
You'd best show the JCL for the run then, and the full messages for the abend.

Re: Error in calling a program

PostPosted: Thu Oct 03, 2013 3:40 pm
by pulsar22
Thanks for the reply.........i coded new programs(bothe called and calling) and the call is working fine now. Even the earlier calling program was able to call any program other than the required one.

Now I have a new error: both the programs are cobol-db2:
Called pgm executes an sql query and returns the result through linkage area:
I am getting sqlcode = -981
THE SQL STATEMENT FAILED BECAUSE THE RRSAF CONNECTION IS NOT IN A STATE THAT ALLOWS SQL OPERATIONS, REASON reason-code

It loks like it is an issue with bind/package, but i have no idea how to resolve this. Help required.

Re: Error in calling a program

PostPosted: Thu Oct 03, 2013 7:36 pm
by pulsar22
It is something related to DSNRLI, which is for useing RRSAF in programs, can somebody please provide a sample code statement on how to use DSNRLI.
My program is callin another program and the called program queries a table which is not present in the same region i have acces to.Help required.

Re: Error in calling a program

PostPosted: Thu Oct 03, 2013 10:20 pm
by dick scherrer
Hello,

Suggest you speak with your dba about how this might be done on your system.

This is not an issue a developer should be required to resolve.