You can start the task and stop it immediately.
For QlikView, Create a task and then you will see it under task tab. Here you will see couple of buttons next to the task, click on run button and then once it starts you will see button to stop it.
For Qlik Sense, once you create a task you can see a start button at bottom and also stop button to stop the rask.
In either case once you stop the task it will fail.
In your script you can try using a self-invented statement, like
It won't be recognised by the Scriupt execution engine, and as a result it will do exactly what it means.
For exmaple, you can use this trick in an IF statement that evaluates conditions that should be fulfilled to succeed, otherwise fail:
IF NoOfRows('MyTable') > 0 THEN
CONCATENATE (OtherTable) LOAD ... RESIDENT MyTable WHERE ...;