Missing parameters
Moderators: chulett, rschirm, roy
Missing parameters
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
Hi,
First check you didn't, by any chance, miss a parameter setting! due to an update on your job.
In case you have all the needed parameters:
Just bare in mind the simple fact that your ErrCode should be set on each DSSetParam !!!
so you need to check after each and every parameter-set for the returning value and in case it is not 0 (zero) check the help for return code generated by the DSSetParam.
this will first of all get you syncronized on the real problematic parameter.
I do beleive that you'll find the problem after you get the exact point in which your problem resides [:)]
Good Luck,
Roy R.
First check you didn't, by any chance, miss a parameter setting! due to an update on your job.
In case you have all the needed parameters:
Just bare in mind the simple fact that your ErrCode should be set on each DSSetParam !!!
so you need to check after each and every parameter-set for the returning value and in case it is not 0 (zero) check the help for return code generated by the DSSetParam.
this will first of all get you syncronized on the real problematic parameter.
I do beleive that you'll find the problem after you get the exact point in which your problem resides [:)]
Good Luck,
Roy R.
Roy,
Thanks for the tip. Have tested the ErrCode for each parameter and the pFailPercentage has a code of -4. Do you know what this means or point me to where I can find out? The only thing that worries me is, as I said before, I write all the paramneters to the log and they all appear to be populated correctly, immediately before running the job. The only thing that I can think of that may be relevant is the pFailPercentage parameter has a type of 'Float' in the job being called - don't know if DS has a problem handling these.
Cheers
John
Thanks for the tip. Have tested the ErrCode for each parameter and the pFailPercentage has a code of -4. Do you know what this means or point me to where I can find out? The only thing that worries me is, as I said before, I write all the paramneters to the log and they all appear to be populated correctly, immediately before running the job. The only thing that I can think of that may be relevant is the pFailPercentage parameter has a type of 'Float' in the job being called - don't know if DS has a problem handling these.
Cheers
John
Thanks Roy and Michael,
Roy, I have run the job to display the BADHANDLE and it returned -1. Again, have no idea what this means.
Michael, the value for svFailPercentage is calculated prior to running these jobs and is not set via parameter or constant anywhere. The value for the working job is 0 and the value for the failing job is 10.0784 (and as mentioned above this parameter in the job being called is of type 'Float').
Cheers
John
Roy, I have run the job to display the BADHANDLE and it returned -1. Again, have no idea what this means.
Michael, the value for svFailPercentage is calculated prior to running these jobs and is not set via parameter or constant anywhere. The value for the working job is 0 and the value for the failing job is 10.0784 (and as mentioned above this parameter in the job being called is of type 'Float').
Cheers
John
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DSJE.BADVALUE usually means that a value that is inappropriate for the parameter. For example, if the parameter is an Integer, then a value of 10.0784 would be illegal. But it should be perfectly OK for a parameter of type Float.
Can you check in code that DataStage really believes that this parameter is of that type? Use DSGetParamInfo with an InfoType argument of DSJ.PARAMTYPE; it should return DSJ.PARAMTYPE.FLOAT (the actual value of which is 3 - look in DSINCLUDE/JOBCONTROL.H).
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Can you check in code that DataStage really believes that this parameter is of that type? Use DSGetParamInfo with an InfoType argument of DSJ.PARAMTYPE; it should return DSJ.PARAMTYPE.FLOAT (the actual value of which is 3 - look in DSINCLUDE/JOBCONTROL.H).
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Thanks Ray,
Have checked the parameter and it returns 3 so I will take it from your last post that it is setup OK.
I did however stumble across something of concern: the displays imediately prior to setting up the parameters and running the job display all the information fine, but when I checked the log of the calling job where it displays the parameters passed to the called job, it misses the pFailPercentage parameter (jumps straight from pRecordsInError to pOutputPath) - is this relevant or just as a result of this problem?
The called job's log lists the first five parameters (down to pRecordsInError) only
Have checked the parameter and it returns 3 so I will take it from your last post that it is setup OK.
I did however stumble across something of concern: the displays imediately prior to setting up the parameters and running the job display all the information fine, but when I checked the log of the calling job where it displays the parameters passed to the called job, it misses the pFailPercentage parameter (jumps straight from pRecordsInError to pOutputPath) - is this relevant or just as a result of this problem?
The called job's log lists the first five parameters (down to pRecordsInError) only
Hi,
well if there was no error setting this parameter then it is strange indeed (means that after the DSSetParam(...) ErrorCode was 0).
but if there is a missmatch in the name of the param you are setting and the actual name of the parameter in the job it is the reason your job log would show no real value for this parameter if it has no defaul value.
Hope This Helps,
Roy R.
well if there was no error setting this parameter then it is strange indeed (means that after the DSSetParam(...) ErrorCode was 0).
but if there is a missmatch in the name of the param you are setting and the actual name of the parameter in the job it is the reason your job log would show no real value for this parameter if it has no defaul value.
Hope This Helps,
Roy R.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 39
- Joined: Tue May 20, 2003 3:36 am
- Location: Singapore
John,
Just out of curiosity, have you tried running job SEL060ReportFailedFile alone? Pls try to trigger it and supply the parameters manually - don't forget to set pFailPercentage to 10.0784 - and let us know what happens.
If the job runs successfully, try to re-add SEL060ReportFailedFile into the job control script of the Batch job and check the spelling of the parameters from the generated control script.
regards,
vladimir
Just out of curiosity, have you tried running job SEL060ReportFailedFile alone? Pls try to trigger it and supply the parameters manually - don't forget to set pFailPercentage to 10.0784 - and let us know what happens.
If the job runs successfully, try to re-add SEL060ReportFailedFile into the job control script of the Batch job and check the spelling of the parameters from the generated control script.
regards,
vladimir
Hi Guys,
Sorry it's taken me a while to get around to trying out your suggestions (been a bit busy), but here are the results:
Have had a number of people go over the spelling and order of the parameters and everything seems to be OK;
ErrCode and BADHAndles as above;
Have run the job by itself manually inputting the parameters and it works fine.
Deleted it from the job control and retyped the whole section of code back into the job control and it failed again (same error). From within the job control script I tried forcing values into the parameter before calling the job and it worked fine (the values I used were: 10 and 12.45).
Ray, just a note from your last post re setting up default values: The jobs being called contain some parameters (including pfailPercentage) that are not used anywhere else and are populated by the job control of the calling program. Therefore I have not put them in as parameters on the sequence (then I would not be able to populated them myself). So I didn't set any defaults, I just forced a value into the field in the job control. I am not sure that this is relevant, but thought I had better mention it anyway.
Is there a problem with the calculated value having four decimal places? As mentioend above, when I forced a value of 12.45 it worked OK. If this may be an issue, how do you set a variable within job control to two decimal places?
I am totally confused on this one but very much appreciated the assistance everyone has provided. If you want me to give you more information about the job or the sequence as a whole, ask and you shall receive!
Sorry it's taken me a while to get around to trying out your suggestions (been a bit busy), but here are the results:
Have had a number of people go over the spelling and order of the parameters and everything seems to be OK;
ErrCode and BADHAndles as above;
Have run the job by itself manually inputting the parameters and it works fine.
Deleted it from the job control and retyped the whole section of code back into the job control and it failed again (same error). From within the job control script I tried forcing values into the parameter before calling the job and it worked fine (the values I used were: 10 and 12.45).
Ray, just a note from your last post re setting up default values: The jobs being called contain some parameters (including pfailPercentage) that are not used anywhere else and are populated by the job control of the calling program. Therefore I have not put them in as parameters on the sequence (then I would not be able to populated them myself). So I didn't set any defaults, I just forced a value into the field in the job control. I am not sure that this is relevant, but thought I had better mention it anyway.
Is there a problem with the calculated value having four decimal places? As mentioend above, when I forced a value of 12.45 it worked OK. If this may be an issue, how do you set a variable within job control to two decimal places?
I am totally confused on this one but very much appreciated the assistance everyone has provided. If you want me to give you more information about the job or the sequence as a whole, ask and you shall receive!