IF PFKEY = 'PF05' THEN
DO WHILE (ZTDSELS > 0);
EXEC SQL
DECLARE CURPART CURSOR FOR
SELECT PART_NO FROM PRDT.TBPART04
WHERE PART_NO = :PART_N;
EXEC SQL
OPEN CURPART;
EXEC SQL
FETCH CURPART
INTO :VPARTNO;
IF SQLCODE = 0 THEN
DO;
MAT_L = MATL_DOC;
EXEC SQL
UPDATE EPPS.EOGPREC
SET I_PART = :PART_N
WHERE I_MATL_DOCU = :MAT_L;
IF SQLCODE = 0
THEN DO;
CALL ISPLINK('SETMSG ', 'INVNA700');
IF (ZTDSELS = 1) THEN
ZTDSELS = 0;
ELSE
DO;
EXEC SQL COMMIT;
CALL ISPLINK('TBDISPL', 'INVNT700');
END;
END;
END;
ELSE IF (SQLCODE = 100) THEN DO;
/************************************************/
U_PART = PART_N;
CALL ISPLINK ('TBADD', 'INVNT701');
RETURN_CODE = PLIRETV;
IF RETURN_CODE > 4
THEN DO;
ERR_FOUND = '1'B;
RETURN;
END;
EXEC SQL COMMIT;
/***********************************************/
CNT = CNT + 1;
IF (ZTDSELS = 1) THEN
ZTDSELS = 0;
ELSE
DO;
EXEC SQL COMMIT;
CALL ISPLINK('TBDISPL', 'INVNT700');
END;
END;
EXEC SQL
CLOSE CURPART;
END; /* DO WHILE END */
IF CNT > 0 THEN
DO;
CALL ISPLINK ('VPUT ', '(PART)','PROFILE');
CALL ISPLINK('TBTOP', 'INVNT701');
EXEC SQL COMMIT;
CALL ISPLINK('TBDISPL', 'INVNT701', 'INVNP701');
CALL P6000_ROUTE_PARA;
END;
END P4000_VALIDATE_PARTNO; /* END OF VALIDATE PARA */
In the above code if sql code = 100 the non matching parts in my master table should be added to temporory table INVNT701
Thanks in advance