This did not work for me, my data comes out as follows. I had deleted the existing num2 dataset and run the code you provided. data work.NUM2;
infile datalines dsd truncover;
input age:$17. agecat:BEST. stdpop:BEST. stdpop_py:32. MSSA_ID:$10. totcases:32. pop:32. pop_py:32.;
format agecat BEST. stdpop BEST.;
label age="age" agecat="agecat" stdpop="stdpop";
datalines4;
35 to 39 years,8,9986000,139804000,1.1,3,1830,25620
40 to 44 years,9,10387000,145418000,1.1,3,2088,29232
45 to 49 years,10,11435000,160090000,1.1,2,2439,34146
50 to 54 years,11,11169000,156366000,1.1,4,2547,35658
55 to 59 years,12,9854000,137956000,1.1,1,1480,20720
65 to 69 years,14,6349000,88886000,1.1,1,1113,15582
75 to 79 years,16,4161000,58254000,1.1,1,596,8344
30 to 34 years,7,9871000,138194000,1.2,1,1132,15848
40 to 44 years,9,10387000,145418000,1.2,3,1502,21028
45 to 49 years,10,11435000,160090000,1.2,2,2000,28000
50 to 54 years,11,11169000,156366000,1.2,1,1766,24724
55 to 59 years,12,9854000,137956000,1.2,2,1298,18172
65 to 69 years,14,6349000,88886000,1.2,1,604,8456
75 to 79 years,16,4161000,58254000,1.2,1,457,6398
20 to 24 years,5,10470000,146580000,10,4,1690,23660
25 to 29 years,6,10525000,147350000,10,2,1427,19978
30 to 34 years,7,9871000,138194000,10,14,1239,17346
35 to 39 years,8,9986000,139804000,10,9,1159,16226
40 to 44 years,9,10387000,145418000,10,15,1188,16632
45 to 49 years,10,11435000,160090000,10,10,1591,22274
50 to 54 years,11,11169000,156366000,10,14,1800,25200
55 to 59 years,12,9854000,137956000,10,15,1353,18942
60 to 64 years,13,8556000,119784000,10,9,1632,22848
65 to 69 years,14,6349000,88886000,10,6,1274,17836
70 to 74 years,15,4873000,68222000,10,5,1183,16562
75 to 79 years,16,4161000,58254000,10,2,809,11326
80 to 84 years,17,3375000,47250000,10,2,594,8316
85 years and over,18,3062000,42868000,10,3,758,10612
25 to 29 years,6,10525000,147350000,100,1,86,1204
30 to 34 years,7,9871000,138194000,100,2,69,966
35 to 39 years,8,9986000,139804000,100,3,51,714
40 to 44 years,9,10387000,145418000,100,8,29,406
45 to 49 years,10,11435000,160090000,100,1,50,700
50 to 54 years,11,11169000,156366000,100,6,41,574
55 to 59 years,12,9854000,137956000,100,1,100,1400
60 to 64 years,13,8556000,119784000,100,6,87,1218
70 to 74 years,15,4873000,68222000,100,2,5,70
25 to 29 years,6,10525000,147350000,102,1,205,2870
30 to 34 years,7,9871000,138194000,102,1,184,2576
35 to 39 years,8,9986000,139804000,102,3,141,1974
40 to 44 years,9,10387000,145418000,102,5,181,2534
45 to 49 years,10,11435000,160090000,102,7,190,2660
50 to 54 years,11,11169000,156366000,102,4,284,3976
55 to 59 years,12,9854000,137956000,102,1,270,3780
60 to 64 years,13,8556000,119784000,102,2,206,2884
65 to 69 years,14,6349000,88886000,102,1,213,2982
70 to 74 years,15,4873000,68222000,102,1,159,2226
80 to 84 years,17,3375000,47250000,102,1,61,854
25 to 29 years,6,10525000,147350000,103,1,330,4620
30 to 34 years,7,9871000,138194000,103,2,235,3290
;;;;
... View more