GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Data Warehousing  >  Abinitio
Go To First  |  Previous Question  |  Next Question 
 Abinitio  |  Question 123 of 196    Print  
Whats the best way in a AI GRAPH to read the header 1st line and trailer (last line) in a i/p file, compare record counts and checksum (available in header) and error out if actual recd count or checksum did not match?

  
Total Answers and Comments: 5 Last Update: August 26, 2009     Asked by: mla 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 31, 2006 06:47:20   #1  
bhanu        

RE: Whats the best way in a AI GRAPH to read the heade...

we can use run compononent in the parameters tab for commandline give unix AWK command for skipping the specified record num

awk '{if(NR! 1 && NR! 2) print $0}' this we can use for first record

or else we can use onemore component read seperated value in the parameters tab u can specify skipheader as true

This is upto my knowledge

Thanks

Bhanu


 
Is this answer useful? Yes | No
September 22, 2006 17:22:28   #2  
dontbuckme Member Since: September 2006   Contribution: 8    

RE: Whats the best way in a AI GRAPH to read the heade...

If the input dml has record type simply do FBE will do.

If the input dml has no record type but with n as End of Record do a wc -l up front and pass the result back to the graph will do the trick.

Otherwise you need to assign a sequence number (next_in_sequence) using Reformat also capture the log port for the record count. Then:

Header: sequence number 1

Do a join with the source data (say in0) and from the record count capture from the previous Reformat log port (say in1).

Trailer: in0.sequencenumber in1.reccount


 
Is this answer useful? Yes | No
December 22, 2006 02:06:53   #3  
mukund        

RE: Whats the best way in a AI GRAPH to read the heade...

guys

to read header detail trailer from input file separately do validatins for these

use conditional dml where we can separate detail from header and trailer

for validations u have to use reformat with count :3(out0:header Out1:detail Out2:trailer.)

if any doubts further let me know

cheers

mukund


 
Is this answer useful? Yes | No
January 19, 2007 10:39:24   #4  
dev123 Member Since: January 2007   Contribution: 2    

RE: Whats the best way in a AI GRAPH to read the heade...
hi mukund
I am new to this forum. can u please explain with an example how we
have to remove header & trailer from a flat file.
Thanks




 
Is this answer useful? Yes | No
August 25, 2009 09:32:51   #5  
anujaja Member Since: July 2007   Contribution: 6    

RE: Whats the best way in a AI GRAPH to read the header 1st line and trailer (last line) in a i/p file, compare record counts and checksum (available in header) and error out if actual recd count or checksum did not match?
You can also use a keyless Dedup with keep parameter as first.
This will put header in output port and rest of the record on Dup port . Then connect dup port again with another dedup and use Keep parameter as last this will remove trailer as well.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape