Empty Source File
Moderators: chulett, rschirm, roy
Empty Source File
I want to give a warning when the source file is empty but the job should not abort. Right now if I have an empty source file, the the job aborts as the source spage cannot read the file. Can anyone tell me how to handle this situation?
My requirement is that the job should not abort but should give a warning.
My requirement is that the job should not abort but should give a warning.
Something else is wrong - an 'empty' source file should not cause a job to fail. It should simply run and process no records - no errors, no warnings - just start up and shut back down and do a whole lot of nothing.
If the job aborts, it should only be because the source file does not exist, or perhaps because the data is not in the proper format.
You can check in an after job routine the number of rows the job processed and write a warning to the log if the number is zero. Check out the DSGetLinkInfo function in your online help with the DSJ.LINKROWCOUNT InfoType.
![Confused :?](./images/smilies/icon_confused.gif)
If the job aborts, it should only be because the source file does not exist, or perhaps because the data is not in the proper format.
You can check in an after job routine the number of rows the job processed and write a warning to the log if the number is zero. Check out the DSGetLinkInfo function in your online help with the DSJ.LINKROWCOUNT InfoType.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
ROW COUNT
Thanks Craig,
But when I am trying to run after job routine for row count, its giving compilation errors. Says DSAttachJob needs to be dimensioned. What I am trying to do is first Attach the job, then get job info, stagelist and then row count. But its not working...![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
But when I am trying to run after job routine for row count, its giving compilation errors. Says DSAttachJob needs to be dimensioned. What I am trying to do is first Attach the job, then get job info, stagelist and then row count. But its not working...
![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
Put this at the top of your routine:
Or more properly:
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
Code: Select all
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
In order to use the job control APIs you must put this statement at the top of your function/routine (courtesy of Ray Wurlod):
The include statement adds the API definitions to your function.
Code: Select all
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Empty Source File
Thanks Guys..This Helps
Hi, I am pretty new to DS and not too familiar with BASIC and routine execution.
I am having the same problem as described here: Job Fails and Aborts if Data source is empty. (I am running on Windows).
Where would I place this routine to get row count as described here?
DSGetLinkInfo(DSJ.ME, "src_tbl_SW_VAL_PRODUCT","lnk_GO_TO_SORT_1",DSJ.LINKROWCOUNT)
Thanks.
I am having the same problem as described here: Job Fails and Aborts if Data source is empty. (I am running on Windows).
Where would I place this routine to get row count as described here?
DSGetLinkInfo(DSJ.ME, "src_tbl_SW_VAL_PRODUCT","lnk_GO_TO_SORT_1",DSJ.LINKROWCOUNT)
Thanks.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: