Dynamic TCL - how to control what data gets in

There are times when Dynamic TCLs seem to be the easiest way to hold onto data for later.  $SVE/$RST never seem to be reliable (since they do not nest) and perhaps Generic Profile update is unavailable to you or it messes with your your AUDA or your CHPPPAGE processing.

In these cases Dynamic TCL processing may be the ticket.   Two typical problems with Dynamic TCLs is:
bulletStoring to many DVAs
bulletDVA'ing data that you do not want later. 

This document discusses ways to prevent these problems.

Dynamic TCL building's only limitation is that they only allow 64 DVA's.    Outside of the 64 DVA limitation Dynamic TCLs are simple and very simple to use.

What we are talking about here is controlling exactly what goes into a Dynamic TCL DVA.  Just how does a builder control exactly what data goes into a dynamic TCL?

When the Dynamic TCL create utility runs, all data in the AUDA gets stuck into the TCL DVAs.   You may have too much data in the AUDA and blow the TCL or you may get data in the TCL that you do not want later.

We have come up with a process which will prevent you from overloading your TCL, let you update a TCL, and allow you to only put the data into the TCL that you want unloaded from the TCL later.

In one word the secrete is CHPPO540.  Look it up.   This is the program that the OrderSet processing uses to create @TCLs.    We figured out all of the settings and %Fields needed to use this program as our helper when creating Dynamic TCLs. 

Using CHPPO540 we can change the priority of AUDA items from 3 to 4.   Then we use a process TCL (stacked by CHPPO540) to change the data we want from 4 to 3.  The Dynamic TCL building program will only put priority 3 data into the TCL.  By setting only some data to priority 3, we only put the data that we want into the TCL.

How does this work?

bulletFind out if the TCL is already there using the tool $P=CHPPVCHK (very important step - if the TCL is there and %ACTION is not properly valued then inconsistent results will occur)
bulletIf the TCL is already there %ACTION=R, else %ACTION=A
bulletCHPPO540 changes all AUDA components priority to priority=4
bullet'processtcl' gets stacked by CHPPO540
bullet'processtcl' must have the the following stack commands:
bullet$R=2  (this allows you to branch around CHPPO54A)
bullet'processtcl' should DVA all components that are wanted to them selves - this changes the priority from 4>3, for example:

Once $P=CHPPDYTB has executed, the Dynamically built TCL will be stackable and available for use, with only the values set in 'processtcl' in it.

Cool?  Cool.