Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: stonysmithYou have to have an "output" statement first:
======================
output 1 {
emit 0 as One
where false
}
while i < 50 {
do output 1 {
emit 1 as One
}
i = i + 1
}
======================
The "where false" is important so that the statement doesn't get executed an extra time, but rather only when you call the "do output". Any where condition in the original "output" statement is ignored when the "do output" statement is executed.
It's also important to know that this entire set of code will be run for EACH input record. If you have two input records, you'll get 100 output records.