I'm writing either a CLLE program or an SQL script to build a schema full of tables, programs, and service programs, and I'd like it to be fully automated.
My issue is that in the beginning of the CL, when dropping the schema if it already exists, an inquiry message, CPA7025, is generated because the journal receiver QSQJRN0001 has not been fully saved. Alternatively, using an SQL script, conditional logic around the existence of the schema is needed, and I don't know of a way to do this within a script, and I don't want to make this an SQL function or procedure.
There's probably a very simple and obvious way to get around this problem. Any suggestions?
Here's the relevant CL code:
dropSchema:
chkobj MyLib *lib
monmsg cpf9801 exec(goto crtSchema)
runsql 'drop schema MyLib' commit(*none)
monmsg MSGID(CPF0000)
crtSchema: runsql 'create schema MyLib' commit(*none)
My issue is that in the beginning of the CL, when dropping the schema if it already exists, an inquiry message, CPA7025, is generated because the journal receiver QSQJRN0001 has not been fully saved. Alternatively, using an SQL script, conditional logic around the existence of the schema is needed, and I don't know of a way to do this within a script, and I don't want to make this an SQL function or procedure.
There's probably a very simple and obvious way to get around this problem. Any suggestions?
Here's the relevant CL code:
dropSchema:
chkobj MyLib *lib
monmsg cpf9801 exec(goto crtSchema)
runsql 'drop schema MyLib' commit(*none)
monmsg MSGID(CPF0000)
crtSchema: runsql 'create schema MyLib' commit(*none)
Comment