Mid Function

Mid (string, start character, # of characters)

Problem: The NewYork file presents cost center, account, and account description as a continuous string, rather than as three strings. You want to separate the account strings from the cost center and account description strings.

The image shows the contents of the NewYork GL file. The contents are described in the text preceding the image.

Solution: In the Import Formats screen, assign the following script, which uses the Mid function, to the Expression field of the Account row. The script assigns the characters of the account strings (the characters from positions 7 to 10 of the string) to NY_ParseAccount.

--------------------------------------------------------------------
Function NY_ParseAccount [strField, strRecord]
‘------------------------------------------------------------------
‘ FDM DataPump Import Script:
‘Created by:	FDM_Admin
‘Date created: 2/28/2006
‘------------------------------------------------------------------
NY_ParseAccount = Mid (strField, 7,4)
End Function
--------------------------------------------------------------------
The image shows the Import Formats screen. The expression for the Account row of the NewYork import format contains the NY_ParseAccount script.

Result: Account strings are separated from cost center and account description strings.