You are trying to use the ESQOBJ call to query the existence of a GDDM object on auxiliary storage from within an IMS program. The call fails with GDDM abend 1302 (Invalid RCP function code)
The ESQOBJ function cannot be used from within IMS.
Resolving the problem
You can use this function from a TSO batch program, but not from within IMS