I do an HRECALL with the WAIT option and messages suppressed so that I can make sure the file is available (before checking if it exists) before attempting to allocate. That way the user shouldn't be interrupted at all or forced to re-start.
Here's the code I use:
msgstat = MSG('off')
"HRECALL ('"tdsname"') WAIT"
msgrset = MSG(msgstat)
If sysdsn("'"tdsname"'") ¬= 'OK' Then
Do
zerrtp = 'ACTION'
zerrsm = 'ALLOC error'
zerrlm = tdsname 'could not be found'
"SETMSG MSG(ISRZ003)"
Return 8
End
"HRECALL ('"tdsname"') WAIT"
msgrset = MSG(msgstat)
If sysdsn("'"tdsname"'") ¬= 'OK' Then
Do
zerrtp = 'ACTION'
zerrsm = 'ALLOC error'
zerrlm = tdsname 'could not be found'
"SETMSG MSG(ISRZ003)"
Return 8
End
Unfortunately, I'm not suppressing anything it seems. Here's what I get when I attempt to process an SMS archived file:
ARC0612I VOLUME MOUNT ISSUED FOR RECALL OR RECOVER OF DEVSUP.TESTDBT.TRIB.OUTF
>V> "DEVSUP.TESTDBT.TRIB.OUTF"
>O> "'DEVSUP.TESTDBT.TRIB.OUTF"
>L> "'"
>O> "'DEVSUP.TESTDBT.TRIB.OUTF'"
ARC1020I DFSMSHSM IS RECALLING FROM TAPE DSN=DEVSUP.TESTDBT.TRIB.OUTF, PLEASE RETRY
THE USER REQUEST AFTER THE RECALL HAS COMPLETED.