On Fri, 5 Aug 2011 16:58:00 -0500, Dave Day wrote: > >DSNH312I E DSNHSMUD LINE 863 COL 31 UNDEFINED OR UNUSABLE HOST VARIABLE >"GTPLNAME" >DECLARE C1 CURSOR FOR SELECT BNAME,BCREATOR,BTYPE FROM SYSIBM.SYSPLANDEP WHERE >DNAME = : GTPLNAME > > > Column NAME in SYSPLAN is defined the same as DNAME in SYSPLANDEP. > Varchar 24. GTPLNAME in my source is defined as a DS H,CL24. Anyone have > an idea. I appreciate the help. Thanks in advance. >
Did you declare "GTPLNAME" *before* using it in the DECLARE CURSOR statement? With the TWOPASS precompiler option (the default for ASM) you can declare host variables after using them in SQL statements, but you still need to declare them before use in a "DECLARE CURSOR". The first statement is a "SELECT", the second is a "DECLARE CURSOR". http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2z9.doc.apsg/src/tpc/db2z_declarehostvariableassembler.htm Norbert Friemel ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html