Vincent,

The issue is with how the ENQ is done. Read upon the "DISP and ENQ" here

https://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieab600/xdddisp.htm

DISP and ENQ: Before starting the first step of a job, the initiator 
requests control of all of the data sets in that job by issuing an ENQ for 
each of them, using the value specified for DISP to determine the kind of 
ENQ issued. The initiator issues the ENQ for each data set at the highest 
level required for that data set by any step of the job. For example, if 
all steps of the job request shared control of a specific data set 
(DISP=SHR) then the ENQ for that data set is requested as SHR. If, on the 
other hand, any step of the job requests exclusive control of a specific 
data set (DISP=NEW, DISP=MOD, or DISP=OLD), then the ENQ for that data set 
is requested EXCL.

And if you looked at the LOG when the job ran you would have found these 
messages

ARC0300I XXXXX  ISSUED===>LIST PVOL OUTDATASET ('MAINT.TEMP.LIST') 
ARC0506I FAILURE TO ALLOCATE SYSOUT TYPE DATA SET, 509 
ARC0506I (CONT.) RC=04, REAS=0210, EXTENDED REASON CODE=00000 
ARC0141I ERROR ALLOCATING OUTPUT DATA SET

Here is the explanation for the reason code 0210 from dynamic allocation

http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieaa800/erc.htm?lang=en

0210    (528) 

Meaning: Requested data set unavailable. The data set is allocated to 
another job and its usage attribute conflicts with this request. (dsname 
allocation)1

Application Programmer Action: Change the allocation request and resubmit 
the request.

Corresponding Message: IKJ56225I

So in your case HSM cannot allocate the dataset because the job has a 
reference to it.  Therefore, when the step starts, the dataset doesn't 
exist, and you get a JCL error. 

Also is there a specific reason as to why you chose HSENDCMD instead of 
plain HLIST?

Assuming you are already authorized wouldn't it be simple to issue 

HLIST PVOL OUTDATASET('MAINT.TEMP.LIST') 

Thanks,
Kolusu

IBM Mainframe Discussion List <[email protected]> wrote on 
02/12/2016 01:36:45 AM:

> From: Vince Getgood <[email protected]>
> To: [email protected]
> Date: 02/12/2016 01:37 AM
> Subject: Re: Odd behaviour with DFHSM & DFSORT in batch.
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> Thanks all for your responses.
> 
> Allan,
> I DELETED ‘MAINT.TEMP.LIST’ before running the second job – can’t 
> get more freed than that…
> 
> I tried pre-allocating it – Still get the ARC0141I message.
> 
> Kolusu,
> I’m sorry, you are wrong.  OUTDATASET is created by DFHSM at the 
> time of issuing the LIST command.  The job DOES have two steps.
> 
> John,
> Best explanation yet!  But, and here I’m showing a little ignorance,
> I’m running JES2.  I didn’t think JES2 did any enqueues until the 
> step started?
> 
> As per my original post, I need to run a SORT on the "real" 
> ‘MAINT.TEMP.LIST’, so the IDCAMS doesn’t help me.  The SORT step I 
> coded was just for demonstration purposes.
> 
> Ed,
> That’s more or less what John said.  I thought the WAIT parameter 
> would resolve that issue though.
> 
> On more investigation, there is nothing in the joblog for the 
> HSMLIST step regarding the final disposition of 'MAINT.TEMP.LIST', 
> regardless of if I run it on it's own, or as part of the two step 
> job coded in my OP.
> 
> This lends credence to what Ed and John are saying.  Even though 
> I've coded WAIT on the DFHSM LIST command, the HSMLIST step is 
> finishing and the SORTIT step starts before 'MAINT.TEMP.LIST' is 
> allocated, hence the ARC0141I message and the JCL error.
> 
> Looks like I may have to do two jobs, or put some sort of "filler" 
> step between the HSMLIST & SORTIT steps.
> Vince.
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to