3 Replies Latest reply: Feb 20, 2010 4:36 AM by JohnGoodwin RSS

    MaxL with DATAEXPORT and passed parameters

    602601
      Have a MaxL script that is passed four parameters.
      Within the MaxL script I am executing a DATAEXPORT calculation, not a calc script.
      I want to use some of the parameters as part of the output filename. I have tried various combintaion of single quotes, double quotes, backslashes, etc. on the output filename but can't seem to come up with the right combination. Always seems to produce ERROR - 1242021 - (11) Syntax error near....

      Any ideas, suggestions or am I wasting my time on this one?

      Thanks,
      Tom
      System 9BI+ running on Windows

      /* ===========================================================================      */
      /* : Required Parameters      */
      /* : $1 - ID      */
      /* : $2 - password      */
      /* : $3 - app name      */
      /* : $4 - db name                                        */
      /* ===========================================================================      */
      login $1 $2 on 'localhost';
      execute calculation
      'SET DATAEXPORTOPTIONS
      {
      DataExportLevel "LEVEL0";
      DataExportRelationalFile ON;
      DataExportOverwriteFile ON;
      DataExportDynamicCalc OFF;
      DataExportColFormat ON;
      };
      FIX("CY2010");
      DATAEXPORT "File" "," E:\Hyperion\AnalyticServices\app\$3\$4\CY2010Data.txt "#MI";
      ENDFIX;'
      on $3.$4;
      spool off;
      logout;
      exit;
        • 1. Re: MaxL with DATAEXPORT and passed parameters
          650449
          HI Mohanan,

          I don't think you can use that in a MaxL script. You can only use export database in MaxL. I don't think you can use a fix statement in MaxL. I would use that in a calc script.

          I am not sure thought. Any one else with a better opinion !!!
          • 2. Re: MaxL with DATAEXPORT and passed parameters
            CL
            Doing this in a calculation string is intriguing. I wonder if it's the double quotes inside single quotes; perhaps putting it all in double quotes would work. See: http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_techref/maxl_syntax_shellquoterules.htm

            Another approach (I like it less), would be to set this up as a HBR and drive the local/global variables by the external file: http://download.oracle.com/docs/cd/E12825_01/epm.111/hbr_admin_help/ch04s05.html

            Regards,

            Cameron Lackpour
            • 3. Re: MaxL with DATAEXPORT and passed parameters
              JohnGoodwin
              Hi,

              I don't think the DATAEXPORT command likes parameters but there is a way around it, it does accept a substitution variable for the whole path and filename.
              If you create a sub var (in my example I have already created one called "ExpFile") then in your maxl script you can set the variable with the full path and filename and then call the subvar in the DATAEXPORT command

              You could do it with something like

              login $1 $2 on 'localhost';
              alter system set variable ExpFile "\"E:\\Hyperion\\AnalyticServices\\app\\$3\\$4\\CY2010Data.txt\"";
              execute calculation
              'SET DATAEXPORTOPTIONS
              {
              DataExportLevel "LEVEL0";
              DataExportRelationalFile ON;
              DataExportOverwriteFile ON;
              DataExportDynamicCalc OFF;
              DataExportColFormat ON;
              };
              FIX("CY2010")
              DATAEXPORT "File" "," &ExpFile "#MI";
              ENDFIX;' on $3.$4;
              logout;
              exit;

              Cheers

              John
              http://john-goodwin.blogspot.com/