Sequences of DATA-GEN operations
DATA-GEN *START %DATA(filename : 'doc=file') %GEN('MYPGM');
DATA-GEN ds1 %DATA(filename : 'doc=file output=continue') %GEN('MYPGM');
DATA-GEN *END %DATA('myfile.txt' : 'doc=file') %GEN('MYPGM');
The DATA-GEN operations in a sequence can be done in different procedures, but they must all be in the same activation group and thread.
However, when the procedure with the DATA-GEN *START operation ends, the sequence ends even if the DATA-GEN *END operation has not been done. If you want to be sure to get control when the sequence ends, enable the QrnDgEvent_12_Terminate event. You request this event by setting the doTerminateEvent subfield of the parameter that is passed to the generator to '1'.
The generatorState pointer is available to all the operations in the sequence
If you placed a pointer in the generatorState, this pointer is available to all the subsequent operations in the sequence.
Performing clean-up activities when an operation is part of a sequence
If you have activities that must be performed at the end of the generation, and the operation is part of a sequence, wait to perform the clean-up activities until there are no further events possible. If the generator has set the doTerminateEvent subfield of the parameter that is passed to the generator to '1', perform the clean-up activities during the QrnDgEvent_12_Terminate event. Otherwise, perform the clean-up activities during the QrnDgEvent_02_EndMultiple event.
