/**********************************************************************/


   /* Associate libref with SAS data library. This        */
   /* library contains four view descriptors, mapping to  */
   /* four DB2 tables.                                    */
libname viewlib 'sas.data.library';

proc sql;
   connect to db2(ssid=xxxx);
   execute (SET CURRENT SQLID='authid') by db2;
   select * from viewlib.member1;
   insert into viewlib.member2
     values('Smith', 'Jeff', '1993-03-10');
   update viewlib.member3
     set cost=cost * 1.10
     where product='Wiggit';
   delete viewlib.member4
     where product='Oldstock';
   disconnect from db2;
     other sql queries
quit;


/**********************************************************************/


INIT:
    submit continue sql;
       connect to db2(ssid=xxxx);
       execute (SET CURRENT SQLID='authid') by db2;
    endsubmit;
return;

MAIN:
    submit continue;
      reporting code
    endsubmit;
return;

TERM:
    submit continue sql;
       disconnect from db2;
    endsubmit;
return;


/**********************************************************************/