Chapter Contents

Previous

Next
SAS/ACCESS Interface to IMS-DL/I Software

SAS Statements for Loading DB2 Table BANKCHRG

The following are the executable SAS DATA step, PROC APPEND, and PROC ACCESS statements to load DB2 table BANKCHRG.


Creating SAS Data Set MYDATA.BANK

The SAS data set MYDATA.BANK is used to load the DB2 table BANKCHRG.

Note:   If you do not have DB2 at your site, change MYDATA.BANK to MYDATA.BANKCHRG and execute only the following program:  [cautionend]

data mydata.bank;
  input @1  ssn      $11.
        @13 accountn 12.
        @26 chckchrg 5.2
        @32 atmfee   5.2
        @38 loanchrg 6.2;
  format accountn 14.
         chckchrg 5.2
         atmfee   5.2
         loanchrg 6.2;
  datalines;
667-73-8275 345620145345 3.75  5.00  2.00
434-62-1234 345620104732 15.00 25.00 552.23
436-42-6394 345620135872 1.50  7.50  332.15
434-62-1224 345620134564 9.50  0.00  0.00
178-42-6534 .            0.50  15.00 223.77
156-45-5672 345620123456 0.00  0.00  0.00
657-34-3245 345620132455 10.25 10.00 100.00
667-82-8275 .            7.50  7.50  175.75
456-45-3462 345620134522 23.00 30.00 673.23
234-74-4612 345620113262 4.50  7.00  0.00
;

proc print data=mydata.bank;
  title2 'SAS Data Set MYDATA.BANK';
run;


Loading DB2 Table BANKCHRG from MYDATA.BANK

The following program loads DB2 table BANKCHRG from the SAS data set MYDATA.BANK. You must have DB2 installed at your site to run this program.

proc dbload dbms=db2 data=mydata.bank;
  accdesc=mylibdb2.bankchrg;
  table=<owner>.bankchrg;
  load;
run;


DB2 View Descriptor for BANKCHRG

The following program creates a DB2 view descriptor for the DB2 table BANKCHRG. You must have DB2 installed at your site to run this program.

proc access dbms=db2 ad=mylibdb2.bankchrg;
  create vlibdb2.bankchrg.view;
  select all;
  list view;
run;

proc print data=vlibdb2.bankchrg;
  title2 'DB2 Table BANKS.BANKCHRG';
run;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.