While compiling the main job ,It throws me Errors based on parameter,
Can anyone have an Idea regarding this?'$' unexpected, Was expecting: ')', ','
0271 ErrCode = DSSetParam(hJob5, "$OracleUser", $OracleUser)
Thanks in Advance..
Moderators: chulett, rschirm, roy
Can anyone have an Idea regarding this?'$' unexpected, Was expecting: ')', ','
0271 ErrCode = DSSetParam(hJob5, "$OracleUser", $OracleUser)
I am using the following Code to call the batch jobs assciated with the main job,chulett wrote:Why are you trying to 'set' a job parameter that's actually an environment variable? There's no need to do that as it will automatically pick it up from the... well... environment. ...
Code: Select all
JobName1= "LOAD_TEST_TABLE"
Call DSLogInfo("Validating ":JobName1:".done", ThisJobName)
* Call DSU.UtilityHashLookupGR( RunTime,HashFile, JobName1,1)
* Call DSLogInfo(JobName1:" Run Time:":RunTime, ThisJobName)
Call DSExecute("UNIX", $pShellScript:"isfilethere.ksh ":$DoneFileDir:" ":JobName1:".done" , Output, SystemReturnCode)
If (SystemReturnCode <> 0) Then
Call DSLogInfo("File ":JobName1:".done is not present", ThisJobName)
Call DSLogInfo("Resetting Jobs", ThisJobName)
hJob1 = DSAttachJob(JobName1, DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: ":JobName1, "JobControl")
Abort
End
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
ErrCode = DSRunJob(hJob1, DSJ.RUNRESET)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: ":JobName1, "JobControl")
End
End
* Setup JobName1, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob(JobName1, DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: ":JobName1, "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "$DSDir", $DSDir)
ErrCode = DSSetParam(hJob1, "$OracleUser", $OracleUser)
ErrCode = DSSetParam(hJob1, "$OracleRemote", $OracleRemote)
ErrCode = DSSetParam(hJob1, "$OraclePwd", $OraclePwd)
ErrCode = DSSetDisableProjectHandler(hJob1, @FALSE)
ErrCode = DSSetDisableJobHandler(hJob1, @FALSE)
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Or Status = DSJS.STOPPED Then
* Fatal Error - No Return
* Reply = grSendMail(JobName1,abort)
Call DSLogFatal("Job Failed: ":JobName1, "JobControl")
End
Call DSExecute("UNIX", "touch ":$DoneFileDir:JobName1:".done" , Output, SystemReturnCode)
If (SystemReturnCode <> 0) Then
Call DSLogFatal("FAILED- Touch ":JobName1:".done",ThisJobName)
End
End
Else
Call DSLogInfo(JobName1:" ALREADY FINISHED...", ThisJobName)
End
Code: Select all
ErrCode = DSSetParam(hJob1, "$DSDir", $DSDir)
ErrCode = DSSetParam(hJob1, "$OracleUser", $OracleUser)
ErrCode = DSSetParam(hJob1, "$OracleRemote", $OracleRemote)
ErrCode = DSSetParam(hJob1, "$OraclePwd", $OraclePwd)
chulett wrote:Still... all this... completely unnecessary:
Code: Select all
ErrCode = DSSetParam(hJob1, "$DSDir", $DSDir) ErrCode = DSSetParam(hJob1, "$OracleUser", $Ora ...[/quote] Then how can we mention the Parameters and the defaults? Is there any other options for referring the Parameters in Job C ontrol. The above mentioned CODE is a templete that we used in our whole project. :roll: :?:
As you mean, there is no need to mention the parameter in this Code?? Then in what situation DSsetparam is used?chulett wrote:I wouldn't be quibbling if you were overriding their value. As noted, there's no reason to set any variable to its default value, especially an environment variable that will automatically get its value from the environment without any help from you. That's what they do.