I would like that if the table OUT_TEMP1 was not created because of an error:ERROR: CLI cursor extended fetch error: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being

The query was repeated (with the last value & filter):SELECT A.CO_AZIONE AS CO_POPUP , COUNT (A.NDG) AS TARGETFROM UC0.MSLKTRGCONT Awhere A.CO_AZIONE IN (&FILTRO)AND a.CO_ESEC_CONT_MIS ='AA'GROUP BY A.CO_AZIONEorder by 1

Re: Repeat query automatically in case of error

You could try a macro check (%if ....%then...%do) using %sysfunc(open("OUT_TEMP1")) as the criteria. If it returns a 0 the dataset does not exist. I think this should work but I havent tried this in open macro code before so the syntax may be off a little.