job control hard coded
Posted: Wed Jan 05, 2005 12:26 pm
hi,
Some one has written this code in Job Control in Datastage
Can u please advice wht can be best procedure to follow this.
Thanks,
Bobby
* Setup SAPimportParentDIST, run it, wait for it to finish, and test for success
hJob2 = DSAttachJob("SAPimportParentDIST", DSJ.ERRWARN)
If NOT(hJob2) Then
* Call DSLogFatal("Job Attach Failed: SAPimportParentDIST", "JobControl")
Call DSLogWarn("Job Attach Failed: SAPimportParentDIST", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob2, "myPath", "/datastage01/Ascential/DataStage/Projects/SAP_EQT/FilesIn/Distributor/")
ErrCode = DSRunJob(hJob2, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob2)
Status = DSGetJobInfo(hJob2, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: SAPimportParentDIST", "JobControl")
End
* Setup SAPimportParentAGENT, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob("SAPimportParentAGENT", DSJ.ERRWARN)
If NOT(hJob1) Then
* Call DSLogFatal("Job Attach Failed: SAPimportParentAGENT", "JobControl")
Call DSLogWarn("Job Attach Failed: SAPimportParentAGENT", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "myPath", "/datastage01/Ascential/DataStage/Projects/SAP_EQT/FilesIn/Agents/")
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: SAPimportParentAGENT", "JobControl")
End
* Setup ManufactJobMasterBDY, run it, wait for it to finish, and test for success
hJob3 = DSAttachJob("ManufactJobMasterBDY", DSJ.ERRWARN)
If NOT(hJob3) Then
* Call DSLogFatal("Job Attach Failed: ManufactJobMasterBDY", "JobControl")
Call DSLogWarn("Job Attach Failed: ManufactJobMasterBDY", "JobControl")
Abort
End
ErrCode = DSRunJob(hJob3, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob3)
Status = DSGetJobInfo(hJob3, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: ManufactJobMasterBDY", "JobControl")
End
* Setup ManufactJobMaster, run it, wait for it to finish, and test for success
hJob4 = DSAttachJob("ManufactJobMaster", DSJ.ERRWARN)
If NOT(hJob4) Then
* Call DSLogFatal("Job Attach Failed: ManufactJobMaster", "JobControl")
Call DSLogWarn("Job Attach Failed: ManufactJobMaster", "JobControl")
Abort
End
ErrCode = DSSetJobLimit(hJob4, DSJ.LIMITROWS, 2)
ErrCode = DSRunJob(hJob4, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob4)
Status = DSGetJobInfo(hJob4, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: ManufactJobMaster", "JobControl")
Some one has written this code in Job Control in Datastage
Can u please advice wht can be best procedure to follow this.
Thanks,
Bobby
* Setup SAPimportParentDIST, run it, wait for it to finish, and test for success
hJob2 = DSAttachJob("SAPimportParentDIST", DSJ.ERRWARN)
If NOT(hJob2) Then
* Call DSLogFatal("Job Attach Failed: SAPimportParentDIST", "JobControl")
Call DSLogWarn("Job Attach Failed: SAPimportParentDIST", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob2, "myPath", "/datastage01/Ascential/DataStage/Projects/SAP_EQT/FilesIn/Distributor/")
ErrCode = DSRunJob(hJob2, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob2)
Status = DSGetJobInfo(hJob2, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: SAPimportParentDIST", "JobControl")
End
* Setup SAPimportParentAGENT, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob("SAPimportParentAGENT", DSJ.ERRWARN)
If NOT(hJob1) Then
* Call DSLogFatal("Job Attach Failed: SAPimportParentAGENT", "JobControl")
Call DSLogWarn("Job Attach Failed: SAPimportParentAGENT", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "myPath", "/datastage01/Ascential/DataStage/Projects/SAP_EQT/FilesIn/Agents/")
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: SAPimportParentAGENT", "JobControl")
End
* Setup ManufactJobMasterBDY, run it, wait for it to finish, and test for success
hJob3 = DSAttachJob("ManufactJobMasterBDY", DSJ.ERRWARN)
If NOT(hJob3) Then
* Call DSLogFatal("Job Attach Failed: ManufactJobMasterBDY", "JobControl")
Call DSLogWarn("Job Attach Failed: ManufactJobMasterBDY", "JobControl")
Abort
End
ErrCode = DSRunJob(hJob3, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob3)
Status = DSGetJobInfo(hJob3, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: ManufactJobMasterBDY", "JobControl")
End
* Setup ManufactJobMaster, run it, wait for it to finish, and test for success
hJob4 = DSAttachJob("ManufactJobMaster", DSJ.ERRWARN)
If NOT(hJob4) Then
* Call DSLogFatal("Job Attach Failed: ManufactJobMaster", "JobControl")
Call DSLogWarn("Job Attach Failed: ManufactJobMaster", "JobControl")
Abort
End
ErrCode = DSSetJobLimit(hJob4, DSJ.LIMITROWS, 2)
ErrCode = DSRunJob(hJob4, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob4)
Status = DSGetJobInfo(hJob4, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
* Call DSLogFatal("Job Failed: ManufactJobMaster", "JobControl")