Page 1 of 3

eliminate the return code 8

PostPosted: Tue May 08, 2012 8:35 pm
by dn2012
Hello,

I wrote a procedure:
Last step of the procedure is to Create VSAM File.

//STEP5    EXEC PGM=IDCAMS                                           
//SYSPRINT DD    SYSOUT=*                                           
//         PEND       


I execute as below:

//STEP5.SYSIN DD *                                             
 DELETE  (TSSDN.EMPLOYEE.MASTER) CLUSTER PURGE                 
 DEFINE CLUSTER(                   -                           
               NAME(TSSDN.EMPLOYEE.MASTER)  -                   
               FREESPACE(10 10)     -                           
               INDEXED              -                           
               KEYS(30 0)           -                           
               RECORDSIZE(80 80)    -                           
               SHAREOPTIONS(3 3)    -                           
               ERASE                -                           
               UNIQUE               -                           
              STORCLAS(NULL)       -                           
              VOLUMES(IMS60X)      -                           
              CYLINDERS(40 10)     -                           
                       )           -                           
        DATA(                             -                     
             NAME(TSSDN.EMPLOYEE.MASTER.DATA)     -             
             CONTROLINTERVALSIZE(8192)    -       
            )                             -       
        INDEX(                            -       
             NAME(TSSDN.EMPLOYEE.MASTER.INDEX)   -
             CONTROLINTERVALSIZE(8192))           
/*                                                 


First its delete and than create VSAM File. If VSAM File is not exists, I get return code 8 message in output.
I like to avoid that. I like to eliminate the return code 8. If its exits everything is fine.

thank you

Re: eliminate the return code 8

PostPosted: Tue May 08, 2012 8:53 pm
by Akatsukami
Here you go; you should be able to figure out from this how to do it.

Re: eliminate the return code 8

PostPosted: Tue May 08, 2012 9:08 pm
by dn2012
Your meant set cond code as

//STEP5    EXEC PGM=IDCAMS     COND=(0,8, NE)                                     
//SYSPRINT DD    SYSOUT=*                                           
//         PEND                                                     


will it work?

Re: eliminate the return code 8

PostPosted: Tue May 08, 2012 9:12 pm
by Akatsukami
dn2012 wrote:Your meant set cond code as

//STEP5    EXEC PGM=IDCAMS     COND=(0,8, NE)                                     
//SYSPRINT DD    SYSOUT=*                                           
//         PEND                                                     


will it work?

Of course not; as that link makes perfectly clear, you want to use an IDCAMS modal command, not a JCL COND parameter. At least pretend to read the fine manual.

Re: eliminate the return code 8

PostPosted: Tue May 08, 2012 9:25 pm
by Robert Sample
Hint: read in the manual about the IDCAMS IF command and MAXCC value.

Re: eliminate the return code 8

PostPosted: Wed May 09, 2012 12:06 am
by dn2012
I added

//STEP5.SYSIN DD *                           
 DELETE  (TSSDN.EMPLOYEE.MASTER) CLUSTER PURGE
 SET       MAXCC = 0                         
 DEFINE CLUSTER(                   -         


but getting as:

DELETE (TSSDN.EMPLOYEE.MASTER) CLUSTER PURGE
IDC3012I ENTRY TSSDN.EMPLOYEE.MASTER NOT FOUND
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLA3-42
IDC0551I ** ENTRY TSSDN.EMPLOYEE.MASTER NOT DELETED
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 8

SET MAXCC = 0

thanks

Re: eliminate the return code 8

PostPosted: Wed May 09, 2012 12:22 am
by Akatsukami
Nu? The return code from the step was zero, was it not?

Re: eliminate the return code 8

PostPosted: Wed May 09, 2012 12:23 am
by BillyBoyo
Take notice of Robert's comment. You don't just want to set MAXCC to zero, you only want to do it for an 8. Your way, you'll set to zero even with something disastrous happening. The delete, not there, gets 8. Only change the 8.

EDIT: Following from the honourable, the SET MAXCC is not going to change the return-oode of any IDCAMS function, it is just going to set MAXCC to zero at that point, overwriting whatever was in it at the time (your 8 when the file does not exist).

Try the manual. Try the manual.

Re: eliminate the return code 8

PostPosted: Wed May 09, 2012 5:38 am
by dn2012
I tried different ways but not working.

if code = 8 then
set maxcc = 0
end

any hep will be appriciated

Re: eliminate the return code 8

PostPosted: Wed May 09, 2012 6:50 am
by Robert Sample
Why not try using MAXCC in the IF statement, the way the manual shows?