Showing posts with label filter records. Show all posts
Showing posts with label filter records. Show all posts

Ab Initio Component | LEADING RECORDS

Purpose of LEADING RECORDS


  • LEADING RECORDS copies a specified number of records from its in to its out port, counting from the first record in the input flow.


Parameters for LEADING RECORDS


num_records (integer, required)


  • This parameter specifies the number of records to copy from the in port to the out port. If you enter a value of -1, it specifies that all records appearing on the component’s in port should be passed through to its out port.


early-close    (boolean, required)


  • When this parameter set to True, LEADING RECORDS closes its output immediately after reaching the value specified in num_records, which speeds downstream processing. In a non-continuous graph, always set early-close to True.


    Default is False. Use this setting only for continuous graphs.
    

Runtime behavior of LEADING RECORDS

  • When this component is connected to an INPUT FILE component, LEADING RECORDS has a useful optimization: it stops reading the input file as soon as it reaches the specified number of records. To get this optimization, make sure the INPUT FILE and the LEADING RECORDS use the same layout.

  • When this component is connected to an INPUT TABLE component  this optimization does not apply.With an INPUT TABLE, it is most efficient to select the desired records using a SELECT statement.

  • LEADING RECORDS does not have a port to which to send unused records.

  • LEADING RECORDS supports implicit reformat. 

Ab Initio Component | Filter by Expression: Part 2

 ...continue from part 1....


ramp (real, required)

  • This parameter defines Rate of toleration of reject events in the number of records processed.

  •  When the reject-threshold parameter is set to Use limit/ramp, the component uses the values of the ramp and limit parameters in a formula to determine the component’s tolerance for reject events.

    Default is 0.0.
 

logging (boolean, optional)

  • This parameter  specifies whether the component logs certain events.  
 

log_input  (choice, optional)

  • This parameter specifies how often the component sends an input record to its log port. The logging parameter must be set to True for this parameter to be available.

  • For example, if you select 100, the component sends every 100th input record to its log port.
 

log_output   (choice, optional)

  • This parameter specifies how often the component sends an output record to its log port. The logging parameter must be set to True for this parameter to be available.

  • For example, if you select 100, the component sends every 100th output record to its log port.

log_reject   (choice, optional)

  • This parameter specifies how often the component sends a reject record to its log port. The logging parameter must be set to True for this parameter to be available.

 

Runtime behavior of FILTER BY EXPRESSION


FILTER BY EXPRESSION perform the following operations :

    1. It reads data records from the in port.

  • If the use_package parameter is false, applies the expression in the select_expr parameter to each record. It routes records as follows, based on how the expression evaluates:

  • For a non-0 value, FILTER BY EXPRESSION writes the record to the out port.

  • For 0, FILTER BY EXPRESSION writes the record to the deselect port. If you do not connect a flow to the deselect port, FILTER BY EXPRESSION discards the records.

  • For NULL, FILTER BY EXPRESSION writes the record to the reject port and a descriptive error message to the error port.

  • If the use_package parameter is true, executes the functions defined in the package:

  • If the select function returns 1, the component writes the record to the out port.

  • If the select function returns 0, the component writes the record to the deselect port.


    2. If output_for_error or make_error is defined, executes them whenever an error event occurs. If log_error is defined and logging of rejects is turned on, executes log_error.

    3. FILTER BY EXPRESSION stops execution of the graph according to the reject-threshold parameter. If its value is use limit/ramp, the graph stops when the number of reject events exceeds the result of the following formula:

        limit + (ramp *  number_of_records_processed_so_far)

Ab Initio Component | Filter by Expression: Part 1

 Purpose of FILTER BY EXPRESSION

  •  FILTER BY EXPRESSION is used to filter records according to a DML expression or transform function, which specifies the selection criteria.
  • FILTER BY EXPRESSION can also sometimes used to create a subset, or sample, of the data. For example, you can configure FILTER BY EXPRESSION to select a certain percentage of records, or to select every third (or fourth, or fifth, and so on) record. 
 

Parameters for FILTER BY EXPRESSION


select_expr   (expression, required when use_package is false)
 
  • This parameter filters records according to the DML expression you specify.

use_package  (boolean, optional)

  • This parameter controls whether the component uses the select_expr parameter or the package to specify the filter criteria. When the value is true, it uses the package.
  • When false (the default), you may still use the package to customize the component’s handling of error and log information.

package   (filename or embedded string, optional)

  • This parameter is package that can include a select function (required when use_package is true). It also allows you to customize the component’s handling of error and log information.
 
error_group  (string, optional)

  • This parameter defines name of the error group to which this component belongs. It sends its error output to the HANDLE ERRORS component with a matching error_group value.
    
log_group  (string, optional)

  • This parameter defines name  of the log group to which this component belongs. It sends its log output to the HANDLE LOGS component with a matching log_group value.

reject-threshold  (choice, required)

  • This parameter specifies the component’s tolerance for reject events.

limit  (integer, required)

  • This parameter defines a number representing reject events.

  • When the reject-threshold parameter is set to Use limit/ramp, the component uses the values of the ramp and limit parameters in a formula to determine the component’s tolerance for reject events.

    Default is 0.