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