intheangel 发表于 2014-3-8 10:58 
data pooling;
input dept $ date retx;
cards;
Thank for your help !
Can your solve my another problem :
about how to format DATE :
yyyymmdd(date)---->yyyymm(month)
----------------------------------------------
data pooling;
infile 'c:\orignal.txt';
input dept $ date date yymmddn8. retx;
format date yymn6.;
run;
proc sort;
by dept;
run;
data tmp;
set pooling;
by dept;
if last.dept;
a='%no(';
c=")";
file "d:\tmp.txt";
put a $ dept $ c $;
run;
%macro no(x);
data a(rename=(month=date));
set pooling;
if dept=&x;
proc export data=a
OUTFILE="d:\panel%str(&x).csv"
DBMS=CSV
REPLACE;
run;
%mend no;
%include "d:\tmp.txt";
----------------------------------------
*the your outcomes:panel10004.csv*
dept date retx
10004 19860228 0.020408
10004 19860331 0.010000
-------------------------------------------------
*I hope outcomes: panel10004.csv *
dept month retx
10004 198602 0.020408
10004 198603 0.010000
Are you intrest about my another problem ? Good luck !
https://bbs.pinggu.org/thread-2926763-1-1.html