*GO 
Allowed uses: By Commit, SQL
The *GO instruction is used like a *COMMIT statement between *WHEN/*ENDWHEN structures. The *GO instruction defines the end of a logic section, much like the *COMMIT instruction. Unlike a *COMMIT, data is not posted to the database. Instead, all generated results are merged with the original set of source records and the logic restarts from the beginning of the recordset for the next *WHEN/*ENDWHEN structure.
There is no limit to the number of *GO instructions that can be inserted within a *COMMIT section. However, since each *GO requires an additional analysis of the record set, keep their number to a minimum.
The *GO instruction cannot always be used in place of a *COMMIT instruction. All instructions that are *COMMIT-specific (for example XDIM_MEMBERSET) are still *COMMIT-specific and not *GO-specific. That is, you cannot redefine the data region to process for each *GO instruction, but only for each *COMMIT instruction. The *GO instruction only sets a stop-and-go point between *WHEN/*ENDWHEN structures of the same *COMMIT section, that is, of the same data region.
Example of why *GO was created
Multiple sequential WHEN / ENDWHEN structures are processed in sequence for each record found in the source region. As a result, the following example might not work correctly:
Example
//----------------------------------------------------------
*WHEN ACCOUNT
*IS UnitsSold
*REC(FACTOR=GET(ACCOUNT=”Price”), ACCOUNT=Sales)
*ENDWHEN
*WHEN ACCOUNT
*IS Sales
*REC(FACTOR=.08, ACCOUNT=SaleTaxes)
*ENDWHEN
//----------------------------------------------------------
The reason this logic does not work is that the value of account Sales held in memory is not the newly calculated one, but the value found in the database before the new value is calculated. Sales, once calculated, must be posted to the database with a *COMMIT instruction, and then retrieved for the subsequent calculation of Sales Taxes, as follows:
//----------------------------------------------------------
*WHEN ACCOUNT
*IS UnitsSold
*REC(FACTOR=GET(ACCOUNT=”Price”), ACCOUNT=Sales)
*ENDWHEN
*COMMIT
*WHEN ACCOUNT
*IS Sales
*REC(FACTOR=.08, ACCOUNT=SaleTaxes)
*ENDWHEN
//----------------------------------------------------------
A better way to write this logic would be to calculate SalesTaxes at the same time Sales are calculated, as shown here:
//----------------------------------------------------------
*WHEN ACCOUNT
*IS UnitsSold
*REC(FACTOR=GET(ACCOUNT=”Price”), ACCOUNT=Sales)
*REC(FACTOR=GET(ACCOUNT=”Price”) * .08, ACCOUNT=SalesTaxes)
*ENDWHEN //----------------------------------------------------------
However, there are situations where this is not a practical approach. For these situations, to avoid the inefficiencies of a *COMMIT step, the instruction *GO can be used. Here is how the above logic would look using *GO:
//----------------------------------------------------------
*WHEN ACCOUNT
*IS UnitsSold
*REC(FACTOR=GET(ACCOUNT=”Price”), ACCOUNT=Sales)
*ENDWHEN
*GO
*WHEN ACCOUNT
*IS Sales
*REC(FACTOR=.08, ACCOUNT=SaleTaxes)
*ENDWHEN
//----------------------------------------------------------