Search code examples
sasodsproc-report

I changed columns names, but SAS PROC REPORT still uses the old names


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;

Solution

  • 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;