I have a dataset which I manipulate in proc-iml and then create a new dataset reading some of the manipulated values in. When I read character values in, their length is changed from 7 to 9.
This doesn't really create a problem, except for the minor annoyance that when I later merge this new dataset, I receive the warning that the variables' length is different in two datasets.
Is there a way to keep the length of the original variable?
Sample code
data data1;
infile datalines delimiter=',';
input classif :$9. time :$7.;
datalines;
05, 2021_11
051, 2021_11
;
run;
proc iml;
use work.data1;
read all var {classif time } into _temp_1;
classif = _temp_1[,1];
time = _temp_1[,2];
close;
create work.data2 var{classif time};
append;
quit;
Observe how the length of time is 7 in data1, but 9 in data2.