SQLAnywhere: Syntax error on call function; Call without IF construct is working
I think this is caused by a confusion between Watcom-SQL and T-SQL syntaxes.  

Because you use CALL (rather than EXEC) in the first example the database engine will assume that the code is in Watcom SQL. (There is a PRINT statement later but the decision will have been made before then).

In the second example the command PRINT is only valid in T-SQL and the whole code segment is valid T-SQL so the database engine will assume that all the code is T-SQL and the THEN is not needed. 

If I'm right then this should work (untested in Watcom-SQL):

DECLARE @tmp BIT;
SET @tmp = 0;
IF @tmp = 1
   THEN  call __insert_to_notifications_table('foo', '1234', '5678', 'Some comment')
ELSE
    MESSAGE 'Path, which is chosen' TO CLIENT
END IF;


For the differences in SQL Anywhere support for various SQL dialects see: http://dcx.sybase.com/index.html#1200/en/dbusage/ug-sql-compat.html 



Update - this batch runs fine in dbISQL:

BEGIN
  DECLARE @tmp BIT;
  SET @tmp = 0;
  IF @tmp = 1
       THEN call dbo.sa_info()
  ELSE
      MESSAGE 'Path, which is chosen' TO CLIENT
  END IF;
END


(I've added a BEGIN and END to give the DECLARE a context &amp; used a built-in procedure rather than your user defined one) Tested in 10.0.1.4310 &amp; 16.0.0.1535. If I omit the THEN I get the same error as you were getting.

A pure T-SQL version would be:

BEGIN
  DECLARE @tmp BIT
  SET @tmp = 0
  IF @tmp = 1
   EXEC dbo.sa_info
  ELSE
   PRINT 'Path, which is choosen'
END


which also works on both 10.0.1.4310 &amp; 16.0.0.1535. Don't forget that if you use T-SQL EXEC the parameters have to be specified individually (not in brackets): 

[ EXECUTE ] | [ EXEC ][ @return_status = ] [creator.]procedure_name [ argument, ... ]
argument :
 [ @parameter-name = ] expression
| [ @parameter-name = ] @variable [ output ]