You are here: LANSA for i User Guide > 3. Files > 3.20 Tips and Techniques for Defining Files Using LANSA > 3.20.1 The Chicken and the Egg Situation

3.20.1 The Chicken and the Egg Situation

This situation may arise when setting up a series of file definitions that refer to one another. Consider the following file definitions that are to be set up using LANSA:

FILEA: has a validation rule that references FILEB. FILEB has an access route to FILEC.

FILEB: has batch control logic that references FILEA, which has an access route to FILEA. FILEA has an access route to FILEC.

FILEC: has a validation rule that references FILEB, which has an access route to FILEA. FILEA has an access route to FILEB.

If we begin to set up FILEA using LANSA it will not be possible to specify the validation rule that references FILEB because FILEB does not exist yet. Likewise the access route to FILEC cannot be specified because FILEC does not exist yet.

The chicken and egg situation is this: FILEA cannot be set up because it references FILEB ... and FILEB cannot be set up because it references FILEA.

The solution: