But if your only object in using IDCAMS is to avoid the JCL error if the
ds doesn't exist, the DD is completely unneeded.  You seem to be
confusing the IEFBR14 deletion technique with the IDCAMS deletion
technique and trying to combine them.

Just use IDCAMS delete with the dsname instead of INFILE, and if it
exists and is cataloged it will be deleted,  If it doesn't exist, or
exists and is not cataloged (in which case your DD reference would fail
to find it also), then the IDCAMS DELETE command will get a RC08 which
your SET MAXCC = 0 resets, so in either case IDCAMS completes with RC0.
 I tend to be a little more cautious and use
  IF MAXCC = 8 THEN SET MAXCC = 0
just in case some totally unexpected error happens in IDCAMS.
   JC Ewing

On 12/04/2009 01:51 PM, George.William wrote:
> Because I won't know if the dataset will be cataloged or not, hence the
> use of IDCAMS to avoid a JCL error.
> 
> 
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of McKown, John
> Sent: Friday, December 04, 2009 11:39 AM
> To: [email protected]
> Subject: Re: IDCAMS Delete via DD
> 
> Why do you even want to do that??? Use IEFBR14 instead, with
> DISP=(MOD,DELETE). Or, as I do:
> 
> //STEP1 EXEC PGM=IKJEFT01,
> // PARM='DEL &DSN'
> //SYSTSIN DD DUMMY
> //SYSTSPRT DD SYSOUT=*
> 
> If your reason is to pass the DSN via a PROC parm or a JCL SET symbol.
> Use IKJEFT1B if you want a return code from the DEL.
> 


-- 
Joel C. Ewing, Fort Smith, AR        [email protected]

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to