In ODI value of the variable is calculated at the run time but not shown in the operator.
Please find this ODI procedure using Jython to show the value of the Variable.
Create an ODI Procedure and Insert an option called “VAR” and give the default as
<%=odiRef.getPrevStepLog("STEP_NAME")%> , reason being so that by default when using this procedure after the variable, ODI automatically takes the name and throws the variable value in Operator .
Create another Option called “PROJECT” and give the default value as your project code. The reason i have created an option for Project code is that so that you can modify in the option without any need for change in code also you can use for global variables too.
Step 2 .
Add an option in the ODI procedure and give the technology – Jython and check “ Ignore Errors “ and paste the following code
raise ‘ n THE VALUE OF THE VARIABLE <%=odiRef.getOption("VAR")%> IS – <%=#odiRef.getOption("PROJECT")%>.<%=odiRef.getOption("VAR")%> ‘
make sure that everything inside the raise command have single quotes before and after .
Lets test this Procedure.
and for Jython is
This above example shows that i want to find the value of variable of variable other than the previous step , just change the var value to that name of the required variable.
hope this helps who are looking for a way to know the value of the variable at run time.
For global variables you don’t need to mention the project code. Just type ‘GLOBAL’ instead of the project code.
Please find below the codes ,download and all you would need to do is to change your default project codes in the option from XMT to whatever desired and you can make any kind of changes desired.
Just import in an Insert_Update mode and change the project code to your default.
VALUE OF VARIABLE – JYTHON