VisualAge Generator to Enterprise Generation Language Migration Guide

Checking for IN literal or scalar

VisualAge Generator: VisualAge Generator supports the IF or WHILE statement checking for a data item IN a literal or scalar. In this situation, VisualAge Generator sets the value of EZETST and does a comparison for equality.

EGL: EGL does not support checking a data item for IN a literal or scalar.

Associated part needed for migration: Not applicable.

Figure 47. Checking for IN literal or scalar

Migrating with the associated part
Migrating without the associated part

For an IF or WHILE statement that checks a data item IN a literal, the migration tool does the following to match the VAGen behavior:

  • Adds a statement to initialize sysVar.arrayIndex to 0.
  • Changes the if or while statement to compare equal (For example, if a = "b").
  • Adds a statement immediately after the if or while to set sysVar.arrayIndex to 1.

For an IF or WHILE statement that checks a data item IN another data item, the migration tool does not attempt to determine if the second data item is an array or a scalar. The migration tool migrates to an EGL in comparison. (For example: if a in b).

The migration tool does the same thing as mentioned in the Migrating with the associated part column.

Potential Problem: There is no problem if the comparison is for a literal. A problem only arises if the second data item is actually a scalar. In this case, there will be an error on the Tasks list.

Solution: Modify the function to initialize sysVar.arrayIndex to 0 before the if or while statement and to set sysVar.arrayIndex to 1 immediately after the if or while statement. Also change the if or while statement to compare using = rather than in.

Potential Problem: The same potential problem and solution as listed in the Migrating with the associated part column apply.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]