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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting only selected records

Status
Not open for further replies.

jmanj

Programmer
May 20, 2003
298
US
How can I select a particular record from a file. How can I use EXTRACT function to do this. I only want to output the record if both credit amount field and debit amount field have the same values. My output type tree consist only of two record type: a header (1:1) and a detail(s).

Do I have to pair the EXTRACT function with RESTART function?

Thanks for any healp...

jmanj
 
Unless I'm missing something, the rule for the detail record would be EXTRACT(Input Record, Debit Amount:Input Record = Credit Amount:Input Record)
 
Hi,
In addition to what rivell has said just small note that the Extract function will pickup multiple records matching the condition specified in the Extract function if you map the above rule in details(s) field which is correct,
but if you map the same rule in the header(1:1) field (which I think u might not be doing so just FYI) in that case the Extract function will work as the LookUp function and will pickup 1st instance for the matching condition.

Also there is no need to pair Extract function with Restart function (FYI no Restart function in Mercator map but it is attribute that you can set in the Type Tree ) but it is preferabe to have this Restart attribute set for a group which may contain invalid data in which case the map wont halt/stop in between rather just ignores the invalid record and moves ahead while it checks the Input data passed to the Input TypeTree.
You can find the Invalid record using REJECT function (REJECT(Record)) just incase u prefer to maintain the Error log.

Please let me know if you still need more information or incase if you think I'm missing something.

cheers,
Shrini.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top