Usually best to test an algorithm before putting it in an sproc, eg ...
set @file_no = 2;
set @list_name = '0,2,1';
set @a = find_in_set(@file_no, @list_name);
select @,if(@a>0,1,2);
+----------+------------+------+--------------+
| @file_no | @list_name | @a | if(@a>0,1,2) |
+----------+------------+------+--------------+
| 2 | 0,2,1 | 2 | 1 |
+----------+------------+------+--------------+
Then re the sproc, you forgot to declare it ...
drop procedure if exists test;
delimiter //
create procedure test()
begin
set @file_no = 2;
set @list_name = '0,2,1';
set @a = find_in_set(@file_no, @list_name);
-- select @a;
if @a > 0 then select 1;
else select 2;
end if;
end //
delimiter ;
call test();
+---+
| 1 |
+---+
| 1 |
+---+