This code creates a SAS data set named MyLib.NoFmt that
includes three columns from the DB2 table EmplInfo. The RENAME statement
changes the name of the third column that is listed in the SELECT
statement (from
firstname
in the DB2
table to
fname
in the SAS data set.
/* specify the SAS library where the SAS data set is to be saved */
libname mylib 'userid.xxx';
proc db2ext ssid=db25 out=mylib.nofmt;
select employee, lastname, firstname from sasdemo.emplinfo;
rename 3=fname;
run;
This code uses a mapping
file to specify which data to include in the SAS data set and how
to format that data.
/* specify the SAS library where the SAS data set is to be saved */
libname mylib 'userid.xxx';
/* specify the SAS library that contains the mapping data set */
libname inlib 'userid.maps';
proc db2ext in=inlib.mapping out=mylib.mapout ssid=db25;
run;