|
View previous topic :: View next topic
|
| Author |
Message |
Murari
New User
Joined: 29 Feb 2004 Posts: 4 Location: INDIA
|
|
|
|
hai members,
someone help me to solve my doubt.
in brief : i want to initiate a JOB2 from JOB1.
in detail
i have 2 jobs.
JOB1 has 5 steps.
JOB2 has 3 steps.
in JOB1.step3 i have to send a Input value to JOB2.
In JOB2 it has to process the input value and pass the processed value to JOB1.
and the rest of the steps in JOB1 execute normally.
plz give me the JCL coding for this. |
|
| Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
hello,
you can submit job2 from job1 after step3 (job1) this value should be saved in a dataset that u then can retrieve in JOB2.
for the latter I think a bit of rexx development can help, :
have rexx scan for a variable (ispf) or a file if file or variable not found then loop thru process or if found exit. ADD this REXX in a step before the step where you want that value of file retrieved and you're done |
|
| Back to top |
|
 |
Murari
New User
Joined: 29 Feb 2004 Posts: 4 Location: INDIA
|
|
|
|
hi members,
Plz. send the Run JCL code for the question of mine |
|
| Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
sorry, but I gave an answer off the top of my head...
I'll post code when I have time enough...
but you try this on your own... |
|
| Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
hello,
here is jcl + rexx code :
| Code: |
//ICEGENER JOB (MERVA),'QUEUE UTILITY',MSGLEVEL=(1,1),REGION=0M,
// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//*------------------------------------------------------------*/
//* CHANGE ALL JOBLIBM TO JOBLIBM OR JOBLIBM
//* CHANGE ALL END='NTPR' (VARIOUS OPTIONS)
//OPERALL EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DATA
//*----------------------------------------------------*/
//job2 JOB (CA1),'TMS UTILITY',MSGLEVEL=(1,1),REGION=0M,
// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//S1 EXEC PGM=IKJEFT1A,DYNAMNBR=50
//SYSPROC DD DISP=SHR,DSN=HH594D.PROD.REXX
//ISPPROF DD SPACE=(TRK,(2,2,4)),UNIT=SYSDA,DSN=&&ISPPROF,
// DCB=(DSORG=PO,LRECL=80,RECFM=FB),DISP=(NEW,DELETE)
//ISPLOG DD SYSOUT=*,DCB=(LRECL=125,RECFM=VA)
//SYSTSPRT DD SYSOUT=*
//SYSTSOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSIN DD SYSOUT=*
//ISPCTL0 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPCTL1 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPCTL2 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPWRK1 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPWRK2 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//*
//SYSTSIN DD *
%JOBW
//*
//SORT2 EXEC PGM=ICEGENER
//SYSOUT DD SYSOUT=*
//SYSUT1 DD *
RAN OK
//SYSUT2 DD DSN=&SYSUID..EXO.ICE02,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
/*
//SYSUT2 DD SYSOUT=(,INTRDR)
//SYSIN DD DUMMY
//*----- CATALOG FILE WITH VALUE ------------------------------*/
//SORT1 EXEC PGM=ICEGENER
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=&SYSUID..EXO.ICE01,DISP=SHR
//SYSUT2 DD DSN=&SYSUID..EXO.ICE02,DISP=(,CATLG),
// UNIT=SYSDA,SPACE=(CYL,(9,2),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*----- COPY VALUE FOR JOB2 ----------------------------------*/
//SORT2 EXEC PGM=ICEGENER
//SYSOUT DD SYSOUT=*
//SYSUT1 DD *
RUN
/*
//SYSUT2 DD DSN=&SYSUID..EXO.ICE02,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*----- check for value from job2 (epected : ran ok ) --------*/
//EXEC01 EXEC PGM=IKJEFT1A,DYNAMNBR=50
//SYSPROC DD DISP=SHR,DSN=your-rexx-lib
//ISPPROF DD SPACE=(TRK,(2,2,4)),UNIT=SYSDA,DSN=&&ISPPROF,
// DCB=(DSORG=PO,LRECL=80,RECFM=FB),DISP=(NEW,DELETE)
//ISPLOG DD SYSOUT=*,DCB=(LRECL=125,RECFM=VA)
//SYSTSPRT DD SYSOUT=*
//SYSTSOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSIN DD SYSOUT=*
//ISPCTL0 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPCTL1 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPCTL2 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPWRK1 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//ISPWRK2 DD UNIT=VIO,SPACE=(CYL,(1,1)),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//*
//SYSTSIN DD *
%JOBW
//*
//*
// IF EXEC01.RC=06 THEN
//STEP010 EXEC PGM=IEFBR14
// ENDIF
jobW exec :
/* rexx */
trace i
address tso
do i =1 to 1
"listc ent('"userid()".EXO.ICE02') "
if RC=0 then call dsn_ok
else iterate
end
say line.0
exit
DSN_ok:
do forever
"alloc fi(inf) dsn('"userid()".exo.ice02') shr "
If RC > 0 then iterate
"execio * diskr inf (stem in. fini"
"FREE fi(inf)"
do I=1 to in.0
select
when in.i = 'RUN' then exit 05
when in.i = 'RAN OK' then exit 06
otherwise nop
end
end
end
|
hope i helps |
|
| Back to top |
|
 |
NILESHK2302
New User
Joined: 13 Feb 2004 Posts: 14 Location: hyd
|
|
|
|
HI,
How can it be your problem gets simplified if you have any scheduler in your installation. There is a concept called triggers , in your case you can output a file from step 3 of job 1 whcih does contain info to be passed on to your job2. You can setup a trigger on job2 once your file gets created from setp3 of job1. I hope this simplifies your problem. Before proceeding pls know if your installation does have any CA7 /jobtrac or any other scheduler to set up this trigger. 8) |
|
| Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
spot on nilu...
any job scheduler have such facility...
just a tricky (technical wise) question I wanted to answer. IF the solution has to be implemented production-wise they they should consider the job-scheduler option. |
|
| Back to top |
|
 |
mmwife
Super Moderator

Joined: 30 May 2003 Posts: 1592
|
|
|
|
| Either I don't understand the problem or something is missing in the explanation, but why don't you combime both jobs by putting all 3 steps of job 2 between steps 3 & 4 of job 1? |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|