TAG Argument

Use the TAG argument in a SELECT command to create an additional output field named TAG that will be available in any segment generated by the command. This allows for the output from multiple SELECT commands to be correlated back to the originating command.

In the following example, the returned records are marked with a TAG value of TODAY or TOMORROW, depending from which LIST statement they come.
OUTPUT ADCOM FIELDS(TAG,ADID,ADFROM,ADSTAT)
SELECT ADCOM ADID(ABC123) VALID(=) TAG(TODAY)
SELECT ADCOM ADID(ABC123) VALID(+1) TAG(TOMORROW)
Note: Any SELECT statements generated from a LIST statement using OPTIONS SELECT(Y) is automatically passed the same TAG argument.