Or are you trying to get something like this:    ls_step_cd    number_of_occurences  M17                5  K16              10  and so on    If so restructure your sql as    create table step_count as  select ls_step_cd,          count(ln_no)  as number_of_occurances           from lm_steps   where ls_actual_compl_dt between &pmb and &pme  and ls_step_cd in ('M17','K16','L39','L96','M60','L58','L44','L52')  group by ls_step_cd  order by ls_step_cd;    Note it always help to tell what you are trying to do.  Syntactically, the 'end' key word closes a case statement.  So after the SQL engine found 'as M17' it as looking for  what can come next legally.  For example, a new field in the select statement ==> ',' or column modifier like FORMAT or LENGTH, etc.     HTH   
						
					
					... View more