Focal Point
WebFOCUS calling a mainframe COBOL DB2 subroutine

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5451042902

January 24, 2007, 10:37 AM
R Veit
WebFOCUS calling a mainframe COBOL DB2 subroutine
I had a WebFOCUS focexec that called a mainframe COBOL IDMS subroutine and it worked just fine. That subroutine has since been converted to COBOL DB2 and the focexec no longer works. I have opened a case with IBI and it has been sent to the product division but I'm hoping someone else may have some experience with this.

When I tested it through WebFOCUS, it brought down the EDA server so we then tested it with mainframe FOCUS. We got the following error:
DSNT408I SQLCODE = -927, Error: THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED. I verified the COBOL module was link edited with and INCLUDE issued for DB2(DSNELI).

We also tried CALLDB2 and were able to get that to work but the subroutine had to be link edited to DSNALI, which our tech support people would rather not do.

Does anyone know what has to be done differently to call a DB2 subroutine versus an IDMS subroutine? Any help would be appreciated.

Becky


7.6.11 on Win 2003/IIS 6/Apache Tomcat 5.5 - MRE, ReportCaster
Reporting Server z/OS 1.11, PDS Unified
Excel, PDF, HTML
February 19, 2007, 09:43 AM
Kerry
FYI to all,

Becky opened a case with Information Builders' Customer Support Services and received a working solution as following (many thanks to Becky for kindly sharing with all Big Grin):


In order to get the CALLDB2 to work, two changes had to be made on the COBOL subroutine side. First, the program was link edited with DSNALI interface as required by the CALLDB2 command. We were still getting -927 THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED. So, secondly, a CBL NODYNAM statement was added to the COBOL program and relinked with the DSNALI interface.

This allowed the CALLDB2 command to work and then it was a matter of playing with the format length of the subroutine output to get back what we needed. I made the parameter I passed to be the same length as what needed to be returned from the subroutine. Below is the WebFOCUS code that eventually worked.

-MRNOEDIT BEGIN
-SET &DCN = '01234567';
-SET &BLNK99 = ' ';
-SET &PARM = '' || DSNSB9A2P || &DCN || &BLNK99 || '';

SQL DB2 SET AUTOCLOSE ON FIN
-RUN

-SET &RUNSUB = CALLDB2('DCNSB9A2','SDCNPB01',&PARM);
-RUN
-SET &LNAME = SUBSTR(116, &RUNSUB, 52, 69, 18, 'A18');
-SET &NAME_SFX = SUBSTR(116, &RUNSUB, 70, 72, 3, 'A3');
-SET &FNAME = SUBSTR(116, &RUNSUB, 73, 84, 12, 'A12');
-SET &MNAME = SUBSTR(116, &RUNSUB, 85, 96, 12, 'A12');
-SET &DOB = SUBSTR(116, &RUNSUB, 97, 104, 8, 'A8');
-SET &RACE = SUBSTR(116, &RUNSUB, 105, 106, 2, 'A2');
-SET &SEX = SUBSTR(116, &RUNSUB, 107, 107, 1, 'A1');
-SET &SSN = SUBSTR(116, &RUNSUB, 108, 116, 9, 'A9');

SQL DB2 SET AUTOCOMMIT ON COMMAND
-RUN

-MRNOEDIT END


Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.