I running on under ZOS 1.13, DB2 V10 (was working same under DB2V9), SAS 9.3. I am creating a process to ready the DB2 system tables using an creator id and getting all the table names owned. My second process is to generate SQL and counting each table's rows. The second will be a macro, replacing table names, count names, then merging all into one, or perhaps flat file not sure yet. I am using pass through. My thought was if I connect to Db2 over and over I am going to be rather inefficient, thus I have been trying to figure out how to do within one SQL, or at least one CONNECT to DB2 statement. I am able to get the SQL below to run, then when I execute in my local PC SAS sessions it fails (with a few minor differences of course). Also if you have another way in SQL I don't mind being told, I am all about efficiency here and we have offshore that created something in REXX and it uses A LOT of time, I know using pass though like this it will be efficient. Thanks for your time: Mainframe works: proc sql; CONNECT TO db2 (ssid=&db2_id); create table a as select * from connection to db2 (SELECT COUNT(*) AS TABLEA FROM DB2ACPT.CLIENT_ADDRESS) QUIT; create table b as select * from connection to db2 (SELECT COUNT(*) AS TABLEB FROM DB2ACPT.CLIENT_ADDRESS) QUIT; This code works, but you notice the QUIT statement is not present and will not function with the quit present.. proc sql; SELECT COUNT(*) AS row_cnt_a FROM a ; SELECT COUNT(*) AS row_cnt_b from b ; QUIT;
... View more