Within source files, not all lines contain all fields. For example, in the Georgia file, entity values, such as 0565 0565 Test 3, are presented in the header of each report section after the Bus Area / Dept label but are not presented in every line. Therefore, entity values must be stored in temporary variables and assigned to the lines of the source file.
For the Georgia file, to store entity values in temporary variables, in the Import Formats screen, you assign the following script to the Expression field of the Amount row. The script uses an If...Then statement and the Mid function to determine whether lines contain the Bus Area / Dept label. If a line contains the label, the script stores the entity value (located in position 33 and including 4 characters) in a temporary variable. If a line does not include the label, strField is assigned to the GetCenter function (GeorgiaGetCenter=strField).
The RES.PvarTemp1 through RES.PvarTemp5 variables are global, and, therefore, remain available throughout the current FDM session (unlike local variables, which lose their values when the current script is closed). Therefore, values stored from within one script can be retrieved by other scripts.
-------------------------------------------------------------------- Function GeorgiaGetCenter [strField, strRecord] ‘------------------------------------------------------------------ ‘ FDM DataPump Import Script: ‘Created by: FDM_Admin ‘Date created: 2/28/2006 ‘------------------------------------------------------------------ If Mid(strRecord, 15,16) = “Bus Area / Dept:” then RES.PvarTemp1 = Mid(strRecord,33,4) End if GeorgiaGetCenter = strField End Function --------------------------------------------------------------------