ESP Workload Automation

 View Only
  • 1.  Dataset Trigger in ESP

    Posted Jan 31, 2017 11:53 AM

    We have some datasets (flat files) on the mainframe that are deleted in a batch job and redefined every day. The program in this job opens the redefined files, sometimes writes data in it them and sometimes it does not. Only if data is written do they want to trigger another job. It would be a separate job triggered for each file that is written to. What is the best way to handle this in ESP?

     

    Thanks,

    Sharon

     



  • 2.  Re: Dataset Trigger in ESP

    Posted Jan 31, 2017 12:04 PM

    Maybe someone else has an alternative. This isn't exactly what you are looking for. 

     

    Do an ANYCLOSE on the dataset so it triggers every time they close it. Empty or full. 

    Then add the IDCAMS shown below in the first step of the job. It will get a RC 4 if the file is empty. 

    Use IF/cond logic in the JCL to skip the remainder of the job.  

     

    With IDCAMS
    //INDD DD DSN=INPUT FILE,DISP=SHR
    //OUTDD DD DSN=OUTPUT FILE,DISP=SHR
    //SYSIN DD *
    REPRO INFILE(INDD) OUTFILE(OUTDD) COUNT(1)
    /*

     

    IF THE FILE IS EMPTY IT WILL SET RC=04


    Just a thought

     



  • 3.  Re: Dataset Trigger in ESP

    Posted Jan 31, 2017 12:10 PM

    Thanks, was hoping this could be done in ESP without having to make JCL changes.



  • 4.  Re: Dataset Trigger in ESP

    Posted Jan 31, 2017 12:21 PM

    Can the program that sometimes writes the data be modified to only open the redefined file when there are records to write?

    Then ANYCLOSE could be used with no additional coding.



  • 5.  Re: Dataset Trigger in ESP

    Posted Jan 31, 2017 12:48 PM

    I'm not sure if they can do anything with the program or not, I'll have to check on that.