AccountingIntegrator Enabler 2.4.0 User Guide Save PDF Selected topic Selected topic and subtopics All content Generic Functions About Generic Functions Generic functions include a vast variety of functional sub functions which goal is to simplify some cases by using simple DML instructions or by avoiding the use of the ITR501 Exit. Caution You can only use sub functions provided by Axway. If you need a specific function that is not yet available, contact the Support Team. We recommend you encapsulate the generic functions inside a custom function, this will make your DML more readable and easily maintainable. $FA Description Use $FA(parameter) to call a specific function embedded in Rule Engine Syntax $FA(Argument1 [;Argument2] [;Argument3] ) Return An alphanumeric up to 256 characters Parameter 1 to 3 arguments maximum 1st argument can only be a constant and is the name of the sub-function. 2nd argument cannot be a constant. The sum of all arguments is limited to 256 characters. Parameters 2 and 3, if defined as field, cannot be a contiguous field of the Input event record. Errors If the first argument is unknown the error message is: $Fx : UNKOWN NAME in RuleEngine execution If the sum of the argument is superior to 256, the error message is: $Fx : NAME TOO LONG in RuleEngine execution Constraint In a mapping rule, $FA must be preceded by another element (Field, constant, variable), before concatenation (Ex : @VAR_VAC1& $FA(...) Ex2 : "ABC" & $FA(... ) Ex3 : PARAM1 &$FA(... ) If you use more FA functions inside a concatenation, they cannot have a table functions (For example, ACCTAB, EXTTAB) as an argument. Example “how to”: “ABC”&$FA("GETFIELD";$ACCTAB(DATXX;"A"))&@VAR Example “how not to”: “ABC”&$FA("GETFIELD";$ACCTAB(DATXX;"A"))&$FA("GETFIELD";$VAR) Example See the example in each sub-function panel. Sub-functions RTRIM, LTRIM, TRIM, LOWER, UPPER,EXTRACT, GETFIELD, Sub-functions DATE Description Use this function to convert a date to string with a specific date format. Available from 2.4.0 SP16 Syntax $FA(“DATE”;Argument2;Argument3) Argument2 The date to be formated. This date must be a valid date in AccountingIntegrator DML langage. It can be either on 7/8 or 10 char, the function will determine which it is, based on the length of the input argument. Caution The date must be on a Year/month/days format. As the function will not control that the date is valid, and will simply apply the transformation base on Argument3 Argument3 A string containing the format of the output date. To describe the format you must use: date Format YYYY for years MM for month DD for days You can use the separating character of your choice. Return Argument2 with the right format Errors If Argument2 is not a valid length, reject the input event with the following error message:_ wrong input date for function DATE "argument2"_ If Argument3 is not a valid pattern, reject the input event with the following error message: _wrong input pattern for function DATE "argument3" Example $FA("Date";DATE_FIELD;"DD.MM.YYYY") where value of DATE_FIELD is "20210526" returns "26.05.2021" Parent functions $FA EXTRACT Description Use this function to EXTRACT a sub-string separated by a specific character Available from 2.4.0 SP6 Syntax $FA(“EXTRACT”;Argument2;Argument3) Argument 2 Field which contains a sub-string delimited by a separator Argument 3 "Character Separator:Position of Field to extract" Return Substring Errors If the number of arguments is incorrect the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION EXTRACT If the position of the field to extract is greater than the number of substrings the error message is: $FA : EXTRACT - NB OF POSITIONS ("[Number]") > NB IN THE INPUT STRING If the character separator is greater than 1 character, the error message is: $FA : EXTRACT - SEPARATOR LENGTH ("[Character Separator") > 1. If the position of field to extract is equal to 0, the error message is: $FA : EXTRACT - NB OF POSITIONS MUST BE > 0. Example $FA("EXTRACT";FIELD1;"/:2 ") where the value of FIELD1 is " a/bb/ccc/dddd" returns "bb" Parent functions $FA GETFIELD Description Use this function to retrieve a field from the Input-Event (not available on MVS) This function can also be used to retrieve a pre-calculation if it is used outside of a pre-calculation itself. Caution A direct mapping with condition from fields in the input is optimized in Rule Engine, performance when using this function is less good in comparison. Available from 2.4.0 SP7 Syntax $FA(“GETFIELD”;Argument2) Argument 2 The name of the field to retrieve from the Input Event. This value cannot be hardcoded in the function. Return The value of the field with the same name as Argument2. This is the exact value as it was received whatever the type of the original field (Alpha, numeric ...). Caution The value is cast as Alphanumeric since $FA only returns alphanumeric so you must manage this in your DML. Errors If the name specified in Argument1 does not exist then the Input Event is rejected with the following message: FONCTION $FA : GETFIELD - CANNOT FIND FIELD: XXXX RULE:YYYY DATE:ZZZZ Where : XXXX is the name of the field that wasn't found YYYY is the rules name which trigger the reject ZZZZ is the date of the rules Example There are two fields in the Input Event: ACCOUNT="Loss&Profit" AMOUNT="12345{" $FA("GETFIELD";FIELD) where FIELD is a pre-calculation with the value "ACCOUNT" and it sends back the value "Loss&Profit" $FA("GETFIELD";@AM) where @AM="AMOUNT" sends back the value "12345{" $FA("GETFIELD";$ACCTAB(TABFIELD;"A")) where the function $ACCTAB sends back the value "ACCOUNT" and then $FA sends back the value "Loss&Profit" Parent functions $FA LOWER Description Use this function to convert text to LOWER case Available from 2.4.0 SP6 Syntax $FA(“LOWER”;Argument2) Argument 2 Text to convert in lower case Return Argument2 converted to lower case Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION LOWER Example $FA("LOWER";FIELD1) where the value of FIELD1 is "ABCDE" returns "abcde" in lower case Parent functions $FA LTRIM Description Use this function to do a LEFT TRIM on a field Available from 2.4.0 SP6 Syntax $FA(“LTRIM”;Argument2;Argument3) Argument 2 The string to be trimmed Argument 3 The character(s) to be used for the trim Return The argument2 trimmed from the first argurment3 character started from the left Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION LTRIM Example $FA("LTRIM";FIELD1;" ") where value of FIELD1 is " ABCDEND" (with spaces on the left returns "ABCDEND" without spaces at the beginning $FA("LTRIM";FIELD1;"BEGIN") where value of FIELD1 "BEGINEND" returns "END" Parent functions $FA RTRIM Description Use this function to do a RIGHT TRIM on a field. Available from 2.4.0 SP6 Syntax $FA(“RTRIM”;Argument2;Argument3) Argument 2 The string to be trimmed Argument 3 The character(s) to be used for the trim Return The argument2 trimmed from the first argurment3 character starting from the right Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION RTRIM Example $FA("RTRIM";FIELD1;" ") where value of FIELD1 is "ABCDEND " (with spaces on the right) returns "ABCDEND" without spaces at the end $FA("RTRIM";FIELD1;"END") where value of FIELD1 "BEGINEND" returns "BEGIN " Parent functions $FA TRIM Description Use this function to do a TRIM on a field. Available from 2.4.0 SP6 Syntax $FA(“TRIM”;Argument1;Argument2) Argument 2 The string to be trimmed Argument 3 The character(s) to be used for the trim Return The argument2 trimmed from the argurment3 character Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION TRIM Example $FA("TRIM";FIELD1;" ") where value of FIELD1 is " A B C D E ND " (with spaces on the center) returns "ABCDEND" without spaces $FA("TRIM";FIELD1;"MIDDLE") where value of FIELD1 "BEGINMIDDLEEND" returns "BEGINEND" Parent functions $FA UPPER Description Use this function to convert text to UPPER case. Available from 2.4.0 SP6 Syntax $FA(“UPPER”;Argument2) Argument 2 Text to convert in upper case Return Substring Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION LOWER Example $FA("UPPER";FIELD1) where the value of FIELD1 is "abcde" returns "ABCDE" in upper case Parent functions $FA $FN Description Use $FN(parameter) to call a specific function embedded in Rule Engine Syntax $FN(Argument1 [;Argument2] [;Argument3] ) Return A signed or unsigned numeric up to 31 characters; Parameter 1 to 3 arguments maximum 1st argument can only be a constant and is the name of the sub-function. 2nd argument cannot be a constant. The length of the function is limited to 256 characters. If the 2nd and 3rd arguments are defined as fields, they cannot be contiguous fields of the Input Event record. Errors If the first argument is unknown, the error message is: $Fx : UNKOWN NAME in RuleEngine execution If the length of the function is superior to 256, the error message is: $Fx : NAME TOO LONG in RuleEngine execution Constraint $FN is not yet supported in schema and mapping generation conditions. If you wish to use $FN in a concatenation in a mapping rule, you must be aware of the following restrictions: The function must be preceded by another element (field, constant, variable). Examples: @VAR_VAC1 & $FN(...) "ABC" & $FN(... ) PARAM1 & $FN(... ) The function cannot be used in concatenations that involve calculation operators. It can, however, be used in concatenations OR calculations: Examples “how to”: $FN("GETFIELD";<argument>) +123 "xx" & $FN("GETFIELD";<argument>) & "yy" Examples “how not to”: "xx" &($FN("GETFIELD";<argument>) +123) 123&$FN("GETFIELD";PARAM5)=114 If you use more $FN functions inside a concatenation, they cannot have a table function (e.g. ACCTAB, EXTTAB) as an argument: Example “how to”: “1234”&$FN("GETFIELD";$ACCTAB(DATXX;"A"))&@VAR Example “how not to”: “1234”&$FN("GETFIELD";$ACCTAB(DATXX;"A"))&$FN("GETFIELD";$VAR) Example See example in each sub-function panel. Sub-functions GETFIELD, FIND Sub-functions FIND Description Use this function to search for a specific string in a given input field. Available from 2.4.0 SP14 Syntax $FN("FIND";[Argument2];[Argument3]) Argument 2 The string to search Argument 3 The field where you want to perform the search Return A numeric value indicating the position of the first character where the string has been found Errors If the number of arguments is incorrect, the error message is : $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION FIND Example We have the following objects: A variable @VAR1= ”Mc” An input field FIELD1= "Miriam McGovern”, $FN("FIND"; @VAR1; FIELD1) returns the position of the first occurrence, a numeric value: “8” Parent functions $FN GETFIELD Description Use this function to retrieve the value of an Input-Event field (not available on MVS); It can be used in mathematical operations (Addition/Subtraction/Multiplication/Division); This function can also be used to retrieve the value of a pre-calculation, if it is used outside of the pre-calculation itself. Caution A direct mapping with condition from fields in the input is optimized in Rule Engine, performance when using this function is less good in comparison. . Available from 2.4.0 SP14 Syntax $FN(“GETFIELD”;[Argument2]) Argument 2 The name of the field to retrieve from the Input Event. This value cannot be hardcoded in the function. Return The value of the field indicated by [Argument2]. This is the exact value as it was received whatever the type of the original field (alpha, numeric ...). Caution The return value is cast as signed/unsigned numeric since $FN only returns signed/unsigned numeric so you must manage this in your DML. Numbers with decimals are not managed. Errors If the name specified in [Argument2] does not exist, then the Input Event is rejected with the following message: FONCTION $FN: GETFIELD - CANNOT FIND FIELD: XXXX RULE:YYYY DATE:ZZZZ Where : • XXXX is the name of the field that was not found • YYYY is the rule name which triggered the reject • ZZZZ is the date of the rules Example There are two fields in the Input Event: AMOUNT1="123" AMOUNT2="12345F" $FN("GETFIELD";FIELD) where FIELD is a pre-calculation with the value "AMOUNT1"; returns the signed value "12C" $FN("GETFIELD";@AM) where the variable @AM="AMOUNT2"; returns the numeric value "123456" $FN("GETFIELD";@AM) * 100 ; the multiplication returns the numeric value "12345600" Parent functions $FN Related Links
Generic Functions About Generic Functions Generic functions include a vast variety of functional sub functions which goal is to simplify some cases by using simple DML instructions or by avoiding the use of the ITR501 Exit. Caution You can only use sub functions provided by Axway. If you need a specific function that is not yet available, contact the Support Team. We recommend you encapsulate the generic functions inside a custom function, this will make your DML more readable and easily maintainable. $FA Description Use $FA(parameter) to call a specific function embedded in Rule Engine Syntax $FA(Argument1 [;Argument2] [;Argument3] ) Return An alphanumeric up to 256 characters Parameter 1 to 3 arguments maximum 1st argument can only be a constant and is the name of the sub-function. 2nd argument cannot be a constant. The sum of all arguments is limited to 256 characters. Parameters 2 and 3, if defined as field, cannot be a contiguous field of the Input event record. Errors If the first argument is unknown the error message is: $Fx : UNKOWN NAME in RuleEngine execution If the sum of the argument is superior to 256, the error message is: $Fx : NAME TOO LONG in RuleEngine execution Constraint In a mapping rule, $FA must be preceded by another element (Field, constant, variable), before concatenation (Ex : @VAR_VAC1& $FA(...) Ex2 : "ABC" & $FA(... ) Ex3 : PARAM1 &$FA(... ) If you use more FA functions inside a concatenation, they cannot have a table functions (For example, ACCTAB, EXTTAB) as an argument. Example “how to”: “ABC”&$FA("GETFIELD";$ACCTAB(DATXX;"A"))&@VAR Example “how not to”: “ABC”&$FA("GETFIELD";$ACCTAB(DATXX;"A"))&$FA("GETFIELD";$VAR) Example See the example in each sub-function panel. Sub-functions RTRIM, LTRIM, TRIM, LOWER, UPPER,EXTRACT, GETFIELD, Sub-functions DATE Description Use this function to convert a date to string with a specific date format. Available from 2.4.0 SP16 Syntax $FA(“DATE”;Argument2;Argument3) Argument2 The date to be formated. This date must be a valid date in AccountingIntegrator DML langage. It can be either on 7/8 or 10 char, the function will determine which it is, based on the length of the input argument. Caution The date must be on a Year/month/days format. As the function will not control that the date is valid, and will simply apply the transformation base on Argument3 Argument3 A string containing the format of the output date. To describe the format you must use: date Format YYYY for years MM for month DD for days You can use the separating character of your choice. Return Argument2 with the right format Errors If Argument2 is not a valid length, reject the input event with the following error message:_ wrong input date for function DATE "argument2"_ If Argument3 is not a valid pattern, reject the input event with the following error message: _wrong input pattern for function DATE "argument3" Example $FA("Date";DATE_FIELD;"DD.MM.YYYY") where value of DATE_FIELD is "20210526" returns "26.05.2021" Parent functions $FA EXTRACT Description Use this function to EXTRACT a sub-string separated by a specific character Available from 2.4.0 SP6 Syntax $FA(“EXTRACT”;Argument2;Argument3) Argument 2 Field which contains a sub-string delimited by a separator Argument 3 "Character Separator:Position of Field to extract" Return Substring Errors If the number of arguments is incorrect the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION EXTRACT If the position of the field to extract is greater than the number of substrings the error message is: $FA : EXTRACT - NB OF POSITIONS ("[Number]") > NB IN THE INPUT STRING If the character separator is greater than 1 character, the error message is: $FA : EXTRACT - SEPARATOR LENGTH ("[Character Separator") > 1. If the position of field to extract is equal to 0, the error message is: $FA : EXTRACT - NB OF POSITIONS MUST BE > 0. Example $FA("EXTRACT";FIELD1;"/:2 ") where the value of FIELD1 is " a/bb/ccc/dddd" returns "bb" Parent functions $FA GETFIELD Description Use this function to retrieve a field from the Input-Event (not available on MVS) This function can also be used to retrieve a pre-calculation if it is used outside of a pre-calculation itself. Caution A direct mapping with condition from fields in the input is optimized in Rule Engine, performance when using this function is less good in comparison. Available from 2.4.0 SP7 Syntax $FA(“GETFIELD”;Argument2) Argument 2 The name of the field to retrieve from the Input Event. This value cannot be hardcoded in the function. Return The value of the field with the same name as Argument2. This is the exact value as it was received whatever the type of the original field (Alpha, numeric ...). Caution The value is cast as Alphanumeric since $FA only returns alphanumeric so you must manage this in your DML. Errors If the name specified in Argument1 does not exist then the Input Event is rejected with the following message: FONCTION $FA : GETFIELD - CANNOT FIND FIELD: XXXX RULE:YYYY DATE:ZZZZ Where : XXXX is the name of the field that wasn't found YYYY is the rules name which trigger the reject ZZZZ is the date of the rules Example There are two fields in the Input Event: ACCOUNT="Loss&Profit" AMOUNT="12345{" $FA("GETFIELD";FIELD) where FIELD is a pre-calculation with the value "ACCOUNT" and it sends back the value "Loss&Profit" $FA("GETFIELD";@AM) where @AM="AMOUNT" sends back the value "12345{" $FA("GETFIELD";$ACCTAB(TABFIELD;"A")) where the function $ACCTAB sends back the value "ACCOUNT" and then $FA sends back the value "Loss&Profit" Parent functions $FA LOWER Description Use this function to convert text to LOWER case Available from 2.4.0 SP6 Syntax $FA(“LOWER”;Argument2) Argument 2 Text to convert in lower case Return Argument2 converted to lower case Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION LOWER Example $FA("LOWER";FIELD1) where the value of FIELD1 is "ABCDE" returns "abcde" in lower case Parent functions $FA LTRIM Description Use this function to do a LEFT TRIM on a field Available from 2.4.0 SP6 Syntax $FA(“LTRIM”;Argument2;Argument3) Argument 2 The string to be trimmed Argument 3 The character(s) to be used for the trim Return The argument2 trimmed from the first argurment3 character started from the left Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION LTRIM Example $FA("LTRIM";FIELD1;" ") where value of FIELD1 is " ABCDEND" (with spaces on the left returns "ABCDEND" without spaces at the beginning $FA("LTRIM";FIELD1;"BEGIN") where value of FIELD1 "BEGINEND" returns "END" Parent functions $FA RTRIM Description Use this function to do a RIGHT TRIM on a field. Available from 2.4.0 SP6 Syntax $FA(“RTRIM”;Argument2;Argument3) Argument 2 The string to be trimmed Argument 3 The character(s) to be used for the trim Return The argument2 trimmed from the first argurment3 character starting from the right Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION RTRIM Example $FA("RTRIM";FIELD1;" ") where value of FIELD1 is "ABCDEND " (with spaces on the right) returns "ABCDEND" without spaces at the end $FA("RTRIM";FIELD1;"END") where value of FIELD1 "BEGINEND" returns "BEGIN " Parent functions $FA TRIM Description Use this function to do a TRIM on a field. Available from 2.4.0 SP6 Syntax $FA(“TRIM”;Argument1;Argument2) Argument 2 The string to be trimmed Argument 3 The character(s) to be used for the trim Return The argument2 trimmed from the argurment3 character Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION TRIM Example $FA("TRIM";FIELD1;" ") where value of FIELD1 is " A B C D E ND " (with spaces on the center) returns "ABCDEND" without spaces $FA("TRIM";FIELD1;"MIDDLE") where value of FIELD1 "BEGINMIDDLEEND" returns "BEGINEND" Parent functions $FA UPPER Description Use this function to convert text to UPPER case. Available from 2.4.0 SP6 Syntax $FA(“UPPER”;Argument2) Argument 2 Text to convert in upper case Return Substring Errors If the number of arguments is incorrect, the error message is: $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION LOWER Example $FA("UPPER";FIELD1) where the value of FIELD1 is "abcde" returns "ABCDE" in upper case Parent functions $FA $FN Description Use $FN(parameter) to call a specific function embedded in Rule Engine Syntax $FN(Argument1 [;Argument2] [;Argument3] ) Return A signed or unsigned numeric up to 31 characters; Parameter 1 to 3 arguments maximum 1st argument can only be a constant and is the name of the sub-function. 2nd argument cannot be a constant. The length of the function is limited to 256 characters. If the 2nd and 3rd arguments are defined as fields, they cannot be contiguous fields of the Input Event record. Errors If the first argument is unknown, the error message is: $Fx : UNKOWN NAME in RuleEngine execution If the length of the function is superior to 256, the error message is: $Fx : NAME TOO LONG in RuleEngine execution Constraint $FN is not yet supported in schema and mapping generation conditions. If you wish to use $FN in a concatenation in a mapping rule, you must be aware of the following restrictions: The function must be preceded by another element (field, constant, variable). Examples: @VAR_VAC1 & $FN(...) "ABC" & $FN(... ) PARAM1 & $FN(... ) The function cannot be used in concatenations that involve calculation operators. It can, however, be used in concatenations OR calculations: Examples “how to”: $FN("GETFIELD";<argument>) +123 "xx" & $FN("GETFIELD";<argument>) & "yy" Examples “how not to”: "xx" &($FN("GETFIELD";<argument>) +123) 123&$FN("GETFIELD";PARAM5)=114 If you use more $FN functions inside a concatenation, they cannot have a table function (e.g. ACCTAB, EXTTAB) as an argument: Example “how to”: “1234”&$FN("GETFIELD";$ACCTAB(DATXX;"A"))&@VAR Example “how not to”: “1234”&$FN("GETFIELD";$ACCTAB(DATXX;"A"))&$FN("GETFIELD";$VAR) Example See example in each sub-function panel. Sub-functions GETFIELD, FIND Sub-functions FIND Description Use this function to search for a specific string in a given input field. Available from 2.4.0 SP14 Syntax $FN("FIND";[Argument2];[Argument3]) Argument 2 The string to search Argument 3 The field where you want to perform the search Return A numeric value indicating the position of the first character where the string has been found Errors If the number of arguments is incorrect, the error message is : $Fx : WRONG NUMBER OF PARAMETERS FOR FUNCTION FIND Example We have the following objects: A variable @VAR1= ”Mc” An input field FIELD1= "Miriam McGovern”, $FN("FIND"; @VAR1; FIELD1) returns the position of the first occurrence, a numeric value: “8” Parent functions $FN GETFIELD Description Use this function to retrieve the value of an Input-Event field (not available on MVS); It can be used in mathematical operations (Addition/Subtraction/Multiplication/Division); This function can also be used to retrieve the value of a pre-calculation, if it is used outside of the pre-calculation itself. Caution A direct mapping with condition from fields in the input is optimized in Rule Engine, performance when using this function is less good in comparison. . Available from 2.4.0 SP14 Syntax $FN(“GETFIELD”;[Argument2]) Argument 2 The name of the field to retrieve from the Input Event. This value cannot be hardcoded in the function. Return The value of the field indicated by [Argument2]. This is the exact value as it was received whatever the type of the original field (alpha, numeric ...). Caution The return value is cast as signed/unsigned numeric since $FN only returns signed/unsigned numeric so you must manage this in your DML. Numbers with decimals are not managed. Errors If the name specified in [Argument2] does not exist, then the Input Event is rejected with the following message: FONCTION $FN: GETFIELD - CANNOT FIND FIELD: XXXX RULE:YYYY DATE:ZZZZ Where : • XXXX is the name of the field that was not found • YYYY is the rule name which triggered the reject • ZZZZ is the date of the rules Example There are two fields in the Input Event: AMOUNT1="123" AMOUNT2="12345F" $FN("GETFIELD";FIELD) where FIELD is a pre-calculation with the value "AMOUNT1"; returns the signed value "12C" $FN("GETFIELD";@AM) where the variable @AM="AMOUNT2"; returns the numeric value "123456" $FN("GETFIELD";@AM) * 100 ; the multiplication returns the numeric value "12345600" Parent functions $FN