3 Replies Latest reply on May 14, 2015 3:40 PM by GameRooster

    Case Sensitivity In Datamaps

    GameRooster

      Hi All,

       

      Running into some issues with case sensitivity in datamaps in FDMEE.

       

      I'd like to change the incoming source data to all upper case during the before import even using Jython.

       

      Tried this (loosely based on the admin guide):

       

      infilename = fdmContext["INBOXDIR"]+fdmContext["FILENAME"]
      outfilename = fdmContext["INBOXDIR"]+"/DataFile.txt"

      infile = open(infilename, "r")
      outfile = open(outfilename, "w")

      for line in infile:
          outfile.write(line.upper())

      outfile.close()
      fdmContext["FILENAME"] = "DataFile.txt"

       

      .... but it bombs out at the infile = open(infilename, "r") step.

       

      Do I need to do something special to get file i/o working?

      Is there a better approach to deal with 100s of source files in different formats who need all their data converted to upper?

        • 1. Re: Case Sensitivity In Datamaps
          GameRooster

          Let me amend this. I've got the conversion and parsing out to a new file sorted out in the Before file Import script.

           

          However, the issue now is that I cannot figure out how to change the file name that the import is using.

           

          * there's no API call to update file name in fdmAPI

          * setting fdmcontext("filename") does not change the file actually loaded

          * writing a sequel statement in the script to update the AIF_BAL_RULE_LOADS.FILE_NAME_STATIC to the new filename didn't affect the load

          * removing the initial load file and renaming the new file to the original name doesn't work, I can't remove FDMEE's lock on it

           

          Any ideas?

          • 2. Re: Case Sensitivity In Datamaps
            Francisco Amores

            Hi,

             

            Why would you need to convert to upper case the file?

            is SQL Server or Oracle Database?

             

            Also, for your second post. I would suggest not to think about changing the file name for the import file.

            basically when you have any requirement where you need to run some process in the source file you would act as:

             

            1. Create a backup of your original file (basically rename it)  Ex: your original file is TEST.txt, then you rename to TEST.orig

            2. Create a new file with your original source file name. Ex: create new file TEST.txt

            3. Read the content of file renamed in step 1, process/parse/whatever, and write into the file created in step2

             

            then you already have your new data in a file with the original name which will be imported.

             

            i hope that helps.

            • 3. Re: Case Sensitivity In Datamaps
              GameRooster

              Had to upper case the input due to the volume of mappings. Update upper(SRCKEY) and converting the input members to upper are much more efficient than recreating all the maps.