8 Replies Latest reply: May 15, 2014 10:07 AM by Grant Perkins RSS

    Need to run multiple project exports

    Mickey _

      Monarch ver 9.01

      I have a report that I need to convert to a fixed length text file with position specific fields. The report and output text file have three record types with separate record layouts.

      I have a model written for each record type (header, detail, and trailer).

      I have a project export for each of the three record types.

      Is there a way I can run all of the projects at the same time to output the header, detail & trailer records?

      The "project exports" screen looks like you can have multiple exports and even sequence them and run all.

      Yet when I write one Project export and save it, then close the model and open a new model, the prior

      project export disappears from the project export window.

      Is there a specific process I need to follow that will allow multiple project exports with multiple models for a report?

       

      Sample REPORT data

      H   070   1111111111   05212010   JERGENS INC                        03121

      D   070   1111111111   V   05212010   2222222222   333333333333   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      D   070   1111111111   V   05212010   2222222222   333333333333   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      D   070   1111111111   V   05212010   2222222222   333333333333   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      D   070   1111111111   V   05212010   2222222222   333333333333   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      T   070    1111111111   0000000004   000000123456

       

      Sample file data

      H070111111111105212010JERGENS INC              03121

      D0701111111111V052120102222222222333333333333                                   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      D0701111111111V052120102222222222333333333333                                   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      D0701111111111V052120102222222222333333333333                                   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      D0701111111111V052120102222222222333333333333                                   ABCDEFGHIJKLMNOPQRSTUVWXYZ

      T07011111111110000000004000000123456

        • Need to run multiple project exports
          Grant Perkins

          Hi Mickey and welcome to the forum.

           

          You can run multiple exports is a coupld of ways but I suspct they are not going to offer you what you are looking for.

           

          If I understand things correctly you have an input file that looks like 'Sample Data File' and you need the output fo look like 'Sample REPORT data'.

           

          Is that correct or have I misunderstood?

           

          If my understanding is correct I think there is a different approach for this but I will wait for you to confirm one way or the other before getting into the details.

           

          Grant

          • Need to run multiple project exports
            Data Kruncher

            Projects (xprj) connect a data source (or sources) with only a single model (xmod) file, so when you close the model then you'll be creating a new project file.

             

            Your easiest solution is to create a batch file which will run all of the three project files and their related exports in an uninterrupted sequence. You could use the [URL="http://********************/tips/monarch-batch-file-generator"]Monarch Batch File Generator[/URL] to create three distinct batch files for you if you're not familiar with running Monarch via the command line. Then using a simple text editor you can combine the Monarch processing parts of the resultant batch files into one single batch file. See the online help for more information about Monarch's command line parameters. In the index, select "Command lines, using Monarch ones".

             

            In the final batch file that you create be sure to use the DOS command START with its /WAIT parameter for the first two Monarch passes to ensure that one Monarch session finishes its work before another begins.

              • Need to run multiple project exports
                Mickey _

                Data Kruncher:

                this sounds like a possilbe solution.

                I will download the Batch File Generator and use it to run the three projects.

                Thanks

                Mickey

                • Need to run multiple project exports
                  Olly Bond

                  Hello Mickey,

                   

                  Kruncher's absolutely right that the best approach is to use Monarch Pro's ability to automate project exports using a batch file, but I thought it might be helpful to know that your data can in fact be handled in one model. This requires that you have the desired output data for each type of line in one big field per type.

                   

                  If you trap your input data using three templates in one model, say one detail template for the multiple lines and an append for the first line and a footer for the last, and in each template you select the entire line as the input field. So we have three fields, , and . Now in the table window we make three calculated fields that have the spaces inserted at the right place, say , and .

                   

                  Now create a summary with key fields in this order:

                   

                   

                  and Count() as the only measure. In the summary properties tab, hide the key column but display a header line with the key value as a label. For hide the key column, but display a subtotal line with the key value as a label, and lastly hide the measure. Now the summary can be exported as a fixed width text file and you'll have the result you were looking for.

                   

                  (edit) as your detail lines are identical, you'll need to add another hidden calculated field to the summary to distinguish them. defined as Recno() works fine.

                   

                  Best wishes,

                   

                  Olly

                    • Need to run multiple project exports
                      Grant Perkins

                      Mickey,

                       

                      If all you are doing is losing a few spaces and retaining the order of the rows as they are in the input report you only need one model.

                       

                      Select the entire line in a single field. ( I have assumed that the field will not exceed 254 characters.)

                       

                      Now create a calculated field that, depending on the line type (H, D, T) removes a number of spaces and leaves the rest of the line as is .... or does something with that as well if there is more formatting required than is evident from the posted sample.

                       

                      There are a few options for that approach all of which are easy enough once you have seen them but may not jump put at you if you have not been introduced to the concepts previously.

                       

                      If I have the needs right let me know and I will offer some guidance for the next stage. If I'm wrong ... I'll leave you with Olly and Kruncher to expound their approaches.   

                       

                      Grant

                        • Need to run multiple project exports
                          Mickey _

                          Grant:

                          actually the output records are 180 characters with several filler fileds between data.

                          I just was using some generic data to show what I was trying to accomplish.

                          I am going to try the batch file approach and see how that works.

                          Thanks again.

                          Mickey

                            • Need to run multiple project exports
                              Grant Perkins

                              Grant:

                              actually the output records are 180 characters with several filler fileds between data.

                              I just was using some generic data to show what I was trying to accomplish.

                              I am going to try the batch file approach and see how that works.

                              Thanks again.

                              Mickey[/quote]

                               

                              OK, so you losing some spaces and adding a few filler fields. Presumably you can structure the line based on the knowledge of the output record structure required so you know where the filler fields need to go and how other fields will re-position within the line.

                               

                              So I would still propose the single line/single field solution with transformation to the format required using a calculated field. The formulas required for slicing and dicing would be a little extended but that would be all.

                               

                              On the other hand the batch file approach could be fun and a useful experience so why not!

                               

                               

                              Grant