The script file for the UMF file conversion utility defines how
data in a data source file is converted to UMF. The script file contains
several sections and parameters within those sections. The first four sections,
GLOBAL, RECORD, IMPORT, and EXPORT, are configured during your initial deployment
and are not likely to change. The last section, TRANSFORM, contains the parameters
that you might want to customize.
[GLOBAL] section parameters
The GLOBAL section includes
parameters tha apply to the UMF file conversion utility overall.
- STARTWITH
- Indicates the record that the UMF file conversion utility starts processing
with.
The default value for this parameter is 1. If you are importing a
set of records that contains a set of field names as the first record, you
might want to skip that record and start with the second record in the set.
For
example, to have the UMF file conversion utility skip the first record, specify
a value of 2:
STARTWITH=2
[RECORD] section parameters
The RECORD section includes
parameters that define the structure of the definition file for either the
incoming data source file or the output UMF file. You can add multiple RECORD
sections, each of them numbered; typically, RECORD1 is used for incoming
data source files and RECORD2 is used for the output UMF files.
- DEF
- Specifies the file that contains the data structure of either the incoming
file or output file. You must specify the full path and file name.
There
is no default value.
For example, if the [RECORD] section that contains
this parameter refers to an output UMF file, then this defines the path and
file name for the output file name:
DEF=path\outputvariables.def
- NAME
- Specifies an alias for the definition file that is referenced in this
[RECORD] section.
Because you type this value many times as you create
this script file, you might want to specify a short string.
The default
value for an incoming file is In; the default value for an output file is
Out. Any string value is valid. To specify that the definition file is an
incoming file, type the following in this section:
NAME=In
[IMPORT] section parameters
The IMPORT section tells
the UMF File Conversion Utility which RECORD section to use and what type
of data to expect. You can add multiple [IMPORT] sections, each of them uniquely
numbered, for example, [IMPORT1]. Subsequent keys can use the unique number
to refer to this [IMPORT] section.
- RECORD
- Specifies the [RECORD] section of the script file to use when importing
data.
There is no default value.
To specify the [RECORD1] section,
type:
RECORD=1
- TYPE
- Specifies the structure of the incoming data.
Because the UMF file conversion
utility only works with fixed width files, the only valid value for this parameter
is FW.
To indicate a fixed width input file, type:
TYPE=FW
[TRANSFORM] section parameters
The TRANSFORM section
defines how the conversion utility transforms incoming data before sending
it out. TRANSFORM section parameters are divided into a settings parameter,
and transform parameters. The IMPORTER parameter defines the transform settings.
The beginseg, tagvalue and endseg, parameters define the format of the data
transformation and the remainder of the transforms define how the data is
transformed. Transform parameters modify affect each input record.
- IMPORTER
- This setting parameter specifies which IMPORT section to transform.
There
is no default value.
To specify the [IMPORT1] section, type:
IMPORTER=1
- beginseg
- Indicates the beginning of a new UMF segment.
All calls to tagvalue
place values within the TRANSFORM section.
You can use this key to include
only incoming record segments that contain specific tags.
For example,
to specify that a LAST_NAME tag is required in order to create a UMF_ENTITIY
segment, type:
beginseg UMF_ENTITY, Requires(LAST_NAME)
- tagvalue
- Specifies the name and the corresponding values of new UMF tags.
To
create a UMF tag called NUM_VALUE that contains the social security number
value contained with in the input file, type:
tagvalue ’NUM_VALUE’,In.SocialSecNum
- endseg
- Specifies the end of a UMF segment
To end a UMF segment, type:
endseg
- append
- Adds text or field data to the end of a field.
To put the content of
the StreetName field from incoming data to the end of the Addr1 field where
you are combining all street address information, type:
append In.StreetName,Out.Addr1
- atrim
- Deletes all spaces from the beginning and end of the field.
This key
performs the function of both ltrim and rtrim keys.
To delete spaces
the beginning and end of a field, type:
atrim
- autoinc
- Automatically increments a value in a field by 1.
You can use this key
to create unique numbers for each record. You can also specify a value to
indicate the number you want to start with.
By default, numbering starts
with 0.
To create a field called docref that contains an automatically
incremented value that starts at 35, type:
autoinc Out.docref, 35
- copy
- Copies characters from one field to another.
You must specify the input
field you want to copy from and the output field you want to copy to.
To
copy the contents of a field called StreetName to a field called Addr1, type:
copy In.StreetName, Out.Addr1
- ctrim
- Replaces two or more contiguous spaces with a single space anywhere within
a string.
To delete extra spaces within the Name field, type:
ctrim In.Name
- ifeq
- Performs the next command in a sequence, if the specified value is the
same as the contents of the incoming field.
To check for a Y value in the
Office field of each record, and if a Y is present to replace the Y with a
P, type:
ifeq In.Office,Y
replacechar In.Office,Y,P
- ifneq
- Performs the next command in a sequence, if the specified value is not
the same as the contents of the incoming field.
This is the opposite of
the ifeq key.
To update current employee records with new location codes
indicating whether they are active, on leave, or on vacation, but not update
retired employee records (status=R), type:
ifneq In.Status,R
copy In.LocCode, Out.LocCode
- left
- Extracts a substring from the left of a field.
You can specify how many
characters you want to extract.
To transform a telephone number to only
include the first 3 digits, type:
left In.Phone,3
- lower
- Converts a string to lowercase.
To convert all uppercase letters to
lowercase in the Name field, type:
lower In.Name
- lpad
- Adds spaces to the left end of the field to make sure the field contains
at least the specified number of characters.
To add spaces to the left of
a Name field value that contains less than 5 characters, type:
lpad In.Name,5
- ltrim
- Deletes all spaces from the beginning (left end) of a field.
To remove
all spaces from the left side of values in the Name field, type:
ltrim In.Name
- prepend
- Adds text or field data to the beginning of a field.
To add (702) to
each value in the PhoneNumber field, type:
prepend '(702) ' In.PhoneNumber
- removechar
- Removes all occurrences of a string within a field to clean up unwanted
characters.
To remove the / character from values in the Date field, type:
removechar In.Date,/
- replacechar
- Replaces all occurrences of a string with another string.
You can use
this key to create standard data or change data in a consistent way.
To
replace the / character with the - character in values in the Date field,
type:replacechar In.Date,/,-
- right
- Extracts a substring from the right of a field.
You can specify how
many characters you want to extract.
To extract the last four digits
from the SocialSecurity field, type:
right In.SocialSecurity,4
- rpad
- Adds spaces to the right end of a field to make sure the field contains
at least the specified number of characters.
To add spaces to the right
of a name field value that contains less than 5 characters, type:
rpad In.Name,5
- rtrim
- Deletes all spaces from the end (right end) of a field.
To remove all
spaces from the right side of values in the Name field, type:
rtrim In.Name
- skip
- Skips the record if the specified condition is true for the field.
You
can specify the following conditions:
- blank
- !blank (not blank)
- =
- <=
- >=
- != (not equal)
To skip records whose State field value is not CA, type:
skip In.State,!=,CA
- substr
- Extracts a substring from a field and overwrites the old value in that
field with the specified substring.
To extract the first two characters
from the Status field and replace the current contents of that field with
the extracted substring, type:
substr In.State,!=,CA
- upper
- Converts a string to uppercase.
To convert all lowercase letters to
uppercase in the State field, type:
upper In.State