1 2 Previous Next 18 Replies Latest reply on Jan 29, 2016 2:34 PM by user9510887

    Jython Script to Remove Quotes

    user9510887

      All,

       

      I have created the following script as a Before Import event script to remove the quotes around member names in our source file.  All seems to be working except the last step of deleting and renaming the file (os.remove and os.rename).  I can see the ".out" file and it looks correct, but the original file is still there.  Any help is greatly appreciated.

       

      if fdmContext["LOCNAME"] == "TecLabor_TO_RSA":

           fdmAPI.logInfo(fdmContext["LOCNAME"])

           try:

                filename = fdmContext["FILENAME"]

                inbox = fdmContext["INBOXDIR"]

                #filedir = fdmContext["FILEDIR"]

                fdmAPI.logInfo(filename)

                fdmAPI.logInfo(inbox)

                file = inbox + "\\TecLabor_TO_RSA\\" + filename

                file_out = inbox + "\\TecLabor_TO_RSA\\" + filename + ".out"

                #file = inbox + "\\" + filedir + "\\"+filename

                #file_out = inbox + "\\" + filedir + "\\"+filename + ".out"

                fdmAPI.logInfo(file)

                fin = open(file,"r")

                fout = open(file_out,"w")

                for line in fin:

                     line=line.replace('"','')

                     fout.write(line)

                fin.close()

                fout.close()

           except IOError, err:

               fdmAPI.logError("My error"+ str(err))

           os.remove(file)

           os.rename(file_out,file)

        • 1. Re: Jython Script to Remove Quotes
          SH_INT

          So are you saying that the os.rename and the os.remove commands are not working? If so make sure you have included the following import statement at the top of your script - import os

          1 person found this helpful
          • 2. Re: Jython Script to Remove Quotes
            user9510887

            Yes, that was it.  I was missing the import os at the top of the script.

            • 3. Re: Jython Script to Remove Quotes
              SH_INT

              Cool. Could you please close the thread by marking it as answered. Thanks.

              • 4. Re: Jython Script to Remove Quotes
                user9510887

                So I ran into another issue.  That script works fine if I manually select the file.  But what would need to change if I put it into a batch?  I have created a batch definition and added this custom script the "Before Batch Script" option, however, it is not really doing anything with the file to remove the quotes, although the batch does run.  My assumption is that it may have to do with the IF logic being ignored or causing it to skip completely because it hasn't looked at a location name at that point.

                 

                Thoughts?

                • 5. Re: Jython Script to Remove Quotes
                  Ankit13

                  I believe you don't have to put the script in "Before Batch Script". The batch would pick it up and run the process just like  manual process. But make sure to follow the naming convention of files for open batches. Put the file in inbox\batches\openbatch folder and name it in the following format :FileID_RuleName_Period_LoadMethod. Check the Admin documentation for more info for naming open batch file, it will get the location name based on load rule.


                  Thanks

                  Ankit

                  • 6. Re: Jython Script to Remove Quotes
                    user9510887

                    Thanks Ankit.

                     

                    We actually have a number of batches running from FDM.  I have multiple subfolders under inbox\batches\openbatch that we use, and have I have setup one for this as well.  However, when I would run it, it did nothing with the script.  I have also updated the file paths to the directory under openbatch

                     

                    import os

                     

                    if fdmContext["LOCNAME"] == "TecLabor_TO_RSA":

                         fdmAPI.logInfo(fdmContext["LOCNAME"])

                         try:

                              filename = fdmContext["FILENAME"]

                              inbox = fdmContext["INBOXDIR"]

                              #filedir = fdmContext["FILEDIR"]

                              fdmAPI.logInfo(filename)

                              fdmAPI.logInfo(inbox)

                              file = inbox + "\\batches\\openbatch\\TecLabor_TO_RSA\\TecLabor_TO_RSA\\" + filename

                              file_out = inbox + "\\batches\\openbatch\\TecLabor_TO_RSA\\TecLabor_TO_RSA\\" + filename + ".out"

                              #file = inbox + "\\" + filedir + "\\"+filename

                              #file_out = inbox + "\\" + filedir + "\\"+filename + ".out"

                              fdmAPI.logInfo(file)

                              fin = open(file,"r")

                              fout = open(file_out,"w")

                              for line in fin:

                                   line=line.replace('"','')

                                   fout.write(line)

                              fin.close()

                              fout.close()

                         except IOError, err:

                             fdmAPI.logError("My error"+ str(err))

                     

                     

                         os.remove(file)

                         os.rename(file_out,file)

                    • 7. Re: Jython Script to Remove Quotes
                      Ankit13

                      Can you the attach the Process Details log for the batch file load ?

                       

                      Thanks

                      Ankit

                      • 8. Re: Jython Script to Remove Quotes
                        user9510887

                        Can I actually attached the file or do I need to paste the contents in?  I don't see an option to actually attach a file, just image, video and link.

                        • 9. Re: Jython Script to Remove Quotes
                          Ankit13

                          You can paste it here.

                          • 10. Re: Jython Script to Remove Quotes
                            user9510887

                            2016-01-28 14:08:14,391 INFO  [AIF]: FDMEE Process Start, Process ID: 1,716

                            2016-01-28 14:08:14,391 INFO  [AIF]: FDMEE Logging Level: 5

                            2016-01-28 14:08:14,391 INFO  [AIF]: FDMEE Log File: D:/FDMEE\outbox\logs\RSA_1716.log

                            2016-01-28 14:08:14,391 INFO  [AIF]: User:admin

                            2016-01-28 14:08:14,391 INFO  [AIF]: Location:TecLabor_TO_RSA (Partitionkey:15)

                            2016-01-28 14:08:14,391 INFO  [AIF]: Period Name:Jan-2017 (Period Key:1/1/17 12:00 AM)

                            2016-01-28 14:08:14,391 INFO  [AIF]: Category Name:Actual (Category key:4)

                            2016-01-28 14:08:14,391 INFO  [AIF]: Rule Name:TecLabor_TO_RSA (Rule ID:38)

                            2016-01-28 14:08:16,388 INFO  [AIF]: Jython Version: 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54)

                            [Oracle JRockit(R) (Oracle Corporation)]

                            2016-01-28 14:08:16,388 INFO  [AIF]: Java Platform: java1.6.0_37

                            2016-01-28 14:08:16,388 INFO  [AIF]: Log File Encoding: UTF-8

                            2016-01-28 14:08:18,073 INFO  [AIF]: -------START IMPORT STEP-------

                            2016-01-28 14:08:22,924 DEBUG [AIF]: CommData.preImportData - START

                            2016-01-28 14:08:22,924 DEBUG [AIF]: CommData.getRuleInfo - START

                            2016-01-28 14:08:22,924 DEBUG [AIF]:

                                    SELECT brl.RULE_ID

                                    ,br.RULE_NAME

                                    ,brl.PARTITIONKEY

                                    ,brl.CATKEY

                                    ,part.PARTVALGROUP

                                    ,br.SOURCE_SYSTEM_ID

                                    ,ss.SOURCE_SYSTEM_TYPE

                                    ,CASE

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'EBS%' THEN 'N'

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'PS%' THEN 'N'

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'FUSION%' THEN 'N'

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'FILE%' THEN 'N'

                                      ELSE 'Y'

                                    END SOURCE_ADAPTER_FLAG

                                    ,app.APPLICATION_ID

                                    ,app.TARGET_APPLICATION_NAME

                                    ,app.TARGET_APPLICATION_TYPE

                                    ,app.DATA_LOAD_METHOD

                                    ,brl.PLAN_TYPE

                                    ,CASE brl.PLAN_TYPE

                                      WHEN 'PLAN1' THEN 1

                                      WHEN 'PLAN2' THEN 2

                                      WHEN 'PLAN3' THEN 3

                                      WHEN 'PLAN4' THEN 4

                                      WHEN 'PLAN5' THEN 5

                                      ELSE 0

                                    END PLAN_NUMBER

                                    ,br.INCL_ZERO_BALANCE_FLAG

                                    ,br.PERIOD_MAPPING_TYPE

                                    ,br.INCLUDE_ADJ_PERIODS_FLAG

                                    ,br.BALANCE_TYPE ACTUAL_FLAG

                                    ,br.AMOUNT_TYPE

                                    ,br.BALANCE_SELECTION

                                    ,br.BALANCE_METHOD_CODE

                                    ,COALESCE(br.SIGNAGE_METHOD, 'ABSOLUTE') SIGNAGE_METHOD

                                    ,br.CURRENCY_CODE

                                    ,br.BAL_SEG_VALUE_OPTION_CODE

                                    ,brl.EXECUTION_MODE

                                    ,COALESCE(brl.IMPORT_FROM_SOURCE_FLAG, 'Y') IMPORT_FROM_SOURCE_FLAG

                                    ,COALESCE(brl.RECALCULATE_FLAG, 'N') RECALCULATE_FLAG

                                    ,COALESCE(brl.EXPORT_TO_TARGET_FLAG, 'N') EXPORT_TO_TARGET_FLAG

                                    ,COALESCE(brl.CHECK_FLAG, 'N') CHECK_FLAG

                                    ,CASE

                                      WHEN (br.LEDGER_GROUP_ID IS NOT NULL) THEN 'MULTI'

                                      WHEN (br.SOURCE_LEDGER_ID IS NOT NULL) THEN 'SINGLE'

                                      ELSE 'NONE'

                                    END LEDGER_GROUP_CODE

                                    ,COALESCE(br.BALANCE_AMOUNT_BS, 'YTD') BALANCE_AMOUNT_BS

                                    ,COALESCE(br.BALANCE_AMOUNT_IS, 'PERIODIC') BALANCE_AMOUNT_IS

                                    ,br.LEDGER_GROUP

                                    ,(SELECT brd.DETAIL_CODE

                                      FROM AIF_BAL_RULE_DETAILS brd

                                      WHERE brd.RULE_ID = br.RULE_ID

                                      AND brd.DETAIL_TYPE = 'LEDGER'       

                                    ) PS_LEDGER

                                    ,CASE lg.LEDGER_TEMPLATE

                                      WHEN 'COMMITMENT' THEN 'Y'

                                      ELSE 'N'

                                    END KK_FLAG

                                    ,p.LAST_UPDATED_BY

                                    ,p.AIF_WEB_SERVICE_URL WEB_SERVICE_URL

                                    ,p.EPM_ORACLE_INSTANCE

                                    ,brl.JOURNAL_FLAG

                                    ,br.MULTI_PERIOD_FILE_FLAG

                                    ,br.IMPGROUPKEY

                                    FROM AIF_PROCESSES p

                                    INNER JOIN AIF_BAL_RULE_LOADS brl

                                      ON brl.LOADID = p.PROCESS_ID

                                    INNER JOIN AIF_BALANCE_RULES br

                                      ON br.RULE_ID = brl.RULE_ID

                                    INNER JOIN AIF_SOURCE_SYSTEMS ss

                                      ON ss.SOURCE_SYSTEM_ID = br.SOURCE_SYSTEM_ID

                                    INNER JOIN AIF_TARGET_APPLICATIONS app

                                      ON app.APPLICATION_ID = brl.APPLICATION_ID

                                    INNER JOIN TPOVPARTITION part

                                      ON part.PARTITIONKEY = br.PARTITIONKEY

                                    INNER JOIN TBHVIMPGROUP imp

                                      ON imp.IMPGROUPKEY = part.PARTIMPGROUP

                                    LEFT OUTER JOIN AIF_COA_LEDGERS l

                                      ON l.SOURCE_SYSTEM_ID = p.SOURCE_SYSTEM_ID

                                      AND l.SOURCE_LEDGER_ID = COALESCE(br.SOURCE_LEDGER_ID,imp.IMPSOURCELEDGERID)

                                    LEFT OUTER JOIN AIF_PS_SET_CNTRL_REC_STG scr

                                      ON scr.SOURCE_SYSTEM_ID = l.SOURCE_SYSTEM_ID

                                      AND scr.SETCNTRLVALUE = l.SOURCE_LEDGER_NAME

                                      AND scr.RECNAME = 'LED_GRP_TBL'

                                    LEFT OUTER JOIN AIF_PS_LED_GRP_TBL_STG lg

                                      ON lg.SOURCE_SYSTEM_ID = scr.SOURCE_SYSTEM_ID

                                      AND lg.SETID = scr.SETID

                                      AND lg.LEDGER_GROUP = br.LEDGER_GROUP

                                    WHERE p.PROCESS_ID = 1716

                                   

                            2016-01-28 14:08:22,924 DEBUG [AIF]:

                                  SELECT adim.BALANCE_COLUMN_NAME DIMNAME

                                  ,adim.DIMENSION_ID

                                  ,dim.TARGET_DIMENSION_CLASS_NAME

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID1

                                  ) COA_SEGMENT_NAME1

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID2

                                  ) COA_SEGMENT_NAME2

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID3

                                  ) COA_SEGMENT_NAME3

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID4

                                  ) COA_SEGMENT_NAME4

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID5

                                  ) COA_SEGMENT_NAME5

                                  ,(SELECT CASE mdd.ORPHAN_OPTION_CODE

                                      WHEN 'CHILD' THEN 'N'

                                      WHEN 'ROOT' THEN 'N'

                                      ELSE 'Y'

                                    END DIMENSION_FILTER_FLAG

                                    FROM AIF_MAP_DIM_DETAILS_V mdd

                                    ,AIF_MAPPING_RULES mr

                                    WHERE mr.PARTITIONKEY = tpp.PARTITIONKEY

                                    AND mdd.RULE_ID = mr.RULE_ID

                                    AND mdd.DIMENSION_ID = adim.DIMENSION_ID

                                  ) DIMENSION_FILTER_FLAG

                                  ,tiie.IMPCONCATCHAR

                                  FROM TPOVPARTITION tpp

                                  INNER JOIN AIF_TARGET_APPL_DIMENSIONS adim

                                    ON adim.APPLICATION_ID = 5

                                   

                                    AND adim.VALID_FOR_PLAN1 = 1

                                   

                                  INNER JOIN AIF_DIMENSIONS dim

                                    ON dim.DIMENSION_ID = adim.DIMENSION_ID

                                  LEFT OUTER JOIN TBHVIMPITEMERPI tiie

                                    ON tiie.IMPGROUPKEY = tpp.PARTIMPGROUP

                                    AND tiie.IMPFLDFIELDNAME = adim.BALANCE_COLUMN_NAME

                                    AND tiie.IMPMAPTYPE = 'ERP'

                                  WHERE tpp.PARTITIONKEY = 15

                                  AND adim.BALANCE_COLUMN_NAME IS NOT NULL

                                  AND dim.TARGET_DIMENSION_CLASS_NAME <> 'ICPTRANS'

                                  ORDER BY adim.BALANCE_COLUMN_NAME

                                 

                            2016-01-28 14:08:22,940 DEBUG [AIF]: {'APPLICATION_ID': 5L, 'IMPORT_FROM_SOURCE_FLAG': u'Y', 'PLAN_TYPE': u'PLAN1', 'RULE_NAME': u'TecLabor_TO_RSA', 'ACTUAL_FLAG': None, 'IS_INCREMENTAL_LOAD': False, 'EPM_ORACLE_INSTANCE': u'D:\\Oracle\\Middleware\\user_projects\\epmsystem2', 'CATKEY': 4L, 'BAL_SEG_VALUE_OPTION_CODE': None, 'INCLUDE_ADJ_PERIODS_FLAG': u'N', 'PERIOD_MAPPING_TYPE': u'DEFAULT', 'SOURCE_SYSTEM_TYPE': u'FILE', 'CHECK_FLAG': u'Y', 'LEDGER_GROUP': None, 'TARGET_APPLICATION_NAME': u'RSA', 'RECALCULATE_FLAG': u'Y', 'SOURCE_SYSTEM_ID': 1L, 'TEMP_DATA_TABLE_NAME': 'TDATASEG_T', 'KK_FLAG': u'N', 'IMPGROUPKEY': u'TecLabor_TO_RSA', 'AMOUNT_TYPE': u'MONETARY', 'DATA_TABLE_NAME': 'TDATASEG', 'EXPORT_TO_TARGET_FLAG': u'Y', 'JOURNAL_FLAG': None, 'DIMNAME_LIST': [u'ACCOUNT', u'ENTITY', u'UD1', u'UD2', u'UD3', u'UD4', u'UD5', u'UD6', u'UD7'], 'TDATAMAPTYPE': 'ERP', 'LAST_UPDATED_BY': u'admin', 'DIMNAME_MAP': {u'UD6': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD6', 'DIMENSION_ID': 35L}, u'UD3': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD3', 'DIMENSION_ID': 32L}, u'ENTITY': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Entity', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'ENTITY', 'DIMENSION_ID': 30L}, u'UD7': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD7', 'DIMENSION_ID': 36L}, u'UD2': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD2', 'DIMENSION_ID': 31L}, u'UD5': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD5', 'DIMENSION_ID': 34L}, u'UD4': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD4', 'DIMENSION_ID': 33L}, u'ACCOUNT': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Account', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'ACCOUNT', 'DIMENSION_ID': 29L}, u'UD1': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Version', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD1', 'DIMENSION_ID': 40L}}, 'TARGET_APPLICATION_TYPE': u'HPL', 'PARTITIONKEY': 15L, 'PARTVALGROUP': u'[NONE]', 'LEDGER_GROUP_CODE': u'NONE', 'INCLUDE_ZERO_BALANCE_FLAG': None, 'EXECUTION_MODE': u'REPLACE', 'PLAN_NUMBER': 1L, 'MULTI_PERIOD_FILE_FLAG': u'N', 'PS_LEDGER': None, 'BALANCE_SELECTION': u'FUNCTIONAL', 'BALANCE_AMOUNT_IS': u'PERIODIC', 'RULE_ID': 38L, 'BALANCE_AMOUNT_BS': u'YTD', 'CURRENCY_CODE': None, 'SOURCE_ADAPTER_FLAG': u'N', 'BALANCE_METHOD_CODE': None, 'SIGNAGE_METHOD': u'ABSOLUTE', 'WEB_SERVICE_URL': u'http://KWAWNAPPTQ138.corp.root.nasd.com:6550/aif', 'DATA_LOAD_METHOD': u'CLASSIC_VIA_EPMI'}

                            2016-01-28 14:08:22,940 DEBUG [AIF]: CommData.getRuleInfo - END

                            2016-01-28 14:08:22,940 DEBUG [AIF]: CommData.insertFilePeriods - START

                            2016-01-28 14:08:22,940 DEBUG [AIF]: commAppPeriodMappingExists: Y

                            2016-01-28 14:08:22,940 DEBUG [AIF]:

                              select PERIODKEY,PERIODDESC,YEARTARGET,PERIODTARGET,FILE_NAME_STATIC,FILE_NAME_SUFFIX_TYPE,FILE_NAME_DATE_FORMAT,GL_EFFECTIVE_PERIOD_NUM

                              from (

                                    SELECT pp.PERIODKEY

                                      ,pp.PERIODDESC

                                      ,pp.YEARTARGET YEARTARGET

                                      ,pp.PERIODTARGET PERIODTARGET         

                                      ,brl.FILE_NAME_STATIC

                                      ,brl.FILE_NAME_SUFFIX_TYPE

                                      ,brl.FILE_NAME_DATE_FORMAT

                                      ,coalesce(brp.parameter_id,0) GL_EFFECTIVE_PERIOD_NUM

                                      FROM AIF_BALANCE_RULES br, AIF_BAL_RULE_LOADS brl

                                      INNER JOIN TPOVCATEGORY pc

                                        ON pc.CATKEY = brl.CATKEY

                                     

                                      INNER JOIN TPOVPERIODADAPTOR_FLAT_V pp

                                        ON pp.PERIODFREQ = pc.CATFREQ           

                                        AND pp.INTSYSTEMKEY = 'RSA'

                                      INNER JOIN AIF_BAL_RULE_LOAD_PARAMS brp

                                        ON brp.loadid = brl.loadid

                                        AND to_date(brp.parameter_value,'yyyy/MM/dd') = pp.periodkey

                                      WHERE brl.LOADID = 1716   

                                        AND br.rule_id = brl.rule_id

                                        AND br.MULTI_PERIOD_FILE_FLAG = 'Y'

                                       

                                        UNION

                                       

                                      SELECT pp.PERIODKEY

                                      ,pp.PERIODDESC

                                      ,pp.YEARTARGET YEARTARGET

                                      ,pp.PERIODTARGET PERIODTARGET         

                                      ,brl.FILE_NAME_STATIC

                                      ,brl.FILE_NAME_SUFFIX_TYPE

                                      ,brl.FILE_NAME_DATE_FORMAT

                                      ,0 GL_EFFECTIVE_PERIOD_NUM

                                      FROM AIF_BALANCE_RULES br, AIF_BAL_RULE_LOADS brl

                                      INNER JOIN TPOVCATEGORY pc

                                        ON pc.CATKEY = brl.CATKEY

                                     

                                      INNER JOIN TPOVPERIODADAPTOR_FLAT_V pp

                                        ON pp.PERIODFREQ = pc.CATFREQ           

                                        AND pp.INTSYSTEMKEY = 'RSA'

                                        AND pp.PERIODKEY >= brl.START_PERIODKEY

                                        AND pp.PERIODKEY <= brl.END_PERIODKEY        

                                      WHERE brl.LOADID = 1716   

                                        AND br.rule_id = brl.rule_id

                                        AND br.MULTI_PERIOD_FILE_FLAG = 'Y'

                                        AND 0 = (SELECT count(*)

                                                  FROM AIF_BALANCE_RULES br2, AIF_BAL_RULE_LOADS brl2

                                                  INNER JOIN TPOVCATEGORY pc2

                                                    ON pc2.CATKEY = brl2.CATKEY

                                                

                                      INNER JOIN TPOVPERIODADAPTOR_FLAT_V pp2

                                        ON pp2.PERIODFREQ = pc2.CATFREQ           

                                        AND pp2.INTSYSTEMKEY = 'RSA'

                                                  INNER JOIN AIF_BAL_RULE_LOAD_PARAMS brp2

                                                    ON brp2.loadid = brl2.loadid

                                                    AND to_date(brp2.parameter_value,'yyyy/MM/dd') = pp2.periodkey

                                                  WHERE brl2.LOADID = brl.LOADID   

                                                    AND br2.rule_id = brl2.rule_id

                                                    AND br2.MULTI_PERIOD_FILE_FLAG = 'Y'

                                                  )

                                                 

                                       ) qrslt

                                      

                                      UNION

                             

                             

                                       SELECT pp.PERIODKEY

                                       ,pp.PERIODDESC

                                      ,pp.YEARTARGET YEARTARGET

                                      ,pp.PERIODTARGET PERIODTARGET

                                      ,brl.FILE_NAME_STATIC

                                      ,brl.FILE_NAME_SUFFIX_TYPE

                                      ,brl.FILE_NAME_DATE_FORMAT

                                      , 0 GL_EFFECTIVE_PERIOD_NUM

                                      FROM AIF_BALANCE_RULES br, AIF_BAL_RULE_LOADS brl

                                      INNER JOIN TPOVCATEGORY pc

                                        ON pc.CATKEY = brl.CATKEY

                                     

                                      INNER JOIN TPOVPERIODADAPTOR_FLAT_V pp

                                        ON pp.PERIODFREQ = pc.CATFREQ           

                                        AND pp.INTSYSTEMKEY = 'RSA'

                                        AND pp.PERIODKEY >= brl.START_PERIODKEY

                                        AND pp.PERIODKEY <= brl.END_PERIODKEY

                                      WHERE brl.LOADID = 1716             

                                        AND (br.MULTI_PERIOD_FILE_FLAG is null or br.MULTI_PERIOD_FILE_FLAG <> 'Y' )

                                        AND br.rule_id = brl.rule_id

                                       

                                      ORDER BY PERIODKEY

                                     

                            2016-01-28 14:08:22,955 INFO  [AIF]: File Name: R~TecLabor_TO_RSA~Jan-2017~RR.txt

                            2016-01-28 14:08:22,955 DEBUG [AIF]:

                                    INSERT INTO AIF_PROCESS_PERIODS (

                                      PROCESS_ID

                                      ,PERIODKEY

                                      ,ADJUSTMENT_PERIOD_FLAG

                                      ,GL_PERIOD_YEAR

                                      ,GL_PERIOD_CODE

                                     

                                      ,GL_PERIOD_NAME

                                      ,GL_PERIOD_NUM

                                      ,GL_EFFECTIVE_PERIOD_NUM

                                      ,YEARTARGET

                                      ,PERIODTARGET

                                     

                                      ,IMP_ENTITY_TYPE

                                      ,IMP_ENTITY_NAME

                                      ,TRANS_ENTITY_TYPE

                                      ,TRANS_ENTITY_NAME

                                      ,PRIOR_PERIOD_FLAG

                                    ) VALUES (1716,'2017-01-01','N',0,'0' ,'0',0,1,'FY17','Jan', 'PROCESS_BAL_IMP_FILE','R~TecLabor_TO_RSA~Jan-2017~RR.txt','PROCESS_BAL_TRANS','Jan-2017','N' )

                                   

                            2016-01-28 14:08:22,955 DEBUG [AIF]: CommData.insertFilePeriods - END

                            2016-01-28 14:08:22,955 DEBUG [AIF]: CommData.insertImportProcessDetails - START

                            2016-01-28 14:08:22,955 DEBUG [AIF]:

                                      INSERT INTO AIF_PROCESS_DETAILS (

                                        PROCESS_ID

                                        ,ENTITY_TYPE

                                        ,ENTITY_ID

                                        ,ENTITY_NAME

                                        ,ENTITY_NAME_ORDER

                                        ,TARGET_TABLE_NAME

                                        ,EXECUTION_START_TIME

                                        ,EXECUTION_END_TIME

                                        ,RECORDS_PROCESSED

                                        ,STATUS

                                        ,LAST_UPDATED_BY

                                        ,LAST_UPDATE_DATE

                                      )

                                      SELECT PROCESS_ID

                                      ,ENTITY_TYPE

                                      ,ENTITY_ID

                                      ,ENTITY_NAME

                                      ,ENTITY_NAME_ORDER

                                      ,'TDATASEG' TARGET_TABLE_NAME

                                      ,CURRENT_TIMESTAMP EXECUTION_START_TIME

                                      ,NULL EXECUTION_END_TIME

                                      ,0 RECORDS_PROCESSED

                                      ,'PENDING' STATUS

                                      ,'admin' LAST_UPDATED_BY

                                      ,CURRENT_TIMESTAMP LAST_UPDATE_DATE

                                      FROM (

                                        SELECT DISTINCT PROCESS_ID

                                        ,IMP_ENTITY_TYPE ENTITY_TYPE

                                        ,IMP_ENTITY_ID ENTITY_ID

                                        ,IMP_ENTITY_NAME ENTITY_NAME

                                        ,(COALESCE(SOURCE_LEDGER_ID,0) * 100000000 + GL_EFFECTIVE_PERIOD_NUM) ENTITY_NAME_ORDER

                                        FROM AIF_PROCESS_PERIODS

                                        WHERE PROCESS_ID = 1716

                                      ) q

                                      ORDER BY ENTITY_NAME_ORDER

                                     

                            2016-01-28 14:08:22,955 DEBUG [AIF]: CommData.insertImportProcessDetails - END

                            2016-01-28 14:08:22,971 DEBUG [AIF]: Comm.doScriptInit - START

                            2016-01-28 14:08:23,143 DEBUG [AIF]: fdmContext: {BATCHSCRIPTDIR=D:\Oracle\Middleware\user_projects\epmsystem2\FinancialDataQuality, INBOXDIR=D:/FDMEE\inbox, LOCNAME=TecLabor_TO_RSA, SOURCENAME=File, APPID=5, IMPORTFORMAT=TecLabor_TO_RSA, SCRIPTSDIR=D:/FDMEE\data\scripts, EPMORACLEHOME=D:\Oracle\Middleware\EPMSystem11R1, RULEID=38, CATNAME=Actual, EPMORACLEINSTANCEHOME=D:\Oracle\Middleware\user_projects\epmsystem2, LOADID=1716, PERIODNAME=Jan-2017, IMPORTMODE=REPLACE, SOURCETYPE=FILE, PERIODKEY=2017-01-01, TARGETAPPDB=PLAN1, EXPORTFLAG=Y, TARGETAPPNAME=RSA, FILENAME=R~TecLabor_TO_RSA~Jan-2017~RR.txt, LOCKEY=15, RULENAME=TecLabor_TO_RSA, OUTBOXDIR=D:/FDMEE\outbox, MULTIPERIODLOAD=N, EXPORTMODE=STORE_DATA, CATKEY=4, FILEDIR=/inbox/batches/openbatch/TecLabor_TO_RSA\TecLabor_TO_RSA1715, IMPORTFLAG=Y}

                            2016-01-28 14:08:23,143 DEBUG [AIF]: The EpmOracleHome is set to: D:\Oracle\Middleware\EPMSystem11R1

                            2016-01-28 14:08:23,143 DEBUG [AIF]: The EpmOracleInstance is set to: D:\Oracle\Middleware\user_projects\epmsystem2

                            2016-01-28 14:08:23,143 DEBUG [AIF]: The JavaHome is set to: %EPM_ORACLE_HOME%/../jdk160_35

                            2016-01-28 14:08:23,143 DEBUG [AIF]: The executeEventScript is set to: YES

                            2016-01-28 14:08:23,143 DEBUG [AIF]: The OleDatabaseProvider is set to: ORAOLEDB.ORACLE

                            2016-01-28 14:08:23,143 DEBUG [AIF]: The AppRootFolder is set to: D:/FDMEE

                            2016-01-28 14:08:23,143 DEBUG [AIF]: Comm.doScriptInit - END

                            2016-01-28 14:08:23,143 DEBUG [AIF]: Comm.executeScript - START

                            2016-01-28 14:08:23,143 INFO  [AIF]: Executing the following script: D:/FDMEE/data/scripts/event/BefImport.py

                            2016-01-28 14:08:23,158 INFO  [AIF]: TecLabor_TO_RSA

                            2016-01-28 14:08:23,158 INFO  [AIF]: R~TecLabor_TO_RSA~Jan-2017~RR.txt

                            2016-01-28 14:08:23,158 INFO  [AIF]: D:/FDMEE\inbox

                            2016-01-28 14:08:23,158 INFO  [AIF]: D:/FDMEE\inbox\batches\openbatch\TecLabor_TO_RSA\TecLabor_TO_RSA\R~TecLabor_TO_RSA~Jan-2017~RR.txt

                            2016-01-28 14:08:23,158 ERROR [AIF]: My error[Errno 2] ENOENT: 'D:/FDMEE\\inbox\\batches\\openbatch\\TecLabor_TO_RSA\\TecLabor_TO_RSA\\R~TecLabor_TO_RSA~Jan-2017~RR.txt'

                            2016-01-28 14:08:23,158 ERROR [AIF]: The script has failed to execute:

                            2016-01-28 14:08:23,548 DEBUG [AIF]: Comm.finalizeProcess - START

                            2016-01-28 14:08:23,548 DEBUG [AIF]: CommData.updateRuleStatus - START

                            2016-01-28 14:08:23,548 DEBUG [AIF]: CommData.getRuleInfo - START

                            2016-01-28 14:08:23,564 DEBUG [AIF]:

                                    SELECT brl.RULE_ID

                                    ,br.RULE_NAME

                                    ,brl.PARTITIONKEY

                                    ,brl.CATKEY

                                    ,part.PARTVALGROUP

                                    ,br.SOURCE_SYSTEM_ID

                                    ,ss.SOURCE_SYSTEM_TYPE

                                    ,CASE

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'EBS%' THEN 'N'

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'PS%' THEN 'N'

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'FUSION%' THEN 'N'

                                      WHEN ss.SOURCE_SYSTEM_TYPE LIKE 'FILE%' THEN 'N'

                                      ELSE 'Y'

                                    END SOURCE_ADAPTER_FLAG

                                    ,app.APPLICATION_ID

                                    ,app.TARGET_APPLICATION_NAME

                                    ,app.TARGET_APPLICATION_TYPE

                                    ,app.DATA_LOAD_METHOD

                                    ,brl.PLAN_TYPE

                                    ,CASE brl.PLAN_TYPE

                                      WHEN 'PLAN1' THEN 1

                                      WHEN 'PLAN2' THEN 2

                                      WHEN 'PLAN3' THEN 3

                                      WHEN 'PLAN4' THEN 4

                                      WHEN 'PLAN5' THEN 5

                                      ELSE 0

                                    END PLAN_NUMBER

                                    ,br.INCL_ZERO_BALANCE_FLAG

                                    ,br.PERIOD_MAPPING_TYPE

                                    ,br.INCLUDE_ADJ_PERIODS_FLAG

                                    ,br.BALANCE_TYPE ACTUAL_FLAG

                                    ,br.AMOUNT_TYPE

                                    ,br.BALANCE_SELECTION

                                    ,br.BALANCE_METHOD_CODE

                                    ,COALESCE(br.SIGNAGE_METHOD, 'ABSOLUTE') SIGNAGE_METHOD

                                    ,br.CURRENCY_CODE

                                    ,br.BAL_SEG_VALUE_OPTION_CODE

                                    ,brl.EXECUTION_MODE

                                    ,COALESCE(brl.IMPORT_FROM_SOURCE_FLAG, 'Y') IMPORT_FROM_SOURCE_FLAG

                                    ,COALESCE(brl.RECALCULATE_FLAG, 'N') RECALCULATE_FLAG

                                    ,COALESCE(brl.EXPORT_TO_TARGET_FLAG, 'N') EXPORT_TO_TARGET_FLAG

                                    ,COALESCE(brl.CHECK_FLAG, 'N') CHECK_FLAG

                                    ,CASE

                                      WHEN (br.LEDGER_GROUP_ID IS NOT NULL) THEN 'MULTI'

                                      WHEN (br.SOURCE_LEDGER_ID IS NOT NULL) THEN 'SINGLE'

                                      ELSE 'NONE'

                                    END LEDGER_GROUP_CODE

                                    ,COALESCE(br.BALANCE_AMOUNT_BS, 'YTD') BALANCE_AMOUNT_BS

                                    ,COALESCE(br.BALANCE_AMOUNT_IS, 'PERIODIC') BALANCE_AMOUNT_IS

                                    ,br.LEDGER_GROUP

                                    ,(SELECT brd.DETAIL_CODE

                                      FROM AIF_BAL_RULE_DETAILS brd

                                      WHERE brd.RULE_ID = br.RULE_ID

                                      AND brd.DETAIL_TYPE = 'LEDGER'       

                                    ) PS_LEDGER

                                    ,CASE lg.LEDGER_TEMPLATE

                                      WHEN 'COMMITMENT' THEN 'Y'

                                      ELSE 'N'

                                    END KK_FLAG

                                    ,p.LAST_UPDATED_BY

                                    ,p.AIF_WEB_SERVICE_URL WEB_SERVICE_URL

                                    ,p.EPM_ORACLE_INSTANCE

                                    ,brl.JOURNAL_FLAG

                                    ,br.MULTI_PERIOD_FILE_FLAG

                                    ,br.IMPGROUPKEY

                                    FROM AIF_PROCESSES p

                                    INNER JOIN AIF_BAL_RULE_LOADS brl

                                      ON brl.LOADID = p.PROCESS_ID

                                    INNER JOIN AIF_BALANCE_RULES br

                                      ON br.RULE_ID = brl.RULE_ID

                                    INNER JOIN AIF_SOURCE_SYSTEMS ss

                                      ON ss.SOURCE_SYSTEM_ID = br.SOURCE_SYSTEM_ID

                                    INNER JOIN AIF_TARGET_APPLICATIONS app

                                      ON app.APPLICATION_ID = brl.APPLICATION_ID

                                    INNER JOIN TPOVPARTITION part

                                      ON part.PARTITIONKEY = br.PARTITIONKEY

                                    INNER JOIN TBHVIMPGROUP imp

                                      ON imp.IMPGROUPKEY = part.PARTIMPGROUP

                                    LEFT OUTER JOIN AIF_COA_LEDGERS l

                                      ON l.SOURCE_SYSTEM_ID = p.SOURCE_SYSTEM_ID

                                      AND l.SOURCE_LEDGER_ID = COALESCE(br.SOURCE_LEDGER_ID,imp.IMPSOURCELEDGERID)

                                    LEFT OUTER JOIN AIF_PS_SET_CNTRL_REC_STG scr

                                      ON scr.SOURCE_SYSTEM_ID = l.SOURCE_SYSTEM_ID

                                      AND scr.SETCNTRLVALUE = l.SOURCE_LEDGER_NAME

                                      AND scr.RECNAME = 'LED_GRP_TBL'

                                    LEFT OUTER JOIN AIF_PS_LED_GRP_TBL_STG lg

                                      ON lg.SOURCE_SYSTEM_ID = scr.SOURCE_SYSTEM_ID

                                      AND lg.SETID = scr.SETID

                                      AND lg.LEDGER_GROUP = br.LEDGER_GROUP

                                    WHERE p.PROCESS_ID = 1716

                                   

                            2016-01-28 14:08:23,564 DEBUG [AIF]:

                                  SELECT adim.BALANCE_COLUMN_NAME DIMNAME

                                  ,adim.DIMENSION_ID

                                  ,dim.TARGET_DIMENSION_CLASS_NAME

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID1

                                  ) COA_SEGMENT_NAME1

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID2

                                  ) COA_SEGMENT_NAME2

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID3

                                  ) COA_SEGMENT_NAME3

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID4

                                  ) COA_SEGMENT_NAME4

                                  ,(SELECT COA_SEGMENT_NAME

                                    FROM AIF_COA_SEGMENTS cs

                                    WHERE cs.COA_LINE_ID = tiie.IMPSOURCECOALINEID5

                                  ) COA_SEGMENT_NAME5

                                  ,(SELECT CASE mdd.ORPHAN_OPTION_CODE

                                      WHEN 'CHILD' THEN 'N'

                                      WHEN 'ROOT' THEN 'N'

                                      ELSE 'Y'

                                    END DIMENSION_FILTER_FLAG

                                    FROM AIF_MAP_DIM_DETAILS_V mdd

                                    ,AIF_MAPPING_RULES mr

                                    WHERE mr.PARTITIONKEY = tpp.PARTITIONKEY

                                    AND mdd.RULE_ID = mr.RULE_ID

                                    AND mdd.DIMENSION_ID = adim.DIMENSION_ID

                                  ) DIMENSION_FILTER_FLAG

                                  ,tiie.IMPCONCATCHAR

                                  FROM TPOVPARTITION tpp

                                  INNER JOIN AIF_TARGET_APPL_DIMENSIONS adim

                                    ON adim.APPLICATION_ID = 5

                                   

                                    AND adim.VALID_FOR_PLAN1 = 1

                                   

                                  INNER JOIN AIF_DIMENSIONS dim

                                    ON dim.DIMENSION_ID = adim.DIMENSION_ID

                                  LEFT OUTER JOIN TBHVIMPITEMERPI tiie

                                    ON tiie.IMPGROUPKEY = tpp.PARTIMPGROUP

                                    AND tiie.IMPFLDFIELDNAME = adim.BALANCE_COLUMN_NAME

                                    AND tiie.IMPMAPTYPE = 'ERP'

                                  WHERE tpp.PARTITIONKEY = 15

                                  AND adim.BALANCE_COLUMN_NAME IS NOT NULL

                                  AND dim.TARGET_DIMENSION_CLASS_NAME <> 'ICPTRANS'

                                  ORDER BY adim.BALANCE_COLUMN_NAME

                                 

                            2016-01-28 14:08:23,564 DEBUG [AIF]: {'APPLICATION_ID': 5L, 'IMPORT_FROM_SOURCE_FLAG': u'Y', 'PLAN_TYPE': u'PLAN1', 'RULE_NAME': u'TecLabor_TO_RSA', 'ACTUAL_FLAG': None, 'IS_INCREMENTAL_LOAD': False, 'EPM_ORACLE_INSTANCE': u'D:\\Oracle\\Middleware\\user_projects\\epmsystem2', 'CATKEY': 4L, 'BAL_SEG_VALUE_OPTION_CODE': None, 'INCLUDE_ADJ_PERIODS_FLAG': u'N', 'PERIOD_MAPPING_TYPE': u'DEFAULT', 'SOURCE_SYSTEM_TYPE': u'FILE', 'CHECK_FLAG': u'Y', 'LEDGER_GROUP': None, 'TARGET_APPLICATION_NAME': u'RSA', 'RECALCULATE_FLAG': u'Y', 'SOURCE_SYSTEM_ID': 1L, 'TEMP_DATA_TABLE_NAME': 'TDATASEG_T', 'KK_FLAG': u'N', 'IMPGROUPKEY': u'TecLabor_TO_RSA', 'AMOUNT_TYPE': u'MONETARY', 'DATA_TABLE_NAME': 'TDATASEG', 'EXPORT_TO_TARGET_FLAG': u'Y', 'JOURNAL_FLAG': None, 'DIMNAME_LIST': [u'ACCOUNT', u'ENTITY', u'UD1', u'UD2', u'UD3', u'UD4', u'UD5', u'UD6', u'UD7'], 'TDATAMAPTYPE': 'ERP', 'LAST_UPDATED_BY': u'admin', 'DIMNAME_MAP': {u'UD6': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD6', 'DIMENSION_ID': 35L}, u'UD3': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD3', 'DIMENSION_ID': 32L}, u'ENTITY': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Entity', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'ENTITY', 'DIMENSION_ID': 30L}, u'UD7': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD7', 'DIMENSION_ID': 36L}, u'UD2': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD2', 'DIMENSION_ID': 31L}, u'UD5': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD5', 'DIMENSION_ID': 34L}, u'UD4': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Generic', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD4', 'DIMENSION_ID': 33L}, u'ACCOUNT': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Account', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'ACCOUNT', 'DIMENSION_ID': 29L}, u'UD1': {'IMPCONCATCHAR': None, 'TARGET_DIMENSION_CLASS_NAME': u'Version', 'COA_SEGMENT_NAME5': None, 'COA_SEGMENT_NAME1': None, 'COA_SEGMENT_NAME2': None, 'COA_SEGMENT_NAME3': None, 'DIMENSION_FILTER_FLAG': None, 'COA_SEGMENT_NAME4': None, 'DIMNAME': u'UD1', 'DIMENSION_ID': 40L}}, 'TARGET_APPLICATION_TYPE': u'HPL', 'PARTITIONKEY': 15L, 'PARTVALGROUP': u'[NONE]', 'LEDGER_GROUP_CODE': u'NONE', 'INCLUDE_ZERO_BALANCE_FLAG': None, 'EXECUTION_MODE': u'REPLACE', 'PLAN_NUMBER': 1L, 'MULTI_PERIOD_FILE_FLAG': u'N', 'PS_LEDGER': None, 'BALANCE_SELECTION': u'FUNCTIONAL', 'BALANCE_AMOUNT_IS': u'PERIODIC', 'RULE_ID': 38L, 'BALANCE_AMOUNT_BS': u'YTD', 'CURRENCY_CODE': None, 'SOURCE_ADAPTER_FLAG': u'N', 'BALANCE_METHOD_CODE': None, 'SIGNAGE_METHOD': u'ABSOLUTE', 'WEB_SERVICE_URL': u'http://KWAWNAPPTQ138.corp.root.nasd.com:6550/aif', 'DATA_LOAD_METHOD': u'CLASSIC_VIA_EPMI'}

                            2016-01-28 14:08:23,564 DEBUG [AIF]: CommData.getRuleInfo - END

                            2016-01-28 14:08:23,564 DEBUG [AIF]:

                                UPDATE AIF_BALANCE_RULES

                                SET STATUS = CASE 'FAILED'

                                  WHEN 'SUCCESS' THEN

                                    CASE (

                                      SELECT COUNT(*)

                                      FROM AIF_PROCESS_DETAILS pd

                                      WHERE pd.PROCESS_ID = 1716

                                      AND pd.STATUS IN ('FAILED','WARNING')

                                    )

                                    WHEN 0 THEN 'SUCCESS'

                                    ELSE (

                                      SELECT MIN(pd.STATUS)

                                      FROM AIF_PROCESS_DETAILS pd

                                      WHERE pd.PROCESS_ID = 1716

                                      AND pd.STATUS IN ('FAILED','WARNING')

                                    )

                                    END

                                  ELSE 'FAILED'

                                END

                                WHERE RULE_ID = 38

                               

                            2016-01-28 14:08:23,564 DEBUG [AIF]: CommData.updateRuleStatus - END

                            2016-01-28 14:08:23,579 FATAL [AIF]: Error in Launch GL Load Balances Data

                            2016-01-28 14:08:23,579 DEBUG [AIF]: Comm.updateProcess - START

                            2016-01-28 14:08:23,579 DEBUG [AIF]: Comm.updateProcess - END

                            2016-01-28 14:08:23,579 INFO  [AIF]: FDMEE Process End, Process ID: 1716

                            • 11. Re: Jython Script to Remove Quotes
                              user9510887

                              FYI..The log attached is from using the script as a befimport event script and executing via batch execution.

                              • 12. Re: Jython Script to Remove Quotes
                                Ankit13

                                The error here tells me it has a problem with folder created here:

                                2016-01-28 14:08:23,158 INFO  [AIF]: D:/FDMEE\inbox\batches\openbatch\TecLabor_TO_RSA\TecLabor_TO_RSA\R~TecLabor_TO_RSA~Jan-2017~RR.txt

                                2016-01-28 14:08:23,158 ERROR [AIF]: My error[Errno 2] ENOENT: 'D:/FDMEE\\inbox\\batches\\openbatch\\TecLabor_TO_RSA\\TecLabor_TO_RSA\\R~TecLabor_TO_RSA~Jan-2017~RR.txt'

                                2016-01-28 14:08:23,158 ERROR [AIF]: The script has failed to execute

                                 

                                Instead of putting the whole path just give the folder name in Open Batch Directory . For you it should be "TecLabor_TO_RSA"

                                • 13. Re: Jython Script to Remove Quotes
                                  user9510887

                                  okay.

                                   

                                  I changed the script to this, so it just has the folder name:

                                   

                                            file = inbox + "\\TecLabor_TO_RSA\\" + filename

                                            file_out = inbox + "\\TecLabor_TO_RSA\\" + filename + ".out"

                                   

                                  I still get this error.

                                   

                                  2016-01-28 14:50:11,125 INFO  [AIF]: Executing the following script: D:/FDMEE/data/scripts/event/BefImport.py

                                  2016-01-28 14:50:11,125 INFO  [AIF]: TecLabor_TO_RSA

                                  2016-01-28 14:50:11,125 INFO  [AIF]: R~TecLabor_TO_RSA~Jan-2017~RR.txt

                                  2016-01-28 14:50:11,125 INFO  [AIF]: D:/FDMEE\inbox

                                  2016-01-28 14:50:11,125 INFO  [AIF]: D:/FDMEE\inbox\TecLabor_TO_RSA\R~TecLabor_TO_RSA~Jan-2017~RR.txt

                                  2016-01-28 14:50:11,125 ERROR [AIF]: My error[Errno 2] ENOENT: 'D:/FDMEE\\inbox\\TecLabor_TO_RSA\\R~TecLabor_TO_RSA~Jan-2017~RR.txt'

                                  2016-01-28 14:50:11,125 ERROR [AIF]: The script has failed to execute:

                                  2016-01-28 14:50:11,500 DEBUG [AIF]: Comm.finalizeProcess - START

                                  2016-01-28 14:50:11,500 DEBUG [AIF]: CommData.updateRuleStatus -

                                   

                                  I think I had the script this way originally and this worked when I manually selected the file.  But for a batch, D:/FDMEE\inbox\TecLabor_TO_RSA\R~TecLabor_TO_RSA~Jan-2017~RR.txt is not the correct path.  The file actually sits here: D:\FDMEE\inbox\batches\openbatch\TecLabor_TO_RSA\TecLabor_TO_RSA\R~TecLabor_TO_RSA~Jan-2017~RR.txt.  This is why I put the full path in.

                                  • 14. Re: Jython Script to Remove Quotes
                                    Ankit13

                                    Sorry about the confusion but you didn't have to change anything but the open directory path.

                                     

                                    Keep the script same as before and make your you have open directory as "TecLabor_TO_RSA". It knows the open batch path so you just need to give it the folder name where you put the file.

                                     

                                    Thanks

                                    Ankit

                                    1 2 Previous Next