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
):
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.