IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

Create Multiple Output Records From One Input Based on Field

  • 1.  Create Multiple Output Records From One Input Based on Field

    Posted 04/19/05 09:39 AM

    Originally posted by: SystemAdmin


    Hello! Trying to determine the best and easiest way to do this in one map.

    Can do it in multiple maps by modifying a rule here and there but would like to condense the processing.

    Have an input file with unique SSN records, each record has a text amount field, Child Amount, Health Amount and Parking Amount fields.

    The first position is checked for a -, the amount fields probaby should have been defined as signed but another developer created the tree this way.

    For each one of these fields from the same input SSN record, for each amount that is negative, need to create one output record, the two varying fields on the output record are the amount field itself and a plan type field.

    The output record looks like

    Record (s)
    SSN 1:1
    Plan Type 1:1
    Date 1:1
    Deposit Amount 1:1

    Therefore if one input record has -1 and -2 and -3 in the Child, Health and Parking Amount fields respectively, then the three output records created will look like

    SSN Plan Type Date Deposit Amount
    111111111 1 Current Date -1
    111111111 2 " -2
    111111111 3 " -3

    The Plan Type is set according to the Amount field that has a negative, so Plan Type is set to 1 if the input record has a negative Child Amount, set to 2 if input record has a negative Health Amount and then finally the last setting of 3 if there is a negative in the Parking Amount field.

    Had initially coded an If rule to call a different functional map depending on what input amount is negative but after the first true IF, that functional map is run and the rule is exited here.

    That rule follows.

    =IF(LEFT(SS_HEALTH_AMT Fields:SS_REC:FSA_In, 1) = "-", F_Split_Drop_File_Recs_H(SS_REC:FSA_In),
    IF(LEFT(SS_CHILD_AMT Fields:SS_REC:FSA_In, 1) = "-", F_Split_Drop_File_Recs_C(SS_REC:FSA_In),
    IF(LEFT(SS_PARKING_AMT Fields:SS_REC:FSA_In, 1) = "-", F_Split_Drop_File_Recs_P(SS_REC:FSA_In), NONE)))

    How could a rule be created to check all Ifs in the rule and run each corresponding functional map if necessary, is there a reverse EITHER function which will check all conditions or should three indexes be created on the output card and then copy in a slightly different version of the rule in each index field so that a different output record is created.

    Possibly the following.

    For Index 1 of the output record,

    =IF(LEFT(SS_HEALTH_AMT Fields:SS_REC:FSA_In, 1) = "-", F_Split_Drop_File_Recs_H(SS_REC:FSA_In), NONE)

    For Index 2,

    IF(LEFT(SS_CHILD_AMT Fields:SS_REC:FSA_In, 1) = "-", F_Split_Drop_File_Recs_C(SS_REC:FSA_In), NONE)

    and a similar rule for the third.

    Would a blank output record be created for each index if the condition is not true, that would not be good as all output records need to be populated.

    Looking for recommendations on how to do this if at all possible in one map.

    Would appreciate any help that can be provided here.

    Thanks!
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Create Multiple Output Records From One Input Based on F

    Posted 04/21/05 07:49 AM

    Originally posted by: SystemAdmin


    Hi Brozek,
    I think I have a solution to this, I have sent you a simple example with a blob map, basically you have to create additional output cards and if the first character is "-" write X out to that record, else if Y just pass A for Rec 1, B for Rec 2, C for Rec 3.. hope it helps, if not at least a step with an example to use as part of the solution.

    -Steve Brock
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange