I have a little script in jython in one of my procedures that loop over all files in a target directory and read a line for each file inside it with a name mask and create a new csv file with all these records. I execute this code with jython-standalone.jar and works fine. When I run it from ODI Studio (12c) The result show an ok icon but I did't see the new file like if the script doesn't run.
I opened Odi64.exe with admin privileges and set all permissions allowed in the folders. I am using windows and I don't know what I can look to make this work.
My procedure have one task with Target Command, Global Context and Target Technology set to Jython.
Transaction is setted to "Autocommit" and my Logical Scheme is setted to "ENTRY_DIRECTORY" (Logical Architecture of Type File) pointing to a Physical Architecture of type File that it's pointing to this directory:
/apps/dataflow/nas (in options 'Schema' and 'Work Schema')
This is the script code:
# encoding: utf-8
import os
import csv
WORK_FOLDER = "C:/apps/dataflow/nas/work/"
#Extraemos prefijo y sufijo del fichero a procesar
splitted_value = FILE_NAME.split("*")
prefix = splitted_value[0]
suffix = splitted_value[1]
ubicIdList=open(WORK_FOLDER + 'list_ubics.csv','w')
#Creamos un dialecto para especificar el delimitador ya que por defecto es ,
csv.register_dialect('myDialect', delimiter = ';')
#Obtenemos listado de ficheros y los escribimos en el csv auxiliar si cumplen las condiciones
files = os.listdir(WORK_FOLDER)
for line in files:
if line.find(prefix) >= 0 and line.find(suffix) > 0:
#Por cada linea abrimos el fichero que representa y extraemos el campo número 12 (UBIC) (Nos saltamos líneas en blanco)
if len(line.rstrip('\n')) > 0:
with open(WORK_FOLDER + line.rstrip('\n'), 'r') as f:
reader = csv.reader(f, dialect='myDialect')
for row in reader:
#Filtramos las líneas HEADER y FOOTER
if row[0] != "HEADER" and row[0] != "FOOTER":
#Guardamos el ID Ubic de la línea en cuestión en el fichero de ubicaciones
ubic_id = row[12]
if len(ubic_id) > 0:
print(ubic_id)
ubicIdList.write(ubic_id+'\n')
ubicIdList.close()
I tried some simple scripts (creating an text file with a word inside) and so on, but not works and my Operator sessions list keep showing green icon like if this was working. I tried prints sentences too but none get logged or I don't know where search this type of logs.
Thanks in advance for any help.