SQL in CL is no problem.
Add this line to your CL program:
0037.00 RUNSQLSTM SRCFILE(WWLIB/QCLSRC) SRCMBR(MYSQL)
COMMIT(*NONE)
An SQL member looks like this: (the member type in PDM is 'SQL' instead of
'CLP')
0002.00 INSERT INTO ELABACK/TAGESVORG
0003.00 SELECT DISTINCT(A7AENB) FROM ELABACK/ASA7SIC;
0004.00 --
0005.00 INSERT INTO ELABACK/ASALSIC SELECT B.ALAENB, B.ALACDA, B.ALABTM,
0006.00 B.ALAUCD FROM ELABACK/TAGESVORG A, ELADTA/ASALCPP B WHERE A.A7AENB
0007.00 = B.ALAENB;
0011.00 --
0012.00 DELETE FROM WEISS/ASALCPP
0013.00 WHERE ALAENB IN (SELECT A7AENB FROM ELABACK/TAGESVORG);
0014.00 INSERT INTO WEISS/ASALCPP SELECT * FROM ELABACK/ASALSIC;
Note:
*** RUNSQLSTM runs the whole SQL member, no way to select only one
statement of it. So you must create more SQL members for a CLP, if you need
to run the statements from several places of your CLP. Perhaps like this:
CLP = MYCLPGM, SQL members: MYCLPGM1, MYCLPGM2, ... then you have them
right below the CL in PDM.
*** Create and test the SQL statements with STRSQL and then use the save
option to store them into a source member.
*** Seen the ';' at the end of each line? It's important.
*** You can also execute SQL with the Operations Navigator. Right click the "Database" item.
Keep in mind that SQL SELECT statements aren't applicable in this environment.