Help needed for FTP stage...
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
Code: Select all
JobName = "srcDlyCalcTxns_LN"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
result = DSGetLinkInfo(DSJ.JOBNAME,DSJ.ME,DSJ.ME,DSJ.LINKROWCOUNT)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
If result > 0 Then
StgFileName = "LNREMIT"
JobName = "xfmDlyCalcTxns_LN"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
End
what might be the problem?
chulett wrote:You need to establish a handle to the "srcDlyCalcTxns_LN" job and not use DSJ.ME at all. The 2nd & 3rd arguments are Stage Name and Link Name respectively from the job the handle is attached to. And then detach the handle when you are done with it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
Code: Select all
JobName = "hashProcessControlDTS"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
JobName = "srcDlyCalcTxns_LN"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
result = DSGetLinkInfo(DSJ.JOBNAME,DSJ."xfmDailyCalcTxns",DSJ."Xfm_DailyCalcTxns",DSJ.LINKROWCOUNT)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
If result > 0 Then
StgFileName = "LNREMIT"
JobName = "xfmDlyCalcTxns_LN"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
End
JobName = "Batch::LNRemitMaintenance"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
JobName = "ldiLNRemitProcessControl"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
imean if i give link and stage name indead of "ME"
Also it runs the code bt doesnt run the
Code: Select all
If result > 0 Then
StgFileName = "LNREMIT"
JobName = "xfmDlyCalcTxns_LN"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
End
The first parameter needs to be a handle you establish, not a name. And the other two are just names, so get rid of the "DSJ." part. Bare bones code:
I had no idea what to put for the third argument. It cannot be the same as the second one which is the name of the transformer to check. So where I put "Xfm_WriteLink", replace it with the name of the link from the transformer you named that writes to the Sequential File stage.
Technically you should always check to make sure the handle could be established and was then detached successfully plus if the "result" is less than zero as that means an error in the DSGetLinkInfo() call.
And please, next time pay closer attention to the syntax details as written in the online help. You can also (typically) search the forums here for a function name and find examples of how others have used it. I just did for "dsgetlinkinfo" and got almost 300 matches in the forums here so plenty of examples are out there for this function.
Code: Select all
JobName = "srcDlyCalcTxns_LN"
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
result = DSGetLinkInfo(hJob,"xfmDailyCalcTxns","Xfm_WriteLink",DSJ.LINKROWCOUNT)
x = DSDetachJob(hJob)
Technically you should always check to make sure the handle could be established and was then detached successfully plus if the "result" is less than zero as that means an error in the DSGetLinkInfo() call.
And please, next time pay closer attention to the syntax details as written in the online help. You can also (typically) search the forums here for a function name and find examples of how others have used it. I just did for "dsgetlinkinfo" and got almost 300 matches in the forums here so plenty of examples are out there for this function.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
Code: Select all
Batch::CopyOfLNRemitMaster..JobControl (fatal error from DSGetJobInfo): Job control fatal error (-1)
(DSGetJobInfo) Invalid job handle 2
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
Code: Select all
DEFFUN RunRestartableJob(JobName,HASHPATH,BatchNumber,SKIPPARAM) Calling "DSU.RunRestartableJob"
DEFFUN EmailErrorMessage(HASHPATH,BatchNumber) Calling "DSU.EmailErrorMessage"
DEFFUN JobControlReset(JobList) Calling "DSU.JobControlReset"
DEFFUN RunBatch(JobList, Params) Calling "DSU.RunBatch"
DEFFUN ConvDateYYYYMMDD.DashDeltoMMDDYYYY(DATE) Calling "DSU.ConvDateYYYYMMDD.DashDeltoMMDDYYYY"
DEFFUN GetHashValueByKey(File,Key) Calling "DSU.GetHashValueByKey"
BatchStartDts = DSGetJobInfo(DSJ.ME, DSJ.JOBSTARTTIMESTAMP)
JobName = "hashProcessControlDTS"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
JobName = "srcDlyCalcTxns_LN"
*BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
BatchName = DSGetJobInfo(JobName, DSJ.ERRNONE)
result = DSGetLinkInfo(BatchName,"xfmDailyCalcTxns","Xfm_DailyCalcTxns",DSJ.LINKROWCOUNT)
*result = DSGetLinkInfo(DSJ.JOBNAME,DSJ.ME,DSJ.ME,DSJ.LINKROWCOUNT)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
If result > 0 Then
StgFileName = "LNREMIT"
JobName = "xfmDlyCalcTxns_LN"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
End
JobName = "Batch::LNRemitMaintenance"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
JobName = "ldiLNRemitProcessControl"
BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
Errcode = RunRestartableJob(JobName,HASHPATH,BATCHNUMBER,"BATCHTIMESTAMP=":BatchStartDts)
If Errcode Then
GOTO ENDJOB
End
ENDJOB:
* Setup DailyPCJobStatsLdiNew, run it, wait for it to finish, and test for success
JobName = "DailyPCJobStatsLdiNew.":BATCHNAME
Result = JobControlReset(JobName)
hJob1 = DSAttachJob(JobName, DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: DailyPCJobStatsLdiNew", "JobControl")
Abort
End
Errcode1 = DSSetParam(hJob1, "HASHPATH", HASHPATH)
Errcode1 = DSSetParam(hJob1, "STGPATH", PROJDIR:STGPATH)
Errcode1 = DSSetParam(hJob1, "BATCHNUMBER", BATCHNUMBER)
Errcode1 = DSSetParam(hJob1, "SRCDBNAME", SRCDBNAME)
Errcode1 = DSSetParam(hJob1, "SRCUSERID", SRCUSERID)
Errcode1 = DSSetParam(hJob1, "SRCPWD", SRCPWD)
Errcode1 = DSRunJob(hJob1, DSJ.RUNNORMAL)
Errcode1 = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogWarn("Job Failed: DailyPCJobStatsLdiNew", "JobControl")
End
If Errcode then
* Result = JobControlReset(BatchName)
Message = EmailErrorMessage(HASHPATH,BATCHNUMBER)
Reply = DSSendMail("From:":MSG_FROM:"\nTo:":MSG_TO:"\nServer:":SMTPSERVER:"\nSubject:":BatchName:" failed\nBody:":Message:"\n")
Call DSLogFatal("Batch ran failed! (see warnings)", BatchName)
End
*Clear Hash File.
OPENPATH HASHPATH:"/":'hshJobInfo':BATCHNUMBER To hashPath Then
CLEARFILE hashPath ON ERROR Call DSLogInfo("Cannot Clear the Log",BatchName)
error am getting is
Code: Select all
Batch::CopyOfLNRemitMaster..JobControl (fatal error from DSGetJobInfo): Job control fatal error (-1)
(DSGetJobInfo) Invalid job handle srcDlyCalcTxns_LN
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
As Craig has already told you more than once, you need a valid job handle. This part of the code is generating your error.
You must attach the job (assigning a job handle) and detach the job when done.
Code: Select all
JobName = "srcDlyCalcTxns_LN"
*BatchName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)
BatchName = DSGetJobInfo(JobName, DSJ.ERRNONE)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I'm about to give up here. You are not paying attention to the guidance I am attempting to give, so what's the point in continuing this conversation? You did not heed the warnings in my post, did not incorporate "my code" into your code with the change I noted would be required and just continue to perpetuate the same issues over and over.
Reread what I posted.
Reread what I posted.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 103
- Joined: Fri Jan 18, 2008 12:55 am
- Location: chennai
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
sagar deshmukh wrote:i been working since more than 24 hrs so......brain not working...
Never do that.
ETL developer is a job that requires immense attention to detail.
You can not achieve the same if fatigued.
No correspondence will be entered into concerning this advice, deadlines or any of the other artificial constraints of a project plan.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.