The trim() function is part of the SAS Language. Without the %sysfunc() macro function, trim() can only be used within a data step or in a macro definition that gets called inside of a data step. You can't have it out in open code.
if %trim() existed, which it does not, it would work just fine the way you used it. But, there is no function named %trim() that is defined in the SAS macro language.
Doing what you want without %sysfunc(), would have to go something like:
data _NULL_;
call symput("x", trim("&num."));
run;
or if you want x to be a data set variable:
%let expr= trim("&num.");
DATA ds;
x = &expr.;
RUN;