5 Replies Latest reply: May 15, 2014 10:00 AM by Gareth Horton RSS

    Naming Macros

    joey

      I would like to begin to utilize macros for our naming of exports through Data Pump.  So far I've manipulated the year (File&[yyyy.-1y].txt).  However, If I'd like to do the previous month in a YYYYMM format how would I do this to accomodate January, when the year needs to be decramented, and the month needs to be set to 12?  Can this be done through simple macros in the export? 

       

      Thanks for any help!

        • Naming Macros
          Gareth Horton

          Joey,

           

          I think a should work fine.

           

          Gareth

           

          Originally posted by Joey:

          I would like to begin to utilize macros for our naming of exports through Data Pump.  So far I've manipulated the year (File&[yyyy.-1y].txt).  However, If I'd like to do the previous month in a YYYYMM format how would I do this to accomodate January, when the year needs to be decramented, and the month needs to be set to 12?  Can this be done through simple macros in the export? 

           

          Thanks for any help! [/b][/quote]

          • Naming Macros
            joey

            I did find this thread:

            [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=10;t=000098#000002"]Naming Files:[/url]

             

            However, none of the syntax seems to work.

            File&[yyyymm.+1m] displays an error Macro is unknown

             

            File&[yyyy]&[mm+1m] processes as File200601 (should process as File200701)

             

            File&[yyyy.mm+1m] displays an error Macro is ill-formed

             

            That's all of the ideas that I had. I looked through the Data Watch website and help files for more information on scripting macros, and couldn't find anything.  Am I missing something?

             

            Any other suggestion on how to modify the date in macros and maintain the correct date?

            • Naming Macros
              Gareth Horton

              Joey,

               

              Sorry about the error in my post, I should have checked it myself.

               

              The correct syntax should be using two macros:

              &[yyyy.-1m]&[mm.-1m]

               

              Gareth

               

               

              Originally posted by Joey:

              I did find this thread:

              [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=10;t=000098#000002"]Naming Files:[/url]

               

              However, none of the syntax seems to work.

              File&[yyyymm.+1m] displays an error Macro is unknown

               

              File&[yyyy]&[mm+1m] processes as File200601 (should process as File200701)

               

              File&[yyyy.mm+1m] displays an error Macro is ill-formed

               

              That's all of the ideas that I had. I looked through the Data Watch website and help files for more information on scripting macros, and couldn't find anything.  Am I missing something?

               

              Any other suggestion on how to modify the date in macros and maintain the correct date? /b[/quote]

              • Naming Macros
                joey

                That works great.  Thanks!

                 

                Is there a place where this is documented better than Using the Naming Macros in the Data Pump help file? 

                 

                The particular case I'm stuck on now is that I'd like to do one year prior to the current procesing year.  The problem is that we do processing of each month during the next month.  So, this would be something like &[yyyy.-1y.-1m], since December would run in January of a differant year than January through November.

                • Naming Macros
                  Gareth Horton

                  Joey,

                   

                  I am slightly confused about what you need, but could it be rephrased as you need the month as of 11 months ago (1 year -1 month)?  Or is it 13 months ago (1 year +1 month)?

                   

                  In that case, you need to use the same approach as in the last one, 2 macros:

                   

                  &[yyyy.-11m]&[mm.-11m] or

                  &[yyyy.-13m]&[mm.-13m]

                   

                  These are actually called offset expressions, so search for offset in the Data Pump help for more info.

                   

                  Gareth

                   

                   

                  Originally posted by Joey:

                  That works great.  Thanks!

                   

                  Is there a place where this is documented better than Using the Naming Macros in the Data Pump help file? 

                   

                  The particular case I'm stuck on now is that I'd like to do one year prior to the current procesing year.  The problem is that we do processing of each month during the next month.  So, this would be something like &[yyyy.-1y.-1m], since December would run in January of a differant year than January through November. /b[/quote]