This repository contains code that leverages SQL to create an FM Journal. The FM Journal can be read by a PowerOn to perform batch FM in JHA Symitar.
You will need to create a user defined table type, several functions, and a stored procedure in your SQL database. The SQL code is located in the SQL folder and should be run in the following order:
- Create the user defined table type by running table.sql
- Create the
formatting
functions by running formatting.sql - Create the
revise
functions by running revise.sql - Create the
create
functions by running create.sql - Create the
changeline
functions by running changeline.sql - Create the stored procedure by running procedure.sql
You will want to make sure to adjust the database and schema names as needed for your environment.
You will need to install the PowerOn in Symitar. It is located in the poweron
folder.
You will need to write a SQL query that returns the data you want to create or revise in the FM Journal. You will need to have the required columns laid out in the Functionality section below.
You will insert your data into the user defined FMTableType with two columns:
- RecordRow - this defines the record you are targeting and it is created from one of the create or revise functions.
- ChangeRow - this defines the change you are making to the record and it is created from one of the changeline functions.
You will then execute the stored procedure FMOutput
with the FMTableType as the input parameter.
The order of operations is as follows:
- Declare the FMTableType variable
- Insert the data into the FMTableType
- Execute the stored procedure
You will need to import the SQL generated text file into the Letter Files folder in Symitar.
You can then run the PowerOn through Run a Batch Program
in Batch Control
to create the FM Journal. The PowerOn takes the following parameters:
- dataFileName - the name of the file you imported - the prompt is
Enter data file name
- outputFileName - the name of the file you want to output the FM Journal to - the prompt is
Enter output file name
You can then run the FM Journal through the Perform FM from PowerOn Output
in Miscellaneous Processing
to perform the actual FM.
The following are some recommendations and troubleshooting tips.
Make sure that whatever you are using to export the SQL generated is done in a way that will preserve line breaks. If using SSMS, you likely need to do the following:
- Go to Tools > Options
- Expand Query Results > SQL Server > Results to Grid
- Tick Retain CR/LF on copy or save
- Restart SSMS
Many systems will create the text file as UTF-8 with BOM. This can cause issues with the PowerOn. You may be able to use a text editor to save the file as UTF-8 without BOM. If that does not work you may want to use a PowerShell or Python script to convert the file.
For an easier QA process it is recommended to dump the targeted records and changes into a temp table (or existing table) before inserting it into the FMTableType. This will allow you to export a CSV of the data as well as the formatted FM Journal. The CSV will be much easier to read and verify the changes before they are made.
Examples are located in the examples folder.
The Branch Closure file contains an example of moving Accounts, Shares, and Loans from one branch to another. It uses the FMReviseChangeLine
function to update the existing records.
The Create Account Tracking file contains an example of creating a new Account Tracking record. It uses the FMCreateChangeLine
function to create a new record, setting the type, and user defined fields with Date, Character and Money data types.
The change line functionality is used to change the value or set a new one. The following are the Change Line functions with their input values below them:
-
This is the change line for the creation of a new record. The input values are:
- DataType (Character, Code, Number, Money, Date, Rate)
- FieldMnemonic (The field mnemonic of the field to be changed)
- NewValue (The new value to be set)
-
This is the change line for the revision of an existing record. The input values are:
- DataType (Character, Code, Number, Money, Date, Rate)
- FieldMnemonic (The field mnemonic of the field to be changed)
- OldValue (The old value to be changed - this will accept a NULL value)
- NewValue (The new value to be set)
-
This is the change line for the expiration of a warning. The input values are:
- WarningCode (Integer warning code type)
- DateValue (The date the warning will expire)
-
This is the change line for the setting of a warning without an expiration date. The input values are:
- WarningCode (Integer warning code type)
The Create functions create the targets for new records. The following are the Create functions with their input values below them:
-
- Account Number
-
- Account Number
- Card Locator
-
- Account Number
- Card Locator
-
- Account Number
- Card Locator
-
- Account Number
-
- Account Number
- Work Card Loc
-
- Account Number
- Loan ID
-
- Account Number
- Loan ID
-
- Account Number
- Loan ID
-
- Account Number
- Loan ID
-
- Account Number
-
- Account Number
- Loan ID
-
- Account Number
- Loan ID
-
- Account Number
- Share ID
-
- Account Number
- Share ID
-
- Account Number
- Share ID
-
- Account Number
-
- Account Number
- Share ID
-
- Account Number
- Share ID
The Revise functions update existing records. The following are the Revise functions with their input values below them:
-
- Account Number
-
- Account Number
- Tracking Locator
-
- Account Number
- Card Locator
- Access Locator
-
- Account Number
- Card Locator
- Name Locator
-
- Account Number
- Card Locator
- Note Locator
-
- Account Number
- Card Locator
-
- Account Number
- Loan ID
- Hold Locator
-
- Account Number
- Loan ID
- Name Locator
-
- Account Number
- Loan ID
- Note Locator
-
- Account Number
- Loan ID
- Pledge Locator
-
- Account Number
- Loan ID
-
- Account Number
- Loan ID
- Tracking Locator
-
- Account Number
- Loan ID
- Transfer Locator
-
- Account Number
- Share ID
- Hold Locator
-
- Account Number
- Share ID
- Name Locator
-
- Account Number
- Share ID
- Note Locator
-
- Account Number
- Share ID
-
- Account Number
- Share ID
- Tracking Locator
-
- Account Number
- Share ID
- Transfer Locator
While a fork of this has been tested and used in a production environment, this was written purely from knowledge and without access to the applicable systems to test this. If you find any issues or have any recommendations please let me know so we can update this repository for others.
- Tom Barkley - tombarkley
This project is licensed under the MIT License - see the LICENSE.md file for details