Restringir duplicar el rfc

Buenos días, tengo el siguiente query en hana studio pero no se si algo este mal ya que me marca error del begin:

if object_type =‘2’ and transaction_type in (‘A’,‘U’)
begin

declare “LicTradNum” nvarchar (16)
select “LicTradNum” = a.“LicTradNum” from OCRD a where a.“CardCode” = list_of_cols_val_tab_del
if (select count (b.“LicTradNum”) from OCRD b where b.“LicTradNum” = rfc) >1

begin
Set error = 1
Set error_message= ‘El RFC ya se encuentra registrado en al menos un socio de negocio’
end
end

Could not execute ‘CREATE PROCEDURE SBO_SP_TransactionNotification ( in object_type nvarchar(30), – SBO Object Type …’
SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near “begin”: line 24 col 1 (at pos 722)

Me apoyan a saber como debe de quedar por favor