Posts

Showing posts with the label Conditional Output

T) Explain the Run time Behaviour of Reformat Component ?

The Reformat component processes your data records through these steps: Basic Setup: Each output port is numbered (out0, out1, out2, etc.) Each output has matching reject and error ports (reject0/error0, reject1/error1, etc.) Step-by-Step Process: Read a Record Takes one record from the input port Check Selection Filter (if you have one) If the filter expression returns FALSE : Record is skipped, go to next record If the filter returns NULL : Graph stops with an error message If the filter returns TRUE (or no filter exists): Continue processing Determine Where to Send the Record If you have only one output port : Record goes to that port automatically If you have multiple output ports : Uses output-index to decide which port(s) get this record Can send to one port or multiple ports If there's an error choosing ports, record goes to reject0 Transform the Record For each designated output port: If no transform is defined: Uses automatic field mapping If transform is defined: Runs ...

S) Output index example

Image
 Input Data               Reformat   Count =3   /*Function returning index of output port*/   output_index_ out :: output_index (in)=   begin   output_index_ out :: if( in.gender =="M")0 else if ( in.gender =="F") 1 ;   end;    

S) How to add trailer record at every Third record of a file having 10 records? #scenario

In output index of reformat use logic if next in sequence % 3 == 0 then output add trailer from in1.    you can use normalize generate length as 2 when next in sequence %3 ==0.