Please share you log with the code, and proc contents.
data oneae; set dummy1 ae4(rename=(placebo=trt1 Xanomeline_High_Dose=trt2 Xanomeline_Low_Dose=trt3)); ord=1; aeterm='Subject with at least one AE'; tot1="&bign1"; tot2="&bign2"; tot3="&bign3"; run;
I think is kind of self explanatory.
Do a PROC CONTENTS on both input datasets and compare your variable definitions.
If you have deviations, you could specify a LENGTH statement prior to SET and use the largest length value for your input variable(s).
At least in my SAS9.4M7 environment under Windows you get this warning only if the variable in the first table got a shorter length defined than in the second table.
SAS will use the first occurrence of a source variable to create the pdv and though if this first occurrence is the shorter length then string truncation is possible and though the Warning is correct and should remain.
One way to avoid such a truncation issue is to define the variable length explicitly before the set statements.
ata have1;
length var $1;
var='A';
run;
data have2;
length var $2;
var='BB';
run;
/* creates warning because test1 got the variable with a shorter length */
data test1;
set have1 have2;
run;
/* var with greater length defined before the set statement: no warning */
data test2;
length var $2;
set have1 have2;
run;
/* source table with var that has greater length first in set statement: no warning */
data test3;
set have2 have1;
run;
/* and here if you don't know the max length in advance */
proc sql;
create table layout as
select * from have1(obs=0)
union corr all
select * from have2(obs=0)
;
quit;
data test4;
set layout have1 have2;
run;
Based on this program, what you need to compare is:
The length of TRT1 in DUMMY1
vs.
The length of PLACEBO in AE4
If you try to control the length using a LENGTH statement, that statement must come before the SET statement.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.