13 3 Process Name Truncation and Duplicate Object Names

LANSA Application Design

13.3 Process Name Truncation and Duplicate Object Names

Process names are truncated on the left as they are converted to equivalent non-IBM i object names.

If you are using a naming standard like "ooooPROCnn" (where "oooo" is the object name) then you might have several processes named like this:

CUSTPROC01 (CUST = Customer)

OUSTPROC01 (OUST = Overseas Customer)

DUSTPROC01 (DUST = Domestic Customer)

 

In this case, the left truncated name for all of these processes would be defaulted by Visual LANSA to be STPROC01, which is a clear conflict.

In situations where the default left truncation algorithm causes duplicated names, you can solve this problem by using the Process Alias file x_palias.dat.

x_palias.dat is a normal source file that may optionally exist in the <drive/root>\x_lansa directory. It is edited by any normal source editor such as EDIT or EPM, can have at most 100 records, and must be formatted like this:

<Name Mask>,<Start1>,<Len1>,<Start2>,<Len2>,<Start3>,<Len3>

 

For example, this is a valid entry in x_palias.dat:

                 ????PROC??,4,4,1,4,9,2

 

The "?" marks are wild card characters. In this case any process named like "????PROC??" will have its name altered to:

"substring(name,4,4) :: substring(name,1,4) :: substring(name,9,2)"

 

 

where "::" denotes a concatenation operation.

So the previous examples of conflicting names:

CUSTPROC01 (CUST = Customer)

OUSTPROC01 (OUST = Overseas Customer)

DUSTPROC01 (DUST = Domestic Customer)

 

would be altered to their alias values before they are subjected to the left truncation and invalid character removal algorithm:

Actual

Alias

Truncated

CUSTPROC01

PROCCUST01

OCCUST01

OUSTPROC01

PROCOUST01

OCOUST01

DUSTPROC01

PROCDUST01

OCDUST01

 

You could also control the truncation phase by using an x_palias.dat entry like this:

               ????PROC??,1,4,5,2,9,2

 

 

to produce non-conflicting names like this:

Actual

Alias

Truncated

CUSTPROC01

CUSTPR01

CUSTPR01

OUSTPROC01

OUSTPR01

OUSTPR01

DUSTPROC01

DUSTPR01

DUSTPR01

 

Before creating or editing x_palias.dat (in x_lansa) please read and observe the following rules and guidelines:

  • This facility is provided to allow existing applications to run unchanged. Where duplicate names are encountered, please take immediate steps to ensure that no further (i.e.: new objects) are created that cause naming conflicts to occur. In the case of RUOM objects, a system flag setting may be used to ensure that shorter 8 character process names are generated. However, you should use extreme caution in deciding to turn this option on as it may cause all existing processes to be (re)generated by RUOM with the new (and different) 8 character names.
  • When specifying X_PALIAS data check, and then double check, each entry very carefully. For performance reasons the routines that read x_palias.dat do almost no error checking. Invalid or badly formatted data may cause application failure and/or unpredictable results.

The format is:

<Name Mask>,<Start1>,<Len1>,<Start2>,<Len2>,<Start3>,<Len3>

 

where:

  • <Name Mask> is from 1 to 10 characters. Imbedded blanks are not allowed. "?" wildcard characters are supported. The mask must be delimited from the <Start1> value by a single comma. Leading blanks are not supported.
  • <Startn> is a substring start position in the range 1 to 10. Special value 0 may be used to indicate that a substring operation is not required.
  • <Lenn> is a substring length in the range 1 to 10. l Special value 0 may be used to indicate that a substring operation is not required. The combination of a start position and length that is outside the length imposed by the length of the mask will cause unpredictable results and/or application failure.

There must be exactly 6 commas on each line delimiting the mask and 3 pairs of substring values exactly as shown.

There must be exactly 3 pairs of substring values separated by commas. Where a <Startn>,<Lenn> pair is not required use the special value 0. For example:

                  ????PROC??,1,10,0,0,0,0

 

 

is valid and produces an alias identical to the starting name.

  • There must be no more than 100 lines/entries in this file.
  • The recommended standard entry for resolving RUOM generated process name conflicts is:

                  ????PROC??,1,4,5,2,9,2

 

 

  • x_palias.dat entries are processed from first to last until a match is found. When a match is found, processing terminates and no further comparisons are performed. Thus mask precedence is determined by the closeness of the mask to the start of the x_palias.dat file.
  • When designing a sub-stringing algorithm you must avoid an approach that will result in conflicts with other objects such as 7 character RDML function names and 8 character OAM names. The substring approach you adopt and any results or problems that it causes, in any form whatsoever, are entirely your own responsibility.
  • When you create or change the x_palias.dat file please note:
  • You should manually delete any source, object or executable files that were created as a result of the previous (i.e. prior to your change) naming truncation/algorithm being used.
  • You should force a regenerate/recompile of all the processes on your system that will now have a new alias name produced as a result of the x_palias.dat changes you have made. Note that this point refers to processes - it does not refer to RDML functions.
  • Remember to export x_palias.dat when moving/migrating your application to another system. The content of x_palias.dat is loaded into memory when you execute a Visual LANSA generated application via the x_run command.
  • No matter what process naming/truncation method you use, the effect is only at the lowest level. There are no changes required in Visual LANSA or in RDML coding. At these levels the process is known by, and always referenced by, its full 10 character name.

    Likewise, the name you always specify on the x_run command (in the PROC= parameter) is the full 10 character LANSA process name.