DSSetParam Function error
Posted: Fri Jun 16, 2006 1:31 pm
Hi,
My whole idea behind this before job routine is to read values from a seq file and pass these values into Job Parameter.After doing some R&D and searching forum i written the following code.when i complie the code its not throwing any error,but when i try to run job using this routine the job is in run mode only ,i mean job is not processing any rows or it wont abort.
Any Sugeestion would be great full
Here is the code :
$INCLUDE DSINCLUDE DSD_STAGE.H
$INCLUDE DSINCLUDE JOBCONTROL.H
* $INCLUDE DSINCLUDE DSD.H
ParameterFile =InputArg
IntialCount = 0
Counter = 0
OpenSeq ParameterFile To ParameterFileVar
On Error
Msg = 'Error opening parameters file, ' : SQuote(ParameterFile): ', status = ' : Status()
Call DSLogFatal(Msg, TransformName )
Abort
End
Else
Msg = 'Cannot open parameters file, ' : SQuote(ParameterFile): ', status = ' : Status()
Call DSLogFatal(Msg, TransformName )
Abort
End
*----------------------------------------------------------------------------
* File Opened
* Read the parameter list from the file.
*----------------------------------------------------------------------------
Loop
ReadSeq Line From ParameterFileVar
On Error
Msg = 'Cannot read parameters file, ' : SQuote(ParameterFile): ', status = ' : Status()
Call DSLogwarn(Msg, TransformName )
End
Then
Counter += 1
End
if Counter = Line
Then
Exit
End
Repeat
ParamValue = Line
CloseSeq ParameterFileVar
JobHandle = DSAttachJob(Party_Test, DSJ.ERRFATAL)
ErrCode = DSSetParam(JobHandle,"FileName",ParamValue)
Thanks,
Hary
My whole idea behind this before job routine is to read values from a seq file and pass these values into Job Parameter.After doing some R&D and searching forum i written the following code.when i complie the code its not throwing any error,but when i try to run job using this routine the job is in run mode only ,i mean job is not processing any rows or it wont abort.
Any Sugeestion would be great full
Here is the code :
$INCLUDE DSINCLUDE DSD_STAGE.H
$INCLUDE DSINCLUDE JOBCONTROL.H
* $INCLUDE DSINCLUDE DSD.H
ParameterFile =InputArg
IntialCount = 0
Counter = 0
OpenSeq ParameterFile To ParameterFileVar
On Error
Msg = 'Error opening parameters file, ' : SQuote(ParameterFile): ', status = ' : Status()
Call DSLogFatal(Msg, TransformName )
Abort
End
Else
Msg = 'Cannot open parameters file, ' : SQuote(ParameterFile): ', status = ' : Status()
Call DSLogFatal(Msg, TransformName )
Abort
End
*----------------------------------------------------------------------------
* File Opened
* Read the parameter list from the file.
*----------------------------------------------------------------------------
Loop
ReadSeq Line From ParameterFileVar
On Error
Msg = 'Cannot read parameters file, ' : SQuote(ParameterFile): ', status = ' : Status()
Call DSLogwarn(Msg, TransformName )
End
Then
Counter += 1
End
if Counter = Line
Then
Exit
End
Repeat
ParamValue = Line
CloseSeq ParameterFileVar
JobHandle = DSAttachJob(Party_Test, DSJ.ERRFATAL)
ErrCode = DSSetParam(JobHandle,"FileName",ParamValue)
Thanks,
Hary