Run six CL programs

20 pts.
Tags:
AS/400
CL Program
Hello, I want to run 6 CL programs in a manner that when first two (Say A and B) successfully completed then C&D should start and once C&D is completed E&F should start processing.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 9  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • philpl1jb

    You could have a data area:

    As Program A completes it would check the area to see if it contains "Program B completed" if it does it would start C and D

    If it doesn't it would update the area with Program A Completed

    As Program B completes it would check the area to see if it contains "Program A completed" if it does it would start C and D


    54,090 pointsBadges:
    report
  • CLUSER

    Thanks, Could you please give an example " How to create and use data area" Here is my program.....

    PGM        /* Run data refresh for Dev environment */         
                                                                    
    CHGJOB     LOG(4 0 *SECLVL) LOGCLPGM(*YES)                      
                                                                    
           CALL mylib/TESTSAVE    /* submits two savefiles in batch */                                     
                                                                    
    MONMSG     MSGID(CPF0000)                                       
                                                                    
           CALL mylib/TESTRST     /* starts restore from above file */

    In my case this is also running with save file and I want it to run after save completed.                                     
                                                                    
    MONMSG     MSGID(CPF0000)                                        
                                                                     
        CLRSAVF mylib/F4211S                                      
         CLRSAVF mylib/F4311S  

                                      
    ENDPGM                                                          

    20 pointsBadges:
    report
  • philpl1jb

    You would create the data area in the same library as your data files. It doesn't need to be created in this job, it can be a permanent object. Do not create it in QTEMP because you want to access it from multiple jobs.

    CRTDTAARA DTAARA(MYLIB/MYDATA) TYPE(*CHAR) LEN(100)

    54,090 pointsBadges:
    report
  • philpl1jb

    As your controlling CL starts it should issue a command to clear the data area

    CHGDTAARA DTAARA(MYLIB/MYDATA *ALL) VALUE(' ')

    54,090 pointsBadges:
    report
  • philpl1jb

    When Job A is complete it should update the data area:

    CHGDTAARA DTAARA(MYLIB/MYDATA (1 15)) VALUE('Job A Complete')

    54,090 pointsBadges:
    report
  • philpl1jb

    When Job B is complete it should update the data area:

    CHGDTAARA DTAARA(MYLIB/MYDATA (16 15)) VALUE('Job B Complete')

    54,090 pointsBadges:
    report
  • philpl1jb

     your controlling CL can check the status

    RTVDTAARA DTAARA(MYLIB/MYDATA )  RTNVAR(&RTNVAL)

    and then check it

    If ((%SUBR(&RTNVAL 1 15) *EQ 'Job A Complete') *and

    (%SUBR(&RTNVAL 1 15) *EQ 'Job B Complete')  .. continue the process

    else

    Delay

    Goto RtvDta


    54,090 pointsBadges:
    report
  • GHENDER
    Wouldn't running the jobs out of a single threaded job queue accomplish the same thing?
    250 pointsBadges:
    report
  • philpl1jb
    Perhaps, single threaded but I thought CLUSER wanted A and B to run simultaneously.
    54,090 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: