Submitting One Job after Previous Job has completed



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Re: Submitting One Job after Previous Job has completed

Postby anurag_87 » Tue Feb 07, 2012 5:22 am

Guys , Am at home so no access to Mainframe to confirm if it work..But I just thought of using a in-stream proc to execute
jobs

JOBSCHD PROC
TESTCS1 EXEC PGM=IEBGENER,COND=(0,LT)

SYSIN DD DUMMY

SYSPRINT DD SYSOUT=*

SYSUT1 DD DSN=XXXX.YYYYY(&PARM),DISP=SHR

SYSUT2 DD SYSOUT=(R,INTRDR)
PEND

STEP01 EXEC JOBSCHD,PARM=JCL1,COND=(0,LT)
STEP01 EXEC JOBSCHD,PARM=JCL2,COND=(0,LT)
STEP01 EXEC JOBSCHD,PARM=JCL3,COND=(0,LT)

I guess this should serve my purpose.

Thanks a lot guys
anurag_87
 
Posts: 7
Joined: Mon Feb 06, 2012 4:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting One Job after Previous Job has completed

Postby MrSpock » Tue Feb 07, 2012 6:10 am

Of course, that will just submit a bunch of jobs to the Internal Reader all at once. It still doesn't provide any control over which one executes when.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Submitting One Job after Previous Job has completed

Postby mongan » Tue Feb 07, 2012 12:59 pm

Yes, you can use intrdr, but this step will have to be added to your first job.

//GEN EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=0
//SYSIN DD DUMMY
//SYSUT1 DD DSN=Programm.Library(JCLname),DISP=SHR
//SYSUT2 DD SYSOUT=(C,INTRDR)
User avatar
mongan
 
Posts: 211
Joined: Tue Jan 11, 2011 8:32 pm
Has thanked: 1 time
Been thanked: 5 times

Re: Submitting One Job after Previous Job has completed

Postby prino » Tue Feb 07, 2012 3:47 pm

You are such a dumb ****, to misquote Mark $$$uckerberg...

Why would an in-stream proc wait for submitted jobs?????

Better try Personal Job Scheduler
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Submitting One Job after Previous Job has completed

Postby Akatsukami » Tue Feb 07, 2012 4:12 pm

anurag_87 wrote:But I am not convinced to opt for these as of now.All seems to either tweak the existing JCL to have Job N to trigger Job N+1 or get all job submitted with same Jobname so that JES will execute only one at a time.
Above will solve the purpose no doubt.

But what I wanna understand is that do we have any process,may be thru INTRDR to have that control on trigger of next job or somthing else similar kinda..

Yeah, there's a process. It's called justifying your claim to knowing Rexx by actually writing some, which creates a temporary stream submitted to the internal reader.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Submitting One Job after Previous Job has completed

Postby anurag_87 » Wed Feb 08, 2012 12:56 am

Akatsukami,
The job which I mention is getting triggered thru a Rexx tool only.
But I am not able to get the command to achieve my purpose.
anurag_87
 
Posts: 7
Joined: Mon Feb 06, 2012 4:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting One Job after Previous Job has completed

Postby Akatsukami » Wed Feb 08, 2012 2:21 am

:roll:

/* Rexx */                                                     
/* Written Heisei 24.2.7 by Akatsukami-sama */                 
  trace o                                                       
  arg jcllib cntlib .                                           
  cntldeck = cntlib"(FOO)"                                     
  sig      = x2c("E69989A3A3859540C88589A2858940F2F44BF24BF740")
  sig      = sig || x2c("82A840C19281A3A2A49281948960A2819481")       
  "ALLOC FI(TULIN) DA('"cntldeck"') SHR REU"                   
  "EXECIO * DISKR TULIN (STEM JOB. FINIS"                       
  "FREE FI(TULIN)"                                             
  tempname = "D"time("Seconds")                                 
  tempjcl  = cntlib"("tempname")"                               
  "ALLOC FI(TULOUT) DA('"tempjcl"') SHR REU"                   
  queue "//SUBEM    JOB  ,'SUB ''EM ALL!',CLASS=S,MSGCLASS=1"   
  "EXECIO 1 DISKW TULOUT"                                       
                                                               
  do i = 1 to job.0                                             
    thisjob = jcllib"("strip(job.i)")"                         
    "ALLOC FI(TULUT1) DA('"thisjob"') SHR REU"                 
    "EXECIO * DISKR TULUT1 (STEM JCL. FINIS"                   
    "FREE FI(TULUT1)"                                           
    doit = 0                                                   
                                                               
    do j = 1 to jcl.0                                           
      if (pos(" EXEC ",jcl.j)¬=0) then doit = 1                 
                                                               
      if (doit=1) then do                                       
        push jcl.j                                             
        "EXECIO 1 DISKW TULOUT"                                 
      end                                                       
    end                                                         
  end                                                           
                                                               
  "EXECIO 0 DISKW TULOUT (FINIS"                               
  "FREE FI(TULOUT)"

Read it over and see if you can understand what it's doing.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Previous

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post