Micheal Butz wrote:

>I have 2 files and would lime to see If one or both or none exist
>I am using IDCAMS if-else sequence With a command of print for this
>However I am always coming up with a cc of 0 in the jcl for this step

Ok. I have followed this thread where CM Poncolet and Paul Gilmartin tried to 
help you to relieve yourself from 'torture yourself'.

May I suggest that you try something else to check whether a dataset (not file) 
exists and whether it is empty or not?

Crude, dirty, short and sweet CLIST to see whether your dataset exists or not:

PROC 0                                   
  IF &SYSDSN('.....JCL') = OK THEN   +
   DO                                    
    WRITE DATASET FOUND                  
    SET &RC = 0                          
   END                                   
  ELSE  +                                
   DO                                    
    WRITE DATA SET NOT FOUND             
    SET &RC = 4                          
   END                                   

DFSORT to see whether a dataset is EMPTY or not:

      COUNT FROM(SYS1.EMPTY.YES.NO.PERHAPS) EMPTY  gives RC=12 (or RC=04 if 
specified)

Of course there are many other ways to check your DSN and quantity of records. 
I think you should see it in IBM-MAIN archives.

Use your RC to selectively run your IDCAMS print step(s).

HTH!

Groete / Greetings
Elardus Engelbrecht

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

Reply via email to