Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Previous occurrence of that same output

Status
Not open for further replies.

Ern1e

Programmer
Sep 20, 2006
5
0
0
GB
Within a DSTX output card, how can I make reference to the previous occurrence of that same output ?

So, if I am currently writing output record 10, how could I make reference to an item within output record 9 ?

I assume that with [] you could reference the previous output but this does not seem to work.

Thanks
 
You should be able to just drag and drop a higher rule in an output card to a lower rule in the same output card.

E.g
field1:record:eek:utput = "data"
field2:record:eek:utput = field1:record:eek:utput

it's just the same if the object is repeating. If you have a functional map the soln is a bit more complicated but it should still be possible.

Olly.
 
II am not sure if I have explained myself properly( I am a newbie!). Here's more info :

Input record Output record
Name Surname Name Surname
"Steve" "Martin" "Mr Steve" "Martin"
"Maria" "Martin" * AT THIS POINT *

So in the above example at the point marked I want to be able to evaluate either :

- The previous ocucurrence of the input record i.e. "Steve" "Martin"
- or the prvious occurrence of the output record i.e. "Mr Steve" "Martin"

How can I do this ?

 
Have you tried using [LAST] ? Pass the value to your f_map.

field1:record[LAST]:eek:utput

OR

field1[LAST]:record:eek:utput

May have to add break point to tree.
 
Looks like you want to test to see if this is a duplicate? You can use the UNIQUE function.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Thanks for the example, I'm not sure what you want to map in the * AT THIS POINT *

Do you want to detect that Maria Martin is the daughter or wife of Steve?

The best way to do that is to use control break logic on the input type tree. Rather than defining an input tree of:
field -> Record -> File
You would define an input tree of:
field -> Record -> Family -> File

To work out when a family starts / ends you need to use LAST in the input type tree:
surname:record = surname:record[LAST]

The documentation is good on this, look for "Data break by value" in the 6.7.1 Design Studio Tutorial.

Cheers,
Olly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top