Filename Increments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benchpolo
    New Member
    • Sep 2007
    • 142

    Filename Increments

    I have an automated process that I need to produce incremental filenames so that when the sql process runs multiple times the file will be incremented, but I cannot find or figure out how to write this code.

    For example, arcca_daily_inc oming_1.asc , this is the filename for the first run then when the process executes again on the same the the filename would be arcca_daily_inc oming_2.asc then arcca_daily_inc oming_3.asc .. make sense?

    Can someone assist me with the code or point me where I can mirror the code? I have never written this kind of process before.

    You assitance will be appreciated.

    Thanks.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Will the process execute once, meaning all these files will be created at once? Or your process will execute in a defined frequency that it will start from the last file created from the previous process and go from there?


    --- CK

    Comment

    • benchpolo
      New Member
      • Sep 2007
      • 142

      #3
      The process is automated so if it runs succesfully for that day it will be arcca_daily_inc oming_1.asc, but if the automated process is run manually it should not create arcca_daily_inc oming_1.asc instead it should increment to arcca_daily_inc oming_2.asc

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        In that case, you have to check first if there are existing files on your target folder. If there are, you have grab the last increment number and start from there, if no file are existing, start from 1, then loop. You have to do all this using dynamic query.

        Happy Coding!

        --- CK

        Comment

        • Jerry Winston
          Recognized Expert New Member
          • Jun 2008
          • 145

          #5
          Perhaps it would be more useful if you used a time/date combination to name your erudite files. As your process continues to run, filename_#.ext becomes less useful to placing the file name into a useful context such as when an event/error occurred.

          That's it. I'm out of change.

          That was my last two cents.

          Comment

          Working...