13 Replies Latest reply: Sep 8, 2016 1:52 AM by Naresh KuMAR mARAM RSS

    Automating Monarch

    donh _

      I have been using monarch pro 7.00 for a couple of months and have been successfully able to model at least 15 different monthly reports - with some help from this forum (THANKS)


      The problem is the list of monthly reports continues to grow and each model that I create is exported into another system so it can be pushed out to the end users - - - which currently I am doing manually.


      Is there a way to schedule monarch (or use a vbs script) to find the directory of the raw file, open the file, open the model, verify boundaries (maybe even create an exception report and print the summary page) and export to the directory with the proper file name and extension (sometimes filtered, overwrite, or add data to file) so the next system can push out the final product?


      With regards to the boundary checking - there are a couple of models that will have a non-blank character on each side (the only way I could capture the fiscal year without getting to creative).


      Am I asking for too much???


      [size="1"][ August 10, 2006, 11:51 AM: Message edited by: donh ][/size]

        • Automating Monarch
          Grant Perkins



          You could look at a command script batch file approach, VB code or even maybe justify upgrading to Data Pump and using its scheduling and distribution facilities - sound like you have an internal approval rating good enough to consider that if you are being asked to process more and more reports.


          HOWEVER, one sentence bothers me about any of these suggestions. And that is the one where you run the verification each time.


          Does this mean that the incoming reports are all  potentially so variable each month that you cannot trust the model (or define a trustworthy version of the model) with any certainty?

          If so it would seem that automation may indeed be a little tricky.


          But if most of the reports are consistent you could skip the verification part of the process, though it might still be worth inclusing some form of check processing to ensure that the number of records output is in line with the number of records input. Just in case of data variability.





          • Automating Monarch
            donh _



            Thanks - - - I was able to get my hands on Data Pump (we have it but never installed it).  I will be reading up on it this weekend.


            Regarding verifying field boundaries - I thought that was something you were supposed to do every time - - - oh well - - - I guess it is the auditor in me to always check and reconcile.


            Thanks again



            • Automating Monarch
              Grant Perkins

              Hi Don,


              Originally posted by donh:



              Thanks - - - I was able to get my hands on Data Pump (we have it but never installed it).  I will be reading up on it this weekend. /b[/quote]Which version of Data Pump you have may be significant. Probably V7 I would guess if you have Monarch V7. There was, iirc, quite a big change between V6 and V7 which is server based although as an immediate solution to your automation issues without forcing you to program probably any version is worth investigating.


              Originally posted by donh:


              Regarding verifying field boundaries - I thought that was something you were supposed to do every time - - - oh well - - - I guess it is the auditor in me to always check and reconcile.


              Thanks again


              Don /b[/quote]I guess verification on every run might be desirable - should catch the times when the source report changes and nobody tells you! - but realistically it ought not to be necessary once you have a model with which you feel comfortable unless you know you have a problem with variability on a regular basis.


              Without the verification step any of the suggested approaches should be much easier to apply.


              Good luck!




              • Automating Monarch
                donh _

                We have version 6 - - - I asked about the "personal addition" when they gave it to me but didn't have any answers.


                Will I be encountering some issues with v6 compared to v7???

                • Automating Monarch
                  Grant Perkins

                  Hi Don,


                  Is it the V6 Personal Edition that you have?


                  If so I am not familiar with it at all but I seem to recall that the functionality it added to Monarch was similar to much of what became available in V7 Pro - project export type funcitonality and that sort of thing. However it might help you to automate your desk top Monarch processes although I don't recall if the more general areas of Monarch 7 functionality are available.


                  From DP 7 the Personal Edition was dropped since the entire product moved towards a server based and enterprise oriented technology and so, with the additions to Monarch V7, there was little if any conceptual requirement for a personal edition.


                  If you have the full V6 version it may be a different matter, though I am not at all sure about Monarch V7 in that context. DP V7 was a "from the ground up" development to accompany Monarch V7 so I am guessing that you would indeed find some practical issues about implementing it.


                  Sorry I can't be more help on that.


                  My guess is that if you set up your reports in  projects and use the project export feature you may be able to run the process as a fairly simple batch file as a starting point, especially of the input file can be delivered to a specific file name at a specific location and the export to a specific file name at a specific location.


                  It also sounds like the expensive target system is doing a similar job to that that Datawatch |ES or one of the other products in the family would do.


                  Several of the other forum members can offer greater input than I can about automation and program integration (presumably you have already downloaded the programmer's guide from the Datawatch web site?), and Data Pump. I'm sure one or more of them will be along soon! There are also quite a few previous posts on the subject which may be helpful though I am not sure how best to search for them (what combination of words to search with).






                  • Automating Monarch
                    Dieter _

                    I have the same problem that donh has. Firstly, my situation might be different because I have several models for one report.  Secondly, i do not know how to begin the automation process.  Finally,, do I need an additional program with my Monarch Pro 7.0 to automate.

                    • Automating Monarch
                      Grant Perkins

                      Originally posted by Dieter:

                      I have the same problem that donh has. Firstly, my situation might be different because I have several models for one report.  Secondly, i do not know how to begin the automation process.  Finally,, do I need an additional program with my Monarch Pro 7.0 to automate. /b[/quote]Hi Dieter and welcome to the forum.


                      There are different ways to automate Monarch processes ranging from the BATCH SCRIPT FILE concept through VBA code and on to Data Pump and embedding Monarch in other applications.


                      You certainly do not need another program for Batch Script Files a=nd I think that is probably your first port of call here.


                      The embedded Help in Monarch V7 Pro has a lot of useful information and examples, thogh it does help if you are already a little familiar with MS DOS or windows command scripting.


                      Have a look at Chapter 9 of the Help file. Maybe also Chapter 10 if OLE integration is of interest to you.


                      To run multiple models against the same report the basic requirement is simple to define one short script that works and then duplicate the line in the batch file to repeat the process calling a different model files (and presumably specifying a different output file) for each model used. So get one right and the rest should be very easy.


                      However, are you sure you need to run multiple models against the same report to do this? Nothing much wrong with doing that if you want to but there may be an easier way that only involve one model (or at least fewer models).


                      So if you have a look at the chapters I mentioned above to get an initial impression of what needs to be done then come back to us with follow up questions I would think that would be the most effective way forward for you at the moment.





                      • Automating Monarch
                        Dieter _

                        Grant.  Thank you for the quick response.  Yes, I have to run sevaral models on the same report.  I am capturing diffrent formats of information that are being sent to a file.  I then export the data into excel.  I will read the chapter you specified and hopefully will have more questions and a better understanding of what is going on.  Thanks again

                        • Automating Monarch
                          Dieter _

                          Grant, I have followed the simple script from the help chapter to run a report and export.  Could you provide me with an example of how to run multiple models for the same report?  I also have a question of whether or not I can automatically add data to an existing excel file, which is where the monarch data is being exported?  The help section says no I cannot, but I was wondering if there was a loophole or an updated Monarch version that would allow me to do that. Thanks

                          • Automating Monarch
                            Michael-B _

                            Don -  I have 13 reports that are I run thru Monarch and export the results to various departmental share drives.  As such, I wrote the following batch file to automate the process for me.


                            [font="courier"]@echo off


                            cdprogram filesmonarch

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt551-1.xprj" /px:Export1

                            echo Report 551-1 Combined Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt069-6.xprj" /pxall

                            echo Report 069-6 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt022-3.xprj" /pxall

                            echo Report 022-3 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt053-6.xprj" /pxall

                            echo Report 053-6 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt074-3.xprj" /pxall

                            echo Report 074-3 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt075-3.xprj" /pxall

                            echo Report 075-3 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt263-2.xprj" /pxall

                            echo Report 263-2 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt504-4.xprj" /pxall

                            echo Report 504-4 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt526-1.xprj" /pxall

                            echo Report 526-1 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt551-1.xprj" /px:Export2

                            echo Report 551-1 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt551-4.xprj" /pxall

                            echo Report 551-4 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt608-1.xprj" /pxall

                            echo Report 608-1 Export Complete

                            programmonarch "fs-serv-01userdata$Monarch Reports Models & ExportsRpt618-1.xprj" /pxall

                            echo Report 618-1 Export Complete /font[/quote]fs-serv-01userdata$mbatesMonarch Reports Models & Exports = Represents the network location and folder where I store all my Monarch Models and Projects.


                            Rpt551-1.xprj = Represents the Monarch project to execute


                            /pxall = Exports ALL project exports within the project


                            If there are multiple exports within a project, but you only want to execute one of them use the following.


                            /px:(enter export name)


                            Of course, the above will ONLY work for projects.  Not sure how you set yours up.


                            Projects allow you to setup up project exports.  It's there that you will designate the location of the export.


                            The above batch file will launch Monarch Pro, Open Project (Applying the applicable model to the report) and run project export(s) contained within the project.


                            Enter the above code in note pad or similar and save it as a .bat file.  Once that is complete all you need to do is double click on the .bat file you created.


                            Not sure if this is what you are looking for, but thought I would share it with you.



                              • Re: Automating Monarch
                                Naresh KuMAR mARAM

                                Hi Michael,


                                I hope you can help me. I have something similar requirement that you have as per this post. Can you please help me with one BATCH File for my requirement Please Please Please.


                                On daily basis, I do this

                                I have 6 raw reports in one of the shared drive path and each report has a monarch model in another shared folder. I want to automate the process of using - Monarch to open first report from shared folder path and select first model and export the final report in excel format and save in some X path and repeat the same for second report and loop until last raw report in shared drive path. I end up doing this manually and spend good time. This is for one set of client, similarly I have 4 other clients too.


                                Your time in replying and help is much appreciated Michael.



                              • Automating Monarch
                                Grant Perkins



                                Let's start off with the last question first.


                                Version 8 Pro has seen seen some notable extension of scripted export functionality compared to Version 7 and I would certainly recommend it for that alone (there are many additional features and probable benefits for you as well) given your requirements.


                                Writing to an existing Excel file is certainly possible with V8 and using an Export you can specify which Excel Workbook and Worksheet is to be updated. However there are a few things to consider - like the excel file cannot be open by another program at the same time and there are one or two concerns about numeric and date formatting that sometimes come up. The current export engine is a standard Microsoft integration offering and as such offers little room for adaptation. The good news is that there are ways arounfd the problems if they should apply to you.

                                Note that adding to the same Workbook in a new worksheet is not an problem. Appending to an existing worksheet with one or two of the special format options active is less reliable but not a show stopper.


                                The easiest way to run regular processes is to use a Project and Project Exports. Projects do expect to apply the same model to the same report NAME - though of course this can be a new version of the report. The definitions for Exporting are also contained in the Project Export.


                                To run several models against the same report file just create Export Projects for each one changing the model file and, maybe, the export file table information to suit. With version 8 you can simulate this with the command lines in a batch file but I really think the Project route is much easier.


                                To have a single process run all the analysis and expoart should be as simple as putting a line for each Project into the batch file and letting the batch process run through the file.


                                Assuming you are running on a recent version of a Windows Operating System (XP for example), if you have made the export work for you from a command line simply copy that line into a notepad session and then save the file with a .bat extension.


                                You should then be able to double click the .bat file to run the process. I'll keep to that for now as I will guess you probably know what to do based on that but if not we should be able to find some recent discussions on batch files in the forum posts which will shed more light on the process than I am likely to do from a 'cold start'!


                                So I think V8 Pro would make your life much easier here.


                                The other option I mentioned - reducing the need for multiple models - may not be worth considering if this automation will work for you. At least with multiple models each will be relatively easy to maintain or develop in isolation should the need arise. Your requirement description suggests that would be a good thing for this particular file.


                                However it is always worth remembering that files with multiple formats posted MIGHT, possibly, be successfully processed by a single model if some form of conditional processing can be applied internally using calculated fields to slice and dice the contents of a line.


                                Sometimes it works better, sometimes it doesn't.


                                I hope this is useful info. Rather than post it here I will send you a PM with the relevant section of the V8 Help related to command lines to that you can see the additions and the explanation of what they allow.



                                • Automating Monarch
                                  Grant Perkins



                                  Thanks! Great example and you saved me some time going looking for one to suggest.


                                    :cool:    smile.gif[/img] 





                                  This example shows the potential of Monarch V8 Pro's extra fucntionality.