Page 1 of 1

server routine

Posted: Sun Aug 13, 2017 11:08 am
by India2000
Hi all,

I want to create a routine to connect to DB using.

I get the following error when creating a routine, but it works when creating as a JCL.
Compiling: Source = 'DSU_BP/DSU.TableCount', Object = 'DSU_BP.O/DSU.TableCount'
*************************************************?*
0012 Command="db2 connect to ": DBNAME : " user " : ID : " using " : PASSWORD

^
':' unexpected, Was expecting: ';', End of Line

1 Errors detected, No Object Code Produced.

The syntax for connecting to DB works when compiling in JCL. Could any one please help me out using the right syntax.

Posted: Sun Aug 13, 2017 10:18 pm
by chulett
Not sure why you would think you can take JCL and compile it as a Server routine, which is what you seem to be saying. Why not start with what the routine is supposed to be doing (what it will accomplish and why you are doing it as a routine rather than a job) and perhaps post all of the code rather than just the error.

Posted: Sun Aug 13, 2017 10:37 pm
by ray.wurlod
The error occurred near the end of your code (as evidenced by the "?" in the line of asterisks), almost certainly not in line 12 (which appears to me to be syntactically sound, though I personally would use more white space).