1

Using PROC SQL, I changes column names from English to Hebrew. When I use such tables via PROC REPORT, SAS uses the English columns names, even though the BY and DEFINE statements use the new Hebrew named column

PROC  REPORT DATA= work.sharon ;
BY 'סניף'n ;
DEFINE 'סניף'n / group;
RUN;
Eyal Marom
  • 281
  • 4
  • 18

2 Answers2

1

I am guessing that the original data had labels. SAS will keep the old labels after you rename a variable. You can see the problem here:

data blah;
    i = 23;
    label i = "eye";
run;

data blah2;
    set blah (rename = (i = a));
run;

proc report data = blah2;
run;

You can manually set the label for each variable with a label or attrib statement or, if you prefer to always use the variable names, just strip off all the labels for the dataset like this:

data blah3;
    set blah2;
    * remove all labels;
    attrib _all_ label = " ";
run;

proc report data = blah3;
run; 
itsMeInMiami
  • 2,324
  • 1
  • 13
  • 34
1

If a variable has a LABEL PROC REPORT will use it as the column header. You can change the label or override in the define statement or use the SAS system option NOLABEL; Try one of these

label 'סניף'n = 'סניף';

DEFINE 'סניף'n / group 'סניף';

options label=0;
data _null_
  • 8,534
  • 12
  • 14
  • 2
    To prevent label typos, you can temporarily clear a variable's label, in which case the variable name is used as the default label. `label 'סניף'n = ' ';` (make sure there is one space in the label value) – Richard Aug 18 '20 at 11:04
  • And `DEFINE 'סניף'n / group "";` works too. (make sure there is no space between the double qutation) – whymath Aug 18 '20 at 15:31