How do we read parameters from file and where do we store the parameter file and which format the file is stored.
we have used the routine to read from the parameter file but,the value of the parameter is not being retreived from the file .
The path of the file and name is
e:\Ascential\DataStage\Projects\MYPROJ\DSParams
we have given Job name ,Parametername and path of the file as arguments.
The code is as follows
Code: Select all
ParamFile = ParameterFileName
Var = 0
OpenSeq ParamFile To FileVar Else
Call DSLogFatal("Cannot open ":ParamFile: "- Aborting Job", "ParameterRoutine")
Ans = @Null
GoTo ErrorExit
End
Loop
ReadSeq FileLine From FileVar
Then
If Var = 1 Or TrimF(TrimB(Field(EReplace(FileLine, '[',""),']',1))) = TrimF(TrimB(JobName))
Then
Var = 1
If Var = 1 And TrimF(TrimB(Field(FileLine,"=",1))) = TrimF(TrimB(ParameterName))
Then
Ans = TrimF(TrimB(Field(FileLine,"=",2)))
GoTo MatchFound
End Else
Ans = @Null
End
End Else
Ans = @Null
End
End Else
Exit
End
Repeat
MatchFound:
CloseSeq FileVar
ErrorExit: