Name Separation Utility

Some programs have a need to separate a name into its component parts, e.g., last name, first name, middle name or initial and name suffix. If a program only has access to the full name (e.g., SIS), a routine is needed to separate the component parts of the name. This utility will separate the name in such a fashion.

The full name must be in a particular format for this utility to work. For lack of a better term, call it the SIS name format. Briefly, this format is:

llll, ffff mmmm[, ssss]

where:
llll = last name
ffff = first name
mmmm = middle name or initial (if any)
ssss = name suffix (if any)

or last name is, e.g., Jones Jr, in which case no official suffix field will exist.

The following are examples of correct full name format:

The routine is only useable in Easytrieve Plus or Cobol. The routine has an Easytrieve Plus include to quickly and easily define the variables needed to use the routine. It is called LIB9050B.

The module which performs the utility is IS9050B in Easytrieve Plus. For Cobol, the module IS9050A needs to be accessed.

The working storage area used to interface is 146 bytes in 3 groups:

When the last name contains the name suffix (e.g., Adams Jr.), the name suffix will be included in the last name field and will not be in a separate field.

The IS9050B Include is invoked as follows:

%IS9050B xxx

where xxx is the variable containing the 146 character interface string. If the LIB9050B module is included in the program, this would be HPARM.

IS9050B Example

A sample program might look as follows:


MACRO
FILE FILE01
   ...
   ...
   ...
  %LIB9050B

JOB INPUT NULL
  HPARM2 = 'Adams, John Q, Jr.'
  %IS9050B HPARM
  DISPLAY HPARM3
  STOP

This is a very simplistic example of use of the IS9050B routine. It will separate the name into its component parts.

No JCL changes are required to use this utility.

Limitations

Only the indicated full name format is supported.

How It Works

The routine hunts for a comma. Anything before the first comma is placed in the last name field. Next, a second comma is sought. If found, anything after it is placed in the name suffix field. The routine also searches for the first blank following the first comma. Information before the blank (and after the comma) is placed in the first name field. Information after the blank (but before the second comma, if it exists) is placed in the middle name field.