BookmarkSubscribeRSS Feed

When a certain expression is used to create a new variable:

create table ouput2 as
select
  put(Team,$Ffmt.) as Team_Category,
  count(*) as No_Customers 

and the same expression is used in the group by:

group by put(Team,$Ffmt.)

the SQL compiler should recognize this and act as if the new variable had been used instead:

group by calculated Team_Category

and avoid the (accidental) remerging with the original data

1 Comment
JamesProfitt
Calcite | Level 5

Perhaps something like this will work for you in the meantime?

 

proc sql;
  select put(x,8.) as x_fmt
        ,count(*) as count_records
    from sashelp.zipcode
   group by 1
  ;
quit;