I am trying to move data from one table to another using proc SQL. A minimal example is given below: proc sql;
create table table1
(field varchar(20) not null);
create table table2
(field varchar(10) not null);
insert into table1
values ('abc');
quit;
proc sql;
insert into table2 (field)
select strip(field)
from table1;
quit; Obviously this produces a warning message that the string of length 20 from table1 will be truncated when inserted into table2, where the respective column contains strings of length 10. In order to remove this warning I tried to remove trailing blanks or consider only the first half of the string - but none of this seems to work: proc sql;
insert into table2 (field)
select strip(field)
from table1;
quit;
proc sql;
insert into table2 (field)
select substr(field, 1, 10)
from table1;
quit;
proc sql;
insert into table2 (field)
select trim(field)
from table1;
quit; Does anybody know why trimming does not work in this Situation and whether there is a Workaround? Best regards, Jonathan
... View more