Page 2 of 2

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 5:22 am
by anurag_87
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

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 6:10 am
by MrSpock
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.

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 12:59 pm
by mongan
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)

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 3:47 pm
by prino
You are such a dumb ****, to misquote Mark $$$uckerberg...

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

Better try Personal Job Scheduler

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 4:12 pm
by Akatsukami
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.

Re: Submitting One Job after Previous Job has completed

PostPosted: Wed Feb 08, 2012 12:56 am
by anurag_87
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.

Re: Submitting One Job after Previous Job has completed

PostPosted: Wed Feb 08, 2012 2:21 am
by Akatsukami
: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.