My goal is not to prevent my job from returning 166 (or anything else but 0). Sometimes ftp really is broken (remote machine down, network down, whatever), and an alert really does need to be generated. I just don't want my job completion code to be 166 regardless of whether the ftp retry worked or not. Unfortunately, in JCL, that's just the way it is. And there's nothing that's "behaving badly". Ftp will fail for a variety of valid reasons, and appropriately report the result. One of those reasons is a transient network problem, and a simple retry will succeed. Currently, that process is handled manually by the operator; there's nothing to "make easier", except to automate the process, which JCL seems designed to prevent. As I explained previously, rewriting everything in glorbrik is not an option.
However, it MIGHT be possible to get the automated alert system to ignore a particular completion code, as it currently ignores 0 (and actually, I'm told, any code 4 or less). If that's the case, then all I have to do is set a step return code to a value higher than 166 that the alert system will ignore. Here's what I've got (plagiarized from http://en.wikipedia.org/wiki/IEFBR14):
ID DC C'JRC4000'
GO L R15,=x'FA0'