I have created a SQL-statement that is in a string.
'insert into MetadataTable.TestTable ' !!
'sel ''' !! trim(substr(Col.databasename,1,3)) !! ''' as Environment, ''' !!
As it is right now - I´m running it in SQL Assistent but my goal is to run it as a scheaduled batch job in Z/OS.
Can someone help out here - how to
1. Run the "genereate-sql-statment. Which will generate an outfil
2. Make it run the generate sql-statement in a new script/source the the outfile from step 1.
Here's a snippit that should help you out:
.run FILE LOGON..
.set width 250
.set errorout stdout
.set quiet ON
.set titledashes OFF
.export FILE sql.txt
.if ERRORCODE <> 0 THEN .quit 4;
.set quiet OFF
.run FILE sql.txt