Error in calling a program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Error in calling a program

Postby pulsar22 » Tue Oct 01, 2013 11:50 am

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.
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Error in calling a program

 

Re: Error in calling a program

Postby BillyBoyo » Tue Oct 01, 2013 12:06 pm

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).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Error in calling a program

Postby pulsar22 » Tue Oct 01, 2013 1:27 pm

I am generating these elements in Endevor and the JCLs used are exactly same.
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Error in calling a program

Postby BillyBoyo » Tue Oct 01, 2013 1:38 pm

You'd best show the JCL for the run then, and the full messages for the abend.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Error in calling a program

Postby pulsar22 » Thu Oct 03, 2013 3:40 pm

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.
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Error in calling a program

Postby pulsar22 » Thu Oct 03, 2013 7:36 pm

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.
pulsar22
 
Posts: 34
Joined: Mon Sep 09, 2013 12:39 pm
Has thanked: 14 times
Been thanked: 0 time

Re: Error in calling a program

Postby dick scherrer » Thu Oct 03, 2013 10:20 pm

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.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
pulsar22 (Wed Oct 09, 2013 7:51 pm)
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 92 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post