Hi,
I have been experimenting on ways to execute SQL statements for table updates on our DB2 tables in IBM Mainframe. I've started using DSNTIAD, a DB2 utility. With the manner I was using this, the SQL statement is committed one at a time. To illustrate, if I have 10 SQL UPDATEs and the fifth SQL statement has a syntax error, all statements will be executed and committed successfully except for the 5th statement.
Can anyone help me determine how I should set my job or control card so that the SQL changes will only be committed when no errors were encountered? Is there a similar DB2 utility tool available in case DSNTIAD will not be able to handle this?
Sample code:
//DDLEXEC EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB DD DSN=DSNDBL6.SDSNLOAD,DISP=SHR
// DD DSN=DSNDBL6.SDSNEXIT,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN S(DBL6) R(0) T(0)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIAD)
//SYSIN DD *
UPDATE DSN8610.PROJ SET DEPTNO='J01' WHERE DEPTNO='A01';
UPDATE DSN8610.PROJ SET DEPTNO='J02' WHERE DEPTNO='A02';
UPDATE DSN8610.PROJ SET DEPTNO='J02' WHERE DEPTNO='A03';
/*
I have been experimenting on ways to execute SQL statements for table updates on our DB2 tables in IBM Mainframe. I've started using DSNTIAD, a DB2 utility. With the manner I was using this, the SQL statement is committed one at a time. To illustrate, if I have 10 SQL UPDATEs and the fifth SQL statement has a syntax error, all statements will be executed and committed successfully except for the 5th statement.
Can anyone help me determine how I should set my job or control card so that the SQL changes will only be committed when no errors were encountered? Is there a similar DB2 utility tool available in case DSNTIAD will not be able to handle this?
Sample code:
//DDLEXEC EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB DD DSN=DSNDBL6.SDSNLOAD,DISP=SHR
// DD DSN=DSNDBL6.SDSNEXIT,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN S(DBL6) R(0) T(0)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIAD)
//SYSIN DD *
UPDATE DSN8610.PROJ SET DEPTNO='J01' WHERE DEPTNO='A01';
UPDATE DSN8610.PROJ SET DEPTNO='J02' WHERE DEPTNO='A02';
UPDATE DSN8610.PROJ SET DEPTNO='J02' WHERE DEPTNO='A03';
/*