On Wed, 13 Sep 2017 09:59:25 +1000, Andrew Rowley wrote:
>
>Careful, you might find a reason to like JCL!
>
Yeah, right.
>Yes, JCL ensures the resources are available before the job starts (but
>not before initiation). IMHO JCL and dataset serialization is one of the
>key but under-appreciated features of z/OS. It's always frustrating on
>other platforms where you have to manage serialization yourself, and
>hope that everyone else does it the same way.
>
It comes at a price. Consider the gyrations to create a new res pack,
ALLOCATE SYS1.LINKLIB vol(newres) NEW ...
I know IBM has lately provided a circumvention, but it's so dicey that
it requires confirmation from a console.
Here's my current *untested* suggestion for Kirk's original problem:
/* Rexx */ signal on novalue; /* ***************************
*/
do Success = 1 for 1
do Failure = 1 /* Try several times if ENQ EXC. */
RC = BPXWDYN( "alloc rtdsn(GDG1) fi(mydd) da('managed.test.gdg(+1)') recfm(v,b)" ,
"new catalog gdgnt lrecl(1028) msg(S99MSG.)" )
if RC==0 then leave Success
if Failure>=10 then leave Failure /* Give up on too many failures. */
address SYSCALL "sleep 1" /* Try again later. */
end Failure /* Fall through after too many tries. */
do I = 1 to S99MSG.0 /* Allocation failed. */
say S99MSG.I; end
exit 99 /* Recovery action? */
end Success /* Free GDG base and allocate generation by full DSN. */
RC = BPXWDYN( "free fi(mydd)" )
RC = BPXWDYN( "alloc fi(mydd) da('"GDG1"') old msg(S99MSG.)" )
-- gil