TAXATION MANAGEMENT USING ASYCUDA++ Ó UNCTAD - SITE (V1.15) A.7 SCTL Syntax The language and structure of 'Rules' is similar to many other programming languages. The  Rules  Editor  has  a  Look  Up  facility,  which  displays  lists  of  available  variables,  functions  and keywords. The 'Variables' list includes the data elements, captured from the declaration, that can be used to calculate the tax base; data elements such as invoice value, freight and insurance charges. ‘Keywords’    allow   conditional   selection   for   applying   taxes,   and   ‘Functions’    perform   the   tax calculations. Variables,  Keywords  and  Functions  available  for  use  in  Rules  are  listed  and described later in this appendix. Control Structures in 'Rules' The   'Rules'   language    uses    basic    programming    control    structures.    It    uses    both    sequential processing  and  selection.  Rules  are  usually  a  combination  of  statements  that  are  processed  in sequence, together with conditional selections using "If .. Then... Else... Endif" structures. Examples of Rules are: Example 1: A simple General Taxation Rule to calculate a computer processing fee charged at two currency units per item line of the declaration: Rule "Computer Fee"; TotalFees IS ItmTotal * 2; Explanation: Line  1  identifies  the  Rule  by  giving  it  a  name.  "Rule"  is  a  Rules  Keyword,  followed  by  the  name given by the writer to this Rule. Line 2 is a statement that uses the variable ItmTotal, which takes up the total number of declaration items from the general segment of the declaration. The numeric value of ItmTotal is multiplied by 2 (units  of  national  currency),  and  puts  the  result  to  TotalFees  -  which  is  the  calculated  amount  of global taxes for the declaration. Example 2.  Calculating tax according to the Commodity Code Rule "Customs Duty"; If TypProc = "4" Then Action IS DoTax("ICD", "1", StatVal, Rate(ComCod), (StatVal * Rate (ComCod) / 100)); Endif; Explanation: Line  1  is  the  name  of  the  Rule;  the  Keyword  Rule,  followed  by  the  name  the  writer  gives  to  the Rule, in this case "Customs Duty". Line 2 is selective, restricting application of the Rule to TypeProc = "4". TypeProc  is  the  declaration  General  Procedure  Code,  taken  from  the  general  segment  of  the declaration. In this case "4" means imports for home use, restricting the tax to import declarations. Line 3 is the action statement. It uses the Rules Function called DoTax( ) Action Is DoTax( "ICD" , "1" ,StatVal, Rate(ComCod), StatVal * Rate (ComCod)/100);