Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: stonysmithYou need to use the "do output" feature.
Setup a standard output statement, but add "where false" to it.
Then use "do output" to cause it to actually write a record.
You may not need the "id" field below, but I added it so that you could see the effect of changing data row to row.
sAMOUNT=int(S_AMOUNT)
output 1 {
emit S_DATE, S_TARIFF, S_STATE, S_SNAME
emit "" as S_GROUP
emit 0 as id
where false
}
i=0
while i<sAMOUNT {
# Give each record a unique ID to match second source
S_GROUP=S_DATE+S_SNAME+S_TARIFF+str(i)
do output 1 {
emit S_DATE, S_TARIFF, S_STATE, S_SNAME,S_GROUP
emit i as id
}
i=i+1
}