Missing parameters
Posted: Mon Aug 11, 2003 5:29 am
DataStage version6 - windows 2000
I have written a DSBasic job to validate a file and then follow the following if logic (basic logic not taken verbatim from code):
If failed
run hFailReport
Else
run hMerge
If 100% success
run hCleanReport
Else
run hOKReport
I have tested this code where hCleanReport runs fine. Am now testing hFailreport but the job fails with: "SEL060ReportFailedFile: Missing Parameters pFailPercentage". Both hCleanReport and hFailReport both have the same parameters which are successfully displayed in the log immediately prior to running the jobs. Neither myself nor my colleagues can find why this fales. As per usual, any assistance greatly appreciated - my code for running these jobs is below:
hFailReport = DSAttachJob("SEL060ReportFailedFile", DSJ.ERRFATAL)
If NOT(hFailReport) Then
Call DSLogFatal("Job Attach failed: SEL060ReportFailedFile", "SEL020ManageFileValidationAndLoad")
Abort
End
ErrCode = DSSetParam(hFailReport, "pInputPath", pInputPath)
ErrCode = DSSetParam(hFailReport, "pInputFile", Trim(ListRow))
ErrCode = DSSetParam(hFailReport, "pThreshold", pThreshold)
ErrCode = DSSetParam(hFailReport, "pRecordCount", svRecordCount)
ErrCode = DSSetParam(hFailReport, "pRecordsInError", svRecordsInError)
ErrCode = DSSetParam(hFailReport, "pFailPercentage", svFailPercentage)
ErrCode = DSSetParam(hFailReport, "pOutputPath", pOutputPath)
ErrCode = DSSetParam(hFailReport, "pOutputFile", pOutputFile)
ErrCode = DSRunJob(hFailReport, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hFailReport)
svStatus = DSGetJobInfo(hFailReport, DSJ.JOBSTATUS)
If svStatus = DSJS.RUNFAILED OR svStatus = DSJS.CRASHED Then
Call DSLogFatal("Job Failed: SEL060ReportFailedFile", "SEL020ManageFileValidationAndLoad")
End
AND.........................................................
hOKReport = DSAttachJob("SEL050ReportAcceptableFile", DSJ.ERRFATAL)
If NOT(hOKReport) Then
Call DSLogFatal("Job Attach failed: SEL050ReportAcceptableFile", "SEL020ManageFileValidationAndLoad")
Abort
End
ErrCode = DSSetParam(hOKReport, "pInputPath", pInputPath)
ErrCode = DSSetParam(hOKReport, "pInputFile", Trim(ListRow))
ErrCode = DSSetParam(hOKReport, "pThreshold", pThreshold)
ErrCode = DSSetParam(hOKReport, "pRecordCount", svRecordCount)
ErrCode = DSSetParam(hOKReport, "pRecordsInError", svRecordsInError)
ErrCode = DSSetParam(hOKReport, "pFailPercentage", svFailPercentage)
ErrCode = DSSetParam(hOKReport, "pOutputPath", pOutputPath)
ErrCode = DSSetParam(hOKReport, "pOutputFile", pOutputFile)
ErrCode = DSRunJob(hOKReport, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hOKReport)
svStatus = DSGetJobInfo(hOKReport, DSJ.JOBSTATUS)
If svStatus = DSJS.RUNFAILED OR svStatus = DSJS.CRASHED Then
Call DSLogFatal("Job Failed: SEL050ReportAcceptableFile", "SEL020ManageFileValidationAndLoad")
End
I have written a DSBasic job to validate a file and then follow the following if logic (basic logic not taken verbatim from code):
If failed
run hFailReport
Else
run hMerge
If 100% success
run hCleanReport
Else
run hOKReport
I have tested this code where hCleanReport runs fine. Am now testing hFailreport but the job fails with: "SEL060ReportFailedFile: Missing Parameters pFailPercentage". Both hCleanReport and hFailReport both have the same parameters which are successfully displayed in the log immediately prior to running the jobs. Neither myself nor my colleagues can find why this fales. As per usual, any assistance greatly appreciated - my code for running these jobs is below:
hFailReport = DSAttachJob("SEL060ReportFailedFile", DSJ.ERRFATAL)
If NOT(hFailReport) Then
Call DSLogFatal("Job Attach failed: SEL060ReportFailedFile", "SEL020ManageFileValidationAndLoad")
Abort
End
ErrCode = DSSetParam(hFailReport, "pInputPath", pInputPath)
ErrCode = DSSetParam(hFailReport, "pInputFile", Trim(ListRow))
ErrCode = DSSetParam(hFailReport, "pThreshold", pThreshold)
ErrCode = DSSetParam(hFailReport, "pRecordCount", svRecordCount)
ErrCode = DSSetParam(hFailReport, "pRecordsInError", svRecordsInError)
ErrCode = DSSetParam(hFailReport, "pFailPercentage", svFailPercentage)
ErrCode = DSSetParam(hFailReport, "pOutputPath", pOutputPath)
ErrCode = DSSetParam(hFailReport, "pOutputFile", pOutputFile)
ErrCode = DSRunJob(hFailReport, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hFailReport)
svStatus = DSGetJobInfo(hFailReport, DSJ.JOBSTATUS)
If svStatus = DSJS.RUNFAILED OR svStatus = DSJS.CRASHED Then
Call DSLogFatal("Job Failed: SEL060ReportFailedFile", "SEL020ManageFileValidationAndLoad")
End
AND.........................................................
hOKReport = DSAttachJob("SEL050ReportAcceptableFile", DSJ.ERRFATAL)
If NOT(hOKReport) Then
Call DSLogFatal("Job Attach failed: SEL050ReportAcceptableFile", "SEL020ManageFileValidationAndLoad")
Abort
End
ErrCode = DSSetParam(hOKReport, "pInputPath", pInputPath)
ErrCode = DSSetParam(hOKReport, "pInputFile", Trim(ListRow))
ErrCode = DSSetParam(hOKReport, "pThreshold", pThreshold)
ErrCode = DSSetParam(hOKReport, "pRecordCount", svRecordCount)
ErrCode = DSSetParam(hOKReport, "pRecordsInError", svRecordsInError)
ErrCode = DSSetParam(hOKReport, "pFailPercentage", svFailPercentage)
ErrCode = DSSetParam(hOKReport, "pOutputPath", pOutputPath)
ErrCode = DSSetParam(hOKReport, "pOutputFile", pOutputFile)
ErrCode = DSRunJob(hOKReport, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hOKReport)
svStatus = DSGetJobInfo(hOKReport, DSJ.JOBSTATUS)
If svStatus = DSJS.RUNFAILED OR svStatus = DSJS.CRASHED Then
Call DSLogFatal("Job Failed: SEL050ReportAcceptableFile", "SEL020ManageFileValidationAndLoad")
End