文章目录
一、 Using Format to Enhance Your Output
本次例子为《Learning SAS by Example, A Programmers Guide》第五章的内容。目前有survey数据集。需要对变量里面的值贴上适当的标签增加输出结果的可读性。
1.1 读取survey.txt数据
我们可以查看survey.txt数据的格式
001 M 23 28000 1 2 1 2 3
002 F 55 76123 4 5 2 1 1
003 M 38 36500 2 2 2 2 1
004 F 67 128000 5 3 2 2 4
005 M 22 23060 3 3 3 4 2
006 M 63 90000 2 3 5 4 3
007 F 45 76100 5 3 4 3 3
在SAS系统中进行导入txt文件
data sas.survey;
infile 'G:\survey.txt' pad;
input ID : $3.
Gender :$1.
Age
Salary
(Ques1-Que