5 Replies Latest reply: May 15, 2014 9:56 AM by nahla _ RSS

    Projects from .bat Files

    Jim Weeks

      I am runiing some projects from .bat files.  In a few cases, the project outputs (/pxall) 0 records and yet when I open the project through Monarch and use "Run All"  in the Exports wizard it works properly.  It seems to happen when the opening of the project itself takes a long time (big database or a large external lookup file.....almost like some sort of time out occurs when calling from a .bat file.  Any ideas would be GREATLY appreciated.

       

      Jim Weeks

        • Projects from .bat Files
          nahla _

          You said "Any ideas" so here goes. I connected to a really large SQL table and had a date filter. I actually received an error message when the .bat file would attempt to run but if manually opened the project file everything was fine. So what I started doing was running the .bat file without a filter statement in my project first, then I would run the .bat with the filter and it worked fine. It ran great for a whole month and I decided that maybe it was just my imagination and I killed the first project just to see what would happen and the second .bat didn't work that day, so I scheduled it back to the two of them and it's been running that way ever since.

          • Projects from .bat Files
            Grant Perkins

            Jim,

             

            Are you connecting via ODBC?

             

            Like nahla's comments, I have seen problems where the network/ODBC time out is activated when no data has been retrieved within the specified timeout period. Cause usually that a filter (selection) is being applied but I have also seen it on slow networks (network problems causing very slow responses) or in some instances where the target file/database was unavailable at that time for some non-terminal reason.

             

            The only other generic problem I can think of is where there are genuinely no records to report, possibly because of a combination of selection criteria. Difficult to speculate on that in your case.

             

            On the other hand, if you can run the same process on 2 different machines at the ame time, one manually and one via the .bat file, and get results from one but not the other, if would suggest there is a different cause.

             

            ODBC connections can have a log file which may help id what is happening, also the sql log may help if you have one.

             

            One other option to consider might be access rights. Running the process manually as you may be right enabled but running it as a batch file under a different 'user' accoount may not?

             

            Things like that ... well, you did ask for ideas!

             

             

            Grant

            • Projects from .bat Files
              Jim Weeks

              Thank you both for your ideas! I do not get an error message when opening but the exports it produces have no records, when, if I run it nmanually, the export correctly has records. You are correct in assuming that I am running a filter along with a pretty significant lookup.  I don't quite understand the "2 .bat files" option.  If I run 1 .bat file without the filter (I'm sure that would probably work), and then call another .bat file with the filter, the 2nd .bat file WITH the filter basically starts all over again, correct?  Wouldn't it fail for the same reason?  Perhaps you could provide an example?  Again, thank you so much for responding!

               

              Jim Weeks

              • Projects from .bat Files
                RalphB _

                One other thought.  Are you exporting out to Excel?  If so, I know from experience that Monarch 7 Pro has problem exporting large amount (20,000 + rows) of data out to Excel in excel format.

                 

                If this is so, the solution that I have come up with is to unselect the "Apply formatting to XLS files" in the Export and Clipboard Options tab under Options.  This seems to work.

                 

                I had no problem exporting this report under Ver. 6 Pro so this is unique to Ver. 7.

                 

                I have talked to Monarch about this and they are working on a fix.

                 

                Hope this helps.

                 

                Ralph

                • Projects from .bat Files
                  nahla _

                  Hi Jim,

                  I know that without your filter statement the amount of records returned would be an enormous amount. I'm just suggesting that you remove your filter statement and schedule the .bat file to run (maybe in the middle of the night) and see if you get any results at all, even if it's more than what you want. Then you will know whether it's something in how you have setup the project or your .bat or if it is truly a timeout issue. If you do get records then maybe you can change the value you are filtering on.If your project exports to Excel, you might have to change the export file type to html since Excel has a  maximum amount of rows(64K) or so I think, in order to handle the large amount of records.  I know the concept of the two .bat files is difficult to understand but it's almost like if the records are cached already, the second .bat file will not have to do so much retrieving and the timeout will not occur.  I had a ticket opened with technical support and they were not able to duplicate it, so I've just used my workaround. Try it without the filter and see what happens. Good Luck.   :rolleyes: