Hi Everyone, Below are the codes for numeric type datalines. data exposure;
retain Type 'I' Hlo 'U';
do Year=1944 to 1949;
Fmtname=cats('exp', Year, 'fmt');
do Start='A', 'B', 'C', 'D', 'E';
End=Start;
input Label : $3. @;
output;
end;
end;
drop Year;
datalines;
220 180 210 110 90
202 170 208 100 85
150 110 150 60 50
105 56 88 40 30
60 30 40 20 10
45 22 22 10 8
;
title "Creating the Exposure InFormat";
proc format cntlin=exposure fmtlib;
run;
data read_exp;
input Worker $ Year JobCode $;
Exposure = inputn(JobCode,cats('exp',Year,'fmt8.'));
datalines;
001 1944 B
002 1948 E
003 1947 C
005 1945 A
006 1948 d
; Can anyone assist me if I have datalines a mixture of both numeric and char: (use the following datalines). datalines; Greater than 210 180 210 110 90 202 170 208 100 . 150 110 greater than 210 60 50 105 . 88 40 Less than 10 60 30 40 20 Less than 10 45 22 22 . Less than 10 ; Where, Greater than 210 is one value (character). For simplicity if required you can replace it to Greater_210 similarly, for less than 10. And, . denotes numeric missing. However, it might be easy if we proceed by considering all values (in datalines) as character. But, my concern is can we do for mixture of both type values. If yes, then please give me codes.
... View more