2 Replies Latest reply: Jan 31, 2013 8:07 AM by Andy C. RSS

    Documaker 11.5 - How to Modify contents of a batch file during Genprint

    Andy C.
      Hello,

      Does any one know if it is possible to Update, Modify, or Edit the contents of a batch (.bch) file, preferrably during Genprint. I have tried using the DBUpdate dal command without success, but then discovered that the documentation indicates that the DBUpdate functionality does not work if the database is opened as "ASCII".

      Between Gendata and Genprint, the batch file is sorted using a separate process, and then after the sort step, I would like to add a sequence number to the file in ascending order from 1 to the end.

      If anyone has experience with this, or has any good ideas, it would be a huge help... Thanks!

      Andy
        • 1. Re: Documaker 11.5 - How to Modify contents of a batch file during Genprint
          user9976634
          Do you intend to use this sequence number during the actual print in some way?
          You are correct that the ASCII handler can't read and update the records in a single pass. DAL can be used, but you have to do so before the normal loading of the batch records. You would do this via the INI using a ~DALRUN. A possible point would be somewhere like this:

          <RunMode>
          FlushDALSymbols=~DALRUN myScript.dal

          This option is checked early in the process. All you have to remember is to return "Yes" at the end. Otherwise, you can do anything you need to in the script.

          Seems to me that someone has done this before by opening the file twice, once using an alias name. This way you can read from one reference and write with the other. Of course, you have to add your column to the DFD before even the Gendata runs so that you will already have room.
          • 2. Re: Documaker 11.5 - How to Modify contents of a batch file during Genprint
            Andy C.
            Hello, and thank you for the good idea of where to run the dal script, but do you have any ideas on how to do the updating of the actual .bch file? The DBUpdate command is the only idea I have tried, and it was not successful. If you have any ideas on the best command or logic or rule to use, that would be a great start, and then I could take it from there. Thanks for helping!