After you rebuild your data set then use
data _null_;
set df;
put Trt_CC $hex10.;
run;
The DATA statement names the output data set. When you do not provide any input, read a file, inline data or other data sets on a SET, MERGE, MODIFY or UPDATE statement then you have told SAS to create an empty data set. The DATA _NULL_; means do not create a data set for output. BUT you can do anything with data provided to the step, such as put the variables.
Note: For beginners (and many moderately experienced SAS users) having the input data set and the output the same is dangerous as you can accidentally corrupt or change data.
Consider: You need to change x by subtracting 1 from the values and write:
data df;
set df;
x= x-1;
run;
Then realize that you needed to make another change to a different variable and add a statement to the code:
data df;
set df;
x= x-1;
y = log(someothervariable);
run;
After you run the above code X has had the 'subtract 1' applied twice. A few more minor coding changes and you can end up with x as having the 1 subtracted multiple times.
I inherited a data set that had a variable that was supposed to have values of 1, 2, and 3. But all the values were 1 because code like this had been run multiple times to "recode" the original values:
data old;
set old;
if x=4 then x=3;
else if x=3 then x=2;
else if x=2 then x=1;
run;
This was supposed to shift a variable from 1,2,3,4 to 1,2,3. And does so. The FIRST time the code runs.
But other recode bits were added to the same data step. So the code was run against the first already changed values. So what had been a 4 and become a 3 then changed to 2. Then run the code again and it was now 1. As were all the values.
Make a new data set:
data df_new;
set df;
/* other code goes here*/
run;
Then when you make LOGIC mistake, not a syntax mistake, then you still have your DF set to work with.
Murphy's Law in this case that your logic mistake will never involve a syntax error and will run corrupting your data.
... View more