How to Call SQL in PL/I Program

SQL Query to UPDATE in PL/I

EXEC SQL UPDATE DSN8A10.DEPT

SET MGRNO = :MGR_NUM WHERE DEPTNO = :INT_DEPT ;

  • The above SQL statement you can use in your PL/I program. The terms EXEC and SQL should be in one line.
  • If you need you can use comments in between SQL statements.

You can use DCLGEN member in PL/I

EXEC SQL INCLUDE member-name;

We should not use PL/I pre-processor commands “%” in between SQL statement.

Keep Reading

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.