14 Replies Latest reply: May 15, 2014 10:14 AM by elginreigner _ RSS

    Change Source File on Project

    greywolf1978 _

      Good Day,

       

      Is is possible to change the source report on a project (the import file)?  For example, we have 3 projects which we need to run each day which reference the file they were originally created with.  The goal, hopefully, is to be able to automate the project in the end (previous suggestion was split the file to models and run via VB however we do not have the resource to do so currently).  I've attempted to force the project to the new file and then save the project however it reverts back to the original file the next time it is opened.  I cannot seem to find anywhere within the project to set this. 

       

      Let me know if more clarification is required.  Thanks in advance.

       

      Ron

        • Change Source File on Project
          Olly Bond

          Hello Ron

           

          DataPump would give you more options here, as the outputs could be named according to the input file, but there are hacks.

           

          Firstly, you could just make copies of the xprj file and edit the paths to the report. The easiest way to do this is in the "Manage external references" section of the Monarch Utility.

           

          Secondly, you could open the three reports together in one project. Define a calculated field based on File(), and then either filter on this for table exports, or use it as a hidden key field for a summary export.

           

          Hope this helps,

           

          Olly

            • Change Source File on Project
              RalphB _

              Olly,

               

              I don't have any experience with the Monarch Utility so I cannot comment on that.  But on the second suggestion, if I understand Ron correctly, it sounds like something similar to my company.

               

              All our reports we work with are dumped out in a directory by the date created.  So all the reports the system generated for, say 7/10/2012, are put in a directory named X:XXX\20120710\report.xxx.  Reports for 2/11/2012 are put in 20120711, etc.. 

               

              Since project work of the same path and file name that is why I cannot use them here and use VBA to open up the various reports daily.  I have at least one where I open over 70 reports, and that number changes frequently, using the same model daily that use the same model.

               

              I have looked into getting Datapump but management says it is cost prohibitive.  That is why I use VBA to automate 95% of my jobs.  The poor mans DataPump.

                • Change Source File on Project
                  Grant Perkins

                  Ron,

                   

                  Have you considered pointing the project at a generic file name, one for each of the report types, and then copying the real reports to their generic name as part of a batch process file?

                   

                  I assume that there is sufficient information within the report to ID anything you need in terms of date or name or whatever and extract that in the models.

                   

                  The generic name would always be the same and the project would be happy. You may want to create separate folder for each of the reports in order to simplify things by making the process self contained.

                   

                  Alternatively skip the Project and just script the entire process. However if you have multiple complex outputs it may be easier to run them using a project file in which case you can substitute a different report file name (list)  to replace the generic name(s) in the project definition as part of the batch file. The Help section on Using Monarch Command lines should provide some useful guidance in that area as a starting point.

                   

                  To make things even easier you could have a look at the [URL="http://********************/tips/monarch-batch-file-generator"]Monarch Batch File Generator /URL from [URL="http://www.********************"]www.********************[/URL] .

                   

                   

                  HTH.

                   

                   

                  Grant

                    • Change Source File on Project
                      elginreigner _

                      Ron,

                       

                      Have you considered pointing the project at a generic file name, one for each of the report types, and then copying the real reports to their generic name as part of a batch process file?

                       

                      I assume that there is sufficient information within the report to ID anything you need in terms of date or name or whatever and extract that in the models.

                       

                      The generic name would always be the same and the project would be happy. You may want to create separate folder for each of the reports in order to simplify things by making the process self contained.

                       

                      Alternatively skip the Project and just script the entire process. However if you have multiple complex outputs it may be easier to run them using a project file in which case you can substitute a different report file name (list)  to replace the generic name(s) in the project definition as part of the batch file. The Help section on Using Monarch Command lines should provide some useful guidance in that area as a starting point.

                       

                      To make things even easier you could have a look at the [URL="http://********************/tips/monarch-batch-file-generator"]Monarch Batch File Generator /URL from [URL="http://www.********************"]www.********************[/URL] .

                       

                       

                      HTH.

                       

                       

                      Grant[/QUOTE]

                       

                      I 2nd generic file names, I use this for all of our setups. We would be opening and closing projects manually all day if this was not done.

                        • Change Source File on Project
                          greywolf1978 _

                          Good Day,

                           

                          We are trying to do just that.  I take our daily files (which have the date stamp) and use VBScript to create the generic file in a generic file location.  I'm just having issues determing where in the project to point it at this generic file.  We have quite a few models that we do this with.  We actaully have already split apart multiple projects already to work around these issues. 

                           

                          I just do not have time to be able to split these projects apart as they end up exporting different data to around 20 - 25 other reports.  Is this done in the project or the models themselves is what I guess I'm trying to figure out....

                           

                          Thanks again for all the help.

                            • Change Source File on Project
                              Grant Perkins

                              A project is a sort of wrapper that specifies a data source from a known location (could be a report or a 'database' type of input) and a model that is to be applied to it. The third part of the project involves Project Exports - so your 20 to 25 outputs and how they are to be distributed.

                               

                              Clearly the concept is to be able to process repeating activities with minimised effort whether running them manually or in some automated way. (With fairly large numbers of repeating activities on a regular basis Monarch Data Pump offer significant operational benefits for this sort of activity but is not necessarily required to develop a successful automated system.)

                               

                              Using Windows Command Line based scripts to run processes as a batch of instructions offers methods of adapting processes without duplication. So, for example, if you have a Project that might take more than one input file to be processed by the same model with the same outputs (implying the output field names and location would be the same) then you can create the project against a target input file name but create several versions of a script to run the project as a batch process that specifies an alternate file name to be found and analysed and the script will use the alternate name rather than the name embedded in the Project file definition.

                               

                              The batch file can be associated with an icon on, say, a desktop and can be activated by clicking on the icon to run the entire process. Indeed the batch script could be created so that it prompts the user for inputs before running the script - say a file name for example. However if the process is a regular and repetitive action avoiding user inputs would be a practical and better option.

                               

                              Where would this be most useful?

                               

                              Well if you had in an organisation a sales operation that was split into 3 regions each needing reporting from its own systems (rather than one central system) it would be easy enough to set up a script that used a common batch Project process for all three regions but varied the input file to be use. (Also the output files but with a lot of outputs that starts to erode the benefit of using a single project definition. Might be better to create a working project and then duplicate it an modify each variant according to needs.)

                               

                              You could also use the script to concatenate 3 separate but consistently formatted reports into a single input file before applying the project rules for processing and outputs.

                               

                              If, for simplicity, you prefer to keep the process as multiple (identical) Projects but with different Inputs (and maybe outputs) then to me it suggests the creation of a master project development (to be retained for any future amendments) and then duplicate that to create as many dedicated projects as you need. For each of those projects use the Monarch Utility, as Olly suggested, to find and modify the internal references for inputs and outputs as required. The Utility, which I would expect to have been installed with Monarch should be available in the Monarch program folder.

                               

                              Select the option that Olly identified and tell it where to look for the project(s)/model(s) you need to amend. You will be presented with a list of entries that it finds and can make the changes as required, saving them to the revised Project/Model file. Monarch Utility has a Help section that offers step by step guidance.

                               

                              If neither the script option nor the 'duplicate and modify' approach properly address your needs then I think we will need to dig into the details to better understand exactly what you need to achieve and work out how best to accomodate that requirement using what is available to you.

                               

                              HTH.

                               

                               

                              Grant

                                • Change Source File on Project
                                  greywolf1978 _

                                  Hi Grant,

                                   

                                  We actually do this for models.  We have around 100 models we run daily where we tell it where to look for the text report, the model and provide the export locations.  This is all fine.  We can get this working with VBScript.  For each of these, we set the paramaters to find the daily file (each has its own datestamp), save the file to a generic file name (a.txt for example) and we point the models at this file. 

                                   

                                   

                                  Each day we run the project, we open the project, then we open the report for that day (we manually search out the report).  Using this method, we cannot use the command line options. 

                                  The problem with the projects is when they were originally set up, they were not pointed to a generic file.  They were modeled using one of the files with the date stamp.  So when the project opens, it is looking for that original file (for example
                                  networkdrive\networklocation\file for report January 1, 2011.txt .  I can write the code to take the text file and make a generic file for the project to look at.  I also have the coding to auto run the project (the /pxall switch).  The exports to the files is completly automated once we chose the Run all option on the project so there are no concerns here.

                                   

                                  The problem we are having is figuring out how to change the project so it is not looking for the
                                  networkdrive\networklocation\file for report January 1, 2011.txt but the generic file instead.  I'm trying to determine if this is completed within the project, which based on your post above, it is not.  I'm guessing, to point to the generic file, the models themselves that the project is tapping into need to be modified.  Am I correct on this assumption?  Does this help as to what we are looking for? 

                                   

                                  Thanks again,

                                   

                                  Ron

                                    • Change Source File on Project
                                      thompssc _

                                      Hi Ron,

                                       

                                      The input path is stored at the project level. The .xprj files are stored in XML so assuming your input is brought in as a "report", the path would be located in the following hierarchy:

                                       

                                      [/CODE]

                                       

                                      What I'm not entirely clear on is are you trying to change the path just one time, or did you want to automate doing so? If it's just a one-time thing then crack the file open in a text or XML editor and go to town.

                                        • Change Source File on Project
                                          greywolf1978 _

                                          Thats what I needed Scott.  Thanks a million!  I've found the location and this is, hopefully, going to save us a bunch of time!

                                            • Change Source File on Project
                                              greywolf1978 _

                                              Good Day All,

                                               

                                              Based on Scotts response above, I now have the project picking up the generic file.  We also have it set up to overwrite the generic file with the dates file we are working on (the text report file).  Now when I open the project, it is showing the correct file.  The issue we are having now is when I run:

                                              varRunMonarch = "C:\Program Files\Datawatch\Monarch\Program\Monarch.exe /prj:C:\Project Test\c.xprj /pxall" (using VBScript - works correctly for all of our models) it sucessfully opens monarch and I believe the project but immediatly closes without running the project.  If I open the project manually and select run all, it works. 

                                               

                                              There have been a lot of great tips provided so far and I thank everyone who has helped.  I'm hoping one last piece of information will fix the issues we are having. 

                                               

                                              Thanks,

                                               

                                              Ron

                                                • Change Source File on Project
                                                  elginreigner _

                                                  Good Day All,

                                                   

                                                  Based on Scotts response above, I now have the project picking up the generic file.  We also have it set up to overwrite the generic file with the dates file we are working on (the text report file).  Now when I open the project, it is showing the correct file.  The issue we are having now is when I run:

                                                  varRunMonarch = "C:\Program Files\Datawatch\Monarch\Program\Monarch.exe /prj:C:\Project Test\c.xprj /pxall" (using VBScript - works correctly for all of our models) it sucessfully opens monarch and I believe the project but immediatly closes without running the project.  If I open the project manually and select run all, it works. 

                                                   

                                                  There have been a lot of great tips provided so far and I thank everyone who has helped.  I'm hoping one last piece of information will fix the issues we are having. 

                                                   

                                                  Thanks,

                                                   

                                                  Ron[/QUOTE]

                                                   

                                                  How are you executing the VB script? Is it manually, from a scheduled task? I have you tried a different syntax? I use:

                                                  "c:\Program Files\Monarch\Program\Monarch.exe" "I:\NEWBUSINESS\Import\Monarch Models\DAILY\50 - RETURN - NOTES.XPRJ" /PXALL

                                                  /CODE

                                                    • Change Source File on Project
                                                      greywolf1978 _

                                                      Hi,

                                                       

                                                      I've actually attempted to run direct from command line as a test, attempted from VBA in excel and finally via vbscript.  All 3 variations result in the same issue.  Monarch Opens but does not run the project. 

                                                       

                                                      I think the issues may lie with how it is built but now that I'm pointing it at that static file, I figured it would work.

                                                       

                                                      I'll play a bit more with the syntax to see if I can't get it (changing the locations of the quotes), etc. 

                                                       

                                                      Thanks again for the help and suggestions. 

                                                       

                                                      Ron

                                                        • Change Source File on Project
                                                          KeyserSoze _

                                                          Ron,

                                                           

                                                          You should[/B] get good results with:

                                                          "c:\Program Files\Monarch\Program\Monarch.exe" /prj:"I:\NEWBUSINESS\Import\Monarch Models\DAILY\50 - RETURN - NOTES.XPRJ" /pxall[/CODE]

                                                          • Change Source File on Project
                                                            elginreigner _

                                                            Hi,

                                                             

                                                            I've actually attempted to run direct from command line as a test, attempted from VBA in excel and finally via vbscript.  All 3 variations result in the same issue.  Monarch Opens but does not run the project. 

                                                             

                                                            I think the issues may lie with how it is built but now that I'm pointing it at that static file, I figured it would work.

                                                             

                                                            I'll play a bit more with the syntax to see if I can't get it (changing the locations of the quotes), etc. 

                                                             

                                                            Thanks again for the help and suggestions. 

                                                             

                                                            Ron[/QUOTE]

                                                             

                                                            FYI, If you plan on running this as a scheduled task. Depending on the OS it is setup on, make sure 'Start In' directory of the task is filled out. If it is empty, Monarch will fail here.