I'm trying to use the [LAST] function but can't get it to work correctly.
I'm trying to get the current record and the last record processed. Problem is that, depending on how I write the rule, I get two copies of the same record or the record returned with the 'LAST' function is the last record in the file.
TREE =
file:
loop_group:
record:
FIELD1 = REC-TYPE
FIELD2 = ID
FIELD3 = CODE
FIELD4 = NAME
FIELD5 = IND
Data =
A1|123454|A|JONES|P
A1|123455|A|JOHNSON|P
A1|123456|A|SMITH|P
A1|123456|T|SMITH|P
A1|123457|A|THOMPSON|P
functional map rule = f_map (record:loop_group:file, record[LAST]:loop_group:file)
gives me 'A1|123456|T|SMITH|P' and 'A1|123456|T|SMITH|P'
functional map rule = f_map (record:loop_group:file, record:loop_group[LAST]:file)
gives me 'A1|123456|T|SMITH|P' and 'A1|123457|A|THOMPSON|P'
what I'm looking for is
'A1|123456|T|SMITH|P' and 'A1|123456|A|SMITH|P'
Any help?
ps: What I really need to do is determine if current record FIELD2 = previous record FIELD2 & previous record FIELD3 = 'A'
I'm trying to get the current record and the last record processed. Problem is that, depending on how I write the rule, I get two copies of the same record or the record returned with the 'LAST' function is the last record in the file.
TREE =
file:
loop_group:
record:
FIELD1 = REC-TYPE
FIELD2 = ID
FIELD3 = CODE
FIELD4 = NAME
FIELD5 = IND
Data =
A1|123454|A|JONES|P
A1|123455|A|JOHNSON|P
A1|123456|A|SMITH|P
A1|123456|T|SMITH|P
A1|123457|A|THOMPSON|P
functional map rule = f_map (record:loop_group:file, record[LAST]:loop_group:file)
gives me 'A1|123456|T|SMITH|P' and 'A1|123456|T|SMITH|P'
functional map rule = f_map (record:loop_group:file, record:loop_group[LAST]:file)
gives me 'A1|123456|T|SMITH|P' and 'A1|123457|A|THOMPSON|P'
what I'm looking for is
'A1|123456|T|SMITH|P' and 'A1|123456|A|SMITH|P'
Any help?
ps: What I really need to do is determine if current record FIELD2 = previous record FIELD2 & previous record FIELD3 = 'A'