# interest_post.fin include "common_functions.fin" var acctList = ["SAV001", "SAV002", "SAV003"] var rate = 4.5
While loop var count = 1 while (count <= 5) print "Iteration: " + count count = count + 1
for each acct in acctList try var balance = getAccountBalance(acct) if (balance > 0) var interest = calculateInterest(balance, rate, 30) postTransaction("CREDIT", acct, interest) logMessage("INFO", "Interest credited to " + acct)
var intAmt = calculateInterest(50000, 8.5, 30) print "Interest: " + intAmt Functions are — can be assigned to variables or passed as arguments (limited support). 7. File I/O & External Calls # Read file var lines = readFile("/data/input.txt") Write file writeFile("/data/output.txt", "Process completed") Call external REST API (Finacle 10+) var response = callAPI("GET", "https://api.example.com/rate", {}) 8. Error Handling try var bal = getAccountBalance("INVALID_ACCT") catch (err) print "Error code: " + err.code print "Message: " + err.message exit 1
catch (err) logMessage("ERROR", "Failed for " + acct + " : " + err.message)
# interest_post.fin include "common_functions.fin" var acctList = ["SAV001", "SAV002", "SAV003"] var rate = 4.5
While loop var count = 1 while (count <= 5) print "Iteration: " + count count = count + 1
for each acct in acctList try var balance = getAccountBalance(acct) if (balance > 0) var interest = calculateInterest(balance, rate, 30) postTransaction("CREDIT", acct, interest) logMessage("INFO", "Interest credited to " + acct)
var intAmt = calculateInterest(50000, 8.5, 30) print "Interest: " + intAmt Functions are — can be assigned to variables or passed as arguments (limited support). 7. File I/O & External Calls # Read file var lines = readFile("/data/input.txt") Write file writeFile("/data/output.txt", "Process completed") Call external REST API (Finacle 10+) var response = callAPI("GET", "https://api.example.com/rate", {}) 8. Error Handling try var bal = getAccountBalance("INVALID_ACCT") catch (err) print "Error code: " + err.code print "Message: " + err.message exit 1
catch (err) logMessage("ERROR", "Failed for " + acct + " : " + err.message)