Hi All,
I need to be able to substitute two variables in this simple SQL code:
The JCL:
//SETVAR SET SSNODE=DBO1,DBOI=P1,DBOO=D2,
// TRK=OG1,LOADIR=TEST,
// PARMDIR=OGDBA,
// PDBNAME='OG1DD%1', <<-----Database name
// PTSNAME='OG1SC%' <<-----Tablespace Name
//SYSTSIN DD *
DSN SYSTEM(DBO1) RETRY(3)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIB81) -
LIB('SYS2.DB2.TEST.RUNLIB.LOAD') PARMS('SQL')
END
/*
//SYSIN DD *
SELECT '-START DB('||DBNAME||') SPACENAM('||NAME||') ACCESS(UT)' <<<------SQL
FROM SYSIBM.SYSTABLESPACE
WHERE DBNAME LIKE %PDBNAME
AND NAME LIKE %PTSNAME
// PDBNAME='OG1DD%1', <<-----Database name
// PTSNAME='OG1SC%' <<-----Tablespace Name
How can make this work? I am getting errors every which way I try!
Your expert help will be highly appreciated
you can either write a program that gets those parameters and put them in the sql query and then execute the query or generate the input file for dsntiaul, or you can try to use iebgener to modify the input file for dsntiaiul