标签:style blog color os io for re c
1 FORMAT Profit Loss DOLLAR8.2 Saledate MMDDYY8.; 2 PUT Profit DOLLAR8.2 LOSS DOLLAR8.2 Saledate MMDDYY8.;
FORMAT语句指定每个变量具体的格式;
这里特别要注意的是,FORMAT语句中,指定Profit和Loss同一个格式,为DOLLAR8.2.
1 DATA Carsurvey; 2 INFILE ‘c:\myrawdata\cars.dat‘; 3 INPUT Age Sex Income color$; 4 PROC FORMAT; 5 VALUE gender 1=‘Male‘ 6 2=‘Female‘; 7 Value agegroup 13-<20=‘Teen‘ 8 20<-65=‘Adult‘ 9 60-High=‘Senior‘; 10 Value $ color ‘W‘=‘Moon White‘ /*请注意此处$的位置*/ 11 ‘B‘=‘SKy Blue‘ 12 ‘Y‘=‘Sunburst Yellow‘ 13 ‘G‘=‘Rain cloud Gray‘; 14 PROC PRINT DATA=Carsurvey; 15 FORMAT Sex gender. Age agegroup. color $ col. Income Dollar8.; 16 TITLE ‘...‘; 17 RUN;
备注:
1.格式名要求:
2. Value后面的Range的要求:
【SAS BASE】FORMAT Statement及PROC FORMAT,布布扣,bubuko.com
【SAS BASE】FORMAT Statement及PROC FORMAT
标签:style blog color os io for re c
原文地址:http://www.cnblogs.com/chenyn68/p/3866123.html