User Variable Activities in series
Posted: Thu Jul 14, 2005 8:09 am
Hello,
Does anyone know how DataStage executes a series of User Variable Activities (UVAs)?
I'm having a problem wherein a series of three UVAs do not produce the same output values to a subsequent Job Activity from run to run. The first UVA loads some environmental variables via $PROJDEF and then overrides them if the appropriate job parameter is set. For instance the expression for the user variable SOURCE_FILE might be:
The resulting value for SOURCE_FILE is then passed to a second UVA, where it is used to set another user variable EFF_RUN_DATE, e.g.:
Then, finally, EFF_RUN_DATE is passed to a third UVA to set yet another user variable, OUTPUT_FILE, e.g:
The last UVA triggers a Job Activity. The problem is that sometimes, it doesn't seem like all of the user variables from the preceeding UVAs are set before the job is triggered. I can see (through a Notification Activity) that the environmental ($) values aren't always being loaded. In other words, it looks like all the user variables in one UVA aren't necessarily set before the next UVA in the series kicks off. Anyone know if this is true?
One workaround that seems to work is to put in a "sleep" Execute Command activity, or a Wait-for-NonExistent-File Activity between the last UVA and the Job Activity. Apparently this will force all the UVAs to finish, and for my sequences it seems like I have to introduce a wait of about 15 seconds to be safe. But I hate to use a kludge like that. Any other ideas on this subject?
Thanks,
Tim
Does anyone know how DataStage executes a series of User Variable Activities (UVAs)?
I'm having a problem wherein a series of three UVAs do not produce the same output values to a subsequent Job Activity from run to run. The first UVA loads some environmental variables via $PROJDEF and then overrides them if the appropriate job parameter is set. For instance the expression for the user variable SOURCE_FILE might be:
Code: Select all
If ( IsNull(ALT_SOURCE_FILE) Or (Len(Trim(ALT_SOURCE_FILE)) < 1) ) Then $Default_Source_File Else Trim(ALT_SOURCE_FILE)
Code: Select all
If ( IsNull(ALT_RUN_DATE) Or (Len(Trim(ALT_RUN_DATE)) < 1) ) Then CustomDateRoutine(FirstUVA.SOURCE_FILE) Else Trim(ALT_RUN_DATE)
Code: Select all
If ( IsNull(ALT_OUT_FILE) Or (Len(Trim(ALT_OUT_FILE)) < 1) ) Then $Default_Output_File_Dir:"/":SecondUVA.EFF_RUN_DATE:".ds" Else Trim(ALT_OUT_FILE)
One workaround that seems to work is to put in a "sleep" Execute Command activity, or a Wait-for-NonExistent-File Activity between the last UVA and the Job Activity. Apparently this will force all the UVAs to finish, and for my sequences it seems like I have to introduce a wait of about 15 seconds to be safe. But I hate to use a kludge like that. Any other ideas on this subject?
Thanks,
Tim