You're using the wrong definition of TRIM. To trim statistics usually means to remove outliers/edge case data. You're assuming it applies to character variables.
https://hollyemblem.medium.com/when-to-use-a-trimmed-mean-fd6aab347e46
@ashwinangiah wrote: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 72 73 PROC IMPORT DATAFILE="/home/u58805020/BI/Financial Sample.xlsx" 74 OUT=Sales 75 dbms=xlsx; 76 Run; NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with options MSGLEVEL=I. NOTE: The import data set has 700 observations and 16 variables. NOTE: WORK.SALES data set was successfully created. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.11 seconds user cpu time 0.11 seconds system cpu time 0.00 seconds memory 2809.40k OS Memory 31400.00k Timestamp 07/17/2021 03:57:50 PM Step Count 24 Switch Count 2 Page Faults 0 Page Reclaims 818 Page Swaps 0 Voluntary Context Switches 19 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 77 78 data work.strip_trimleft_trimnleft; 79 set work.cities; ERROR: File WORK.CITIES.DATA does not exist. 80 string = "*" || city || "*"; 81 strip = "*" || strip(city) || "*"; 82 trim_left = "*" || trim(left(city)) || "*"; 83 trimn_left = "*" || trimn(left(city)) || "*"; 84 85 drop city; 86 run; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 80:21 81:26 82:34 83:36 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.STRIP_TRIMLEFT_TRIMNLEFT may be incomplete. When this step was stopped there were 0 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds memory 632.96k OS Memory 29864.00k Timestamp 07/17/2021 03:57:50 PM Step Count 25 Switch Count 2 Page Faults 0 Page Reclaims 116 Page Swaps 0 Voluntary Context Switches 9 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 87 88 data work.compress_compbl; 89 set work.cities; ERROR: File WORK.CITIES.DATA does not exist. 90 string = "*" || city || "*"; 91 compress = "*" || compress(city) || "*"; 92 compbl = "*" || compbl(city) || "*"; 93 94 drop city; 95 run; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 90:21 91:32 92:28 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.COMPRESS_COMPBL may be incomplete. When this step was stopped there were 0 observations and 3 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 631.96k OS Memory 29864.00k Timestamp 07/17/2021 03:57:50 PM Step Count 26 Switch Count 2 Page Faults 0 Page Reclaims 89 Page Swaps 0 Voluntary Context Switches 9 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 96 97 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 109
... View more