Debugging CICS Applications with EXEC CICS LINK Statements

Use this command in the PL/I debugger before the LINK statement runs to debug called programs in code when the EXEC CICS LINK statement is used.

shlib [pgm].dll

where [pgm] is the name of the program executed with EXEC CICS LINK.

Executing this command before the LINK statement runs raises a load event (signal #6) when the program loads prior to execution.

This program contains a link to the program PGMB using EXEC CICS LINK.

PGMA: proc(comm_ptr) options(main,reentrant) reorder;
  dcl comm_ptr pointer;
  dcl data_lngth        fixed bin(15) init(100);
  dcl commarea char(100) based(comm_ptr);

  if eibcalen = 0 then
    do;
      alloc commarea set(comm_ptr);                      
      commarea = '%from pgma';
    end;
  else;

  exec cics link
      program('pgmb ')
      commarea(commarea)
      length(data_lngth);

  free commarea;

  exec cics return;
end;

In this sample, executing the command shlib pgmb.dll before the LINK statement runs causes the debug session to raise the load event before the program loads. Once the load event is received, executing the ENV command (in this case ENV pgmb) to the new program allows you to then set one or more breakpoints before continuing execution. Note that shlib works on the filename level, so the file extension is required in the command.