Topic
  • 13 replies
  • Latest Post - ‏2013-12-11T16:19:55Z by Microeyes
muralee
muralee
95 Posts

Pinned topic how to generate multiple output files dynamicaly based on input records

‏2008-05-08T17:14:06Z |
I can explain the complete scenario.
for each record in the input card , there should be an outputfile dynamically created .

can anybody explain me how this can be done in TX.
Updated on 2012-02-08T11:21:02Z at 2012-02-08T11:21:02Z by KK_WTX
  • SystemAdmin
    SystemAdmin
    6184 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2008-05-08T21:14:31Z  
    In your output, call a functional map that repeats once for each input record. Then use the PUT function with a FILE adapter to create one file per input record. You may need to add a level to the type tree of your outout so that the file structure can occur multiple times. This is so the FMap can execute once for each input record.

    Jim Divoky
    EC Solutions, Inc.
    330-606-6826
  • SystemAdmin
    SystemAdmin
    6184 Posts

    Re: how to generate multiple output files dynamicaly based on input record

    ‏2008-05-09T13:47:35Z  
    you can also do it using run function using -of1 option.
    This works well when you have to bundle several records of same type into one unit.
    but performancewise when data is huge put will take less time
  • paul.brett
    paul.brett
    511 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2008-05-12T15:39:28Z  
    I enclose a very simple example for you to examine.

    Paul.
  • muralee
    muralee
    95 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2008-05-14T19:27:29Z  
    thanks for the information
  • bubai_das
    bubai_das
    4 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2012-01-28T00:59:29Z  
    In your output, call a functional map that repeats once for each input record. Then use the PUT function with a FILE adapter to create one file per input record. You may need to add a level to the type tree of your outout so that the file structure can occur multiple times. This is so the FMap can execute once for each input record.

    Jim Divoky
    EC Solutions, Inc.
    330-606-6826
    Hi,

    If I want to generate two output files, one contain some of the records and other caontains rest based on some value in the input parameter. Please let me know how it is possible.

    Note: I do not have the requirement to generate multiple output files for each row in the input file.

    I have done the following coding but it again generate the whole input file.

    In the main map:

    IF(Country EmployeeFields:EmployeeRecord:In1 = "FRA", F_FRA(EXTRACT(In1, Country EmployeeFields:EmployeeRecord:In1 = "FRA" )))
    In the Functional Map:

    =PUT("FILE","Test_FRA.txt",PACKAGE(In1))
  • KK_WTX
    KK_WTX
    17 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2012-02-01T05:31:15Z  
    • bubai_das
    • ‏2012-01-28T00:59:29Z
    Hi,

    If I want to generate two output files, one contain some of the records and other caontains rest based on some value in the input parameter. Please let me know how it is possible.

    Note: I do not have the requirement to generate multiple output files for each row in the input file.

    I have done the following coding but it again generate the whole input file.

    In the main map:

    IF(Country EmployeeFields:EmployeeRecord:In1 = "FRA", F_FRA(EXTRACT(In1, Country EmployeeFields:EmployeeRecord:In1 = "FRA" )))
    In the Functional Map:

    =PUT("FILE","Test_FRA.txt",PACKAGE(In1))
    Hi,

    As per your requirement first you have to extract the all country codes "FRA". Then you have to take another card use put function then you will get the result as expected.

    I am giving attachment for your reference.

    Card2 : Extract the required data.
    Card3 : Pass the above data to the PUT function.

    Thanks,
    KK

    Attachments

  • bubai_das
    bubai_das
    4 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2012-02-02T08:42:13Z  
    • KK_WTX
    • ‏2012-02-01T05:31:15Z
    Hi,

    As per your requirement first you have to extract the all country codes "FRA". Then you have to take another card use put function then you will get the result as expected.

    I am giving attachment for your reference.

    Card2 : Extract the required data.
    Card3 : Pass the above data to the PUT function.

    Thanks,
    KK
    Hi KK,

    Thanks for your info, can you please send me the updated attachment. The attached example generates 10 separate files. So please send me the updated attachment.

    Thanks a lot.

    Bubai
  • bubai_das
    bubai_das
    4 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2012-02-04T02:48:59Z  
    • KK_WTX
    • ‏2012-02-01T05:31:15Z
    Hi,

    As per your requirement first you have to extract the all country codes "FRA". Then you have to take another card use put function then you will get the result as expected.

    I am giving attachment for your reference.

    Card2 : Extract the required data.
    Card3 : Pass the above data to the PUT function.

    Thanks,
    KK
    Hi All,

    I am able to split one record with country code 'FRA' each time, and when I pass this record to a PUT method, it will generate only one record.

    But as per requirement I need to extract all the records with country code 'FRA' and then put all the records with country 'FRA' to a single file.

    Request your advice to achive this.

    Thanks,
    Bubai
  • KK_WTX
    KK_WTX
    17 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2012-02-07T11:28:08Z  
    • bubai_das
    • ‏2012-02-04T02:48:59Z
    Hi All,

    I am able to split one record with country code 'FRA' each time, and when I pass this record to a PUT method, it will generate only one record.

    But as per requirement I need to extract all the records with country code 'FRA' and then put all the records with country 'FRA' to a single file.

    Request your advice to achive this.

    Thanks,
    Bubai
    Hi Bubai,

    I am giving map for your reference. The map will work as per your requirement.

    Check and let me know.

    Thanks,
    KK.

    Attachments

  • SudhanshuSawlani
    SudhanshuSawlani
    8 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2012-02-08T08:54:18Z  
    • KK_WTX
    • ‏2012-02-07T11:28:08Z
    Hi Bubai,

    I am giving map for your reference. The map will work as per your requirement.

    Check and let me know.

    Thanks,
    KK.
    Hello KK

    It seems, .mms file is missing in the Zip folder attached above.

    Could you re-upload?

    Many thanks in advance.
    Sudhanshu.
  • KK_WTX
    KK_WTX
    17 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2012-02-08T11:21:02Z  
    Hello KK

    It seems, .mms file is missing in the Zip folder attached above.

    Could you re-upload?

    Many thanks in advance.
    Sudhanshu.
    Hi

    Sorry,now i attached the correct folder.

    Check and let me know.

    Thanks,
    KK.

    Attachments

  • mahesh15
    mahesh15
    5 Posts

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2013-06-26T13:29:48Z  
    • KK_WTX
    • ‏2012-02-08T11:21:02Z
    Hi

    Sorry,now i attached the correct folder.

    Check and let me know.

    Thanks,
    KK.

    Hi KK,

    I too have a similar requirement.How can we generate seperate file for each unique country.

    For example,

    If you have FRA,GER,USA as countries.

    FRA related records should be put in one file and GER records should be put in second file and USA records should be put in third file.

     

    Thanks,

    Mahesh

     

  • Microeyes
    Microeyes
    1 Post

    Re: how to generate multiple output files dynamicaly based on input records

    ‏2013-12-11T16:19:55Z  
    • KK_WTX
    • ‏2012-02-01T05:31:15Z
    Hi,

    As per your requirement first you have to extract the all country codes "FRA". Then you have to take another card use put function then you will get the result as expected.

    I am giving attachment for your reference.

    Card2 : Extract the required data.
    Card3 : Pass the above data to the PUT function.

    Thanks,
    KK

    Hi ,

    I have got an issue like i have one input file which contains 2 different SKU each  composed of 3 items : Style + Style Suffix +Size Desc) and requirement is to generate an out put file based on Each SKU, it means 2 diffrent output file if both SKU comes in input and one output file if one SKU comes in input with their other respective fields dependent on them.

    i.e, the map needs to populate for each SKU (combination of (<Style> and <StyleSuffix> and <SizeDesc>)is a SKU) and needs to get the respective values based on the SKU in their respective output files. Currently Map is generating one output and having both SKU in that. And my out put contains 3 segments under a record, header 1, header 2, detail group. where SKU comes in header 2 field 1, and detail group . input is xml, output is flat file