/*===========================
export;
===========================*/
PROC EXPORT DATA= one
OUTFILE= "c:\one.csv"
DBMS=CSV REPLACE;
RUN;
PROC EXPORT DATA= one
OUTFILE= "C:\one.txt"
DBMS=tab REPLACE;
RUN;
PROC EXPORT DATA= one
OUTFILE= "C:\one.xls"
LABEL DBMS=EXCEL REPLACE;
SHEET="one";
RUN;
/*===========================
import;
===========================*/
PROC IMPORT OUT= WORK.dat
DATAFILE= "c:\dat.csv"
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
PROC IMPORT OUT= WORK.dat
DATAFILE= "c:\dat.txt"
DBMS=TAB REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
PROC IMPORT OUT= WORK.data DATAFILE= "c:\dat.xls" DBMS=EXCEL REPLACE;
namerow=1;startrow=2;
SHEET="dat$";
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
export;
===========================*/
PROC EXPORT DATA= one
OUTFILE= "c:\one.csv"
DBMS=CSV REPLACE;
RUN;
PROC EXPORT DATA= one
OUTFILE= "C:\one.txt"
DBMS=tab REPLACE;
RUN;
PROC EXPORT DATA= one
OUTFILE= "C:\one.xls"
LABEL DBMS=EXCEL REPLACE;
SHEET="one";
RUN;
/*===========================
import;
===========================*/
PROC IMPORT OUT= WORK.dat
DATAFILE= "c:\dat.csv"
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
PROC IMPORT OUT= WORK.dat
DATAFILE= "c:\dat.txt"
DBMS=TAB REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
PROC IMPORT OUT= WORK.data DATAFILE= "c:\dat.xls" DBMS=EXCEL REPLACE;
namerow=1;startrow=2;
SHEET="dat$";
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
No comments:
Post a Comment