Vince,

Your JCL error has got nothing to do with DFSORT or DFHSM. 

You are creating the OUTDATASET in your SYSIN control cards and the JCL 
interpreter does not read/know  that and it flags the dataset referred in 
the SORTIN DD as NOT found and hence the JCL error.  So you should have 
the OUTDATASET allocation in the JCL(not in sysin) or run the job as 2 
steps.


Thanks, 
Kolusu



From:   Vince Getgood <[email protected]>
To:     [email protected]
Date:   02/11/2016 08:07 AM
Subject:        Odd behaviour with DFHSM & DFSORT in batch.
Sent by:        IBM Mainframe Discussion List <[email protected]>



Hi all,
I've discovered some very odd behaviour when running a DFHSM command in 
the same batch job as a DFSORT step, and I'm completely baffled by what's 
happening.

We're running z/OS 2.2, although it also happens on 1.3 and 1.10.

I've written a piece of JCL that issues some DFHSM commands, runs a REXX 
to format the output, then a SORT to sort the formatted output.  The job 
fails every time. 

I've re-coded the job a number of times, and run the steps individually, 
and it seems the job *only* fails when the SORT step is included. 

Rather than post the whole job, I've discovered I can re-create the 
failure with a really simple example. 

Consider the following JCL: -

<code>
//HSMLIST  EXEC PGM=IKJEFT1A 
//SYSTSPRT  DD  SYSOUT=* 
//SYSTSIN   DD  * 
  HSENDCMD WAIT LIST PVOL OUTDATASET('MAINT.TEMP.LIST')
</code>

This works as expected.  If 'MAINT.TEMP.LIST' doesn't exist, it gets 
created.  If it does, the responses from the LIST PVOL command are 
appended to the end of the dataset.  All good so far.

I create a new empty dataset, 'MAINT.TEMP.TEMP', based on 
'MAINT.TEMP.LIST'.  I then delete 'MAINT.TEMP.LIST', and run the following 
JCL:-

<code>
//HSMLIST  EXEC PGM=IKJEFT1A 
//SYSTSPRT  DD  SYSOUT=* 
//SYSTSIN   DD  * 
  HSENDCMD WAIT LIST PVOL OUTDATASET('MAINT.TEMP.LIST')
/* 
//SORTIT   EXEC PGM=SORT 
//SYSOUT    DD  SYSOUT=* 
//SORTIN    DD  DISP=SHR,DSN=MAINT.TEMP.LIST 
//SORTOUT   DD  DISP=MOD,DSN=MAINT.TEMP.TEMP 
//SYSIN     DD  * 
 SORT FIELDS=COPY 
/* 
</code>

The job *fails* with a JCL error.  I get the following message to my 
terminal: -

ARC0141I ERROR ALLOCATING OUTPUT DATA SET

The joblog for the SORT step shows:-

IEFA107I xxxxxxxx SORTIT SORTIN - DATA SET MAINT.TEMP.LIST NOT FOUND

Can anyone shed any light on what's happening here?

Thanks in advance.

----------------------------------------------------------------------
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