View previous topic :: View next topic |
Author |
Message |
Hanul Beginner
Joined: 23 Apr 2003 Posts: 4 Topics: 1
|
Posted: Wed Apr 23, 2003 7:52 am Post subject: INCLUDE problem and starting an external JCL |
|
|
Hi,
I have 2 stupid questions
I think the answer is simple, but I can't find it out...
1. I'm using an INCLUDE in my JCL and it works (it includes allright hehe), but in the included part every '//' in the beginning of a line is replaced by 'XX' resulting in a JCL error on every line (I'm using TYPRUN=SCAN to check). Lines without '//' in the beginning are included OK and don't generate JCL errors... Any idea what is causing this and what the solution might be??
2. Is there a JCL statement that I can use in a member which enables me to start a JCL that is in another member??
Thanks!!
Greetings! |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Wed Apr 23, 2003 9:04 am Post subject: |
|
|
Hanul,
I do not know about the first.
For the second question, do you want to submit a JCL from within another JCL? If yes, you can try the following:
Code: |
//STEP EXEC PGM=ICEGENER
//SYSIN DD DUMMY
//SYSUT1 DD DSN=your external JCL
// DISP=SHR
//SYSUT2 DD SYSOUT=(,INTRDR),LRECL=80,RECFM=FB
//SYSPRINT DD SYSOUT=*
//
|
Or,
Code: |
//STEP EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD DSN=your external JCL
// DISP=SHR
//SYSUT2 DD SYSOUT=(,INTRDR),LRECL=80,RECFM=FB
//SYSPRINT DD SYSOUT=*
//
|
Or,
Code: |
//STEP EXEC PGM=IKJEFT01
//SYSTSIN DD *
SUB your external JCL name
/*
//SYSTSPRT DD SYSOUT=*
//
|
But, there are few things that you need to remember before you design such an application.
1. You do not have control over the "submitted" job. That is, you cannot expect another step (in the main JCL) to execute after the submitted JCL is over.
2. The return code of the step that submits a job will always be zero unless the dataset pointed by the relevant DD name does not exist. You cannot get the return code of the submitted JCL unless you code another utility for it.
3. If the submitted job has a jobname similar to the submitting JCL, then submitted JCL will wait until the submitting JCL is over. You would get a status of DUP for the submitted job until the submitting job is running. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
Hanul Beginner
Joined: 23 Apr 2003 Posts: 4 Topics: 1
|
Posted: Wed Apr 23, 2003 9:05 am Post subject: |
|
|
Thanks, Cogito-Ergo-Sum
Meanwhile I found the answer to my second stupid question myself, I used SYSOUT=(X,INTRDR).
Now only the first stupid question remains
Hanul |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Wed Apr 23, 2003 9:38 am Post subject: |
|
|
The XX in the included JCL is just the system's method of showing that the statements were copied from somewhere else. That alone is not causing your JCL error. There must be something else. Please post the actual listing, if possible.
Bill |
|
Back to top |
|
 |
Hanul Beginner
Joined: 23 Apr 2003 Posts: 4 Topics: 1
|
Posted: Thu Apr 24, 2003 1:20 am Post subject: |
|
|
Here's (part of) my job report. The included part didn't cause an error when I used to run it as a stand-alone job. But now that it's part of the include, it starts giving those errors...
Code: |
J E S 2 J O B L O G -- S Y S T E M M E R 1 -- N O D E N 1
08.13.20 JOB32657 ---- THURSDAY, 24 APR 2003 ----
08.13.20 JOB32657 IRR010I USERID MCDOKSE IS ASSIGNED TO THIS JOB.
08.13.20 JOB32657 IEFC452I MCDOKSE1 - JOB NOT RUN - JCL ERROR
------ JES2 JOB STATISTICS ------
14 CARDS READ
64 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
3 SYSOUT SPOOL KBYTES
0.00 MINUTES EXECUTION TIME
1 //MCDOKSE1 JOB (GRP,IFCR10),TIME=1440,TYPRUN=SCAN, JOB32657
// MSGCLASS=Y,MSGLEVEL=(1,1),REGION=4M,
// PRTY=5,CLASS=N,COND=(0,NE)
//*
//*
//*
//*
2 //JOBLIB DD DSN=TEST.BATCH9.LOAD,DISP=SHR
3 // DD DSN=EXP.BATCH.LOAD,DISP=SHR
//*
4 //LIBR JCLLIB ORDER=TEST.JCL9.CNTL
//* 00320016
//*
5 //TEST INCLUDE MEMBER=IFCR10A 00230000
6 XXDELETE1 EXEC PGM=IDCAMS,COND=(0,NE)
7 XXSYSPRINT DD SYSOUT=*
8 XXSYSIN DD *
9 DELETE MCDOKSE.TPC.GRP.KLANTEN.OUTPUT
10 DELETE MCDOKSE.TPC.GRP.KLANTEN.F030314
11 SET MAXCC EQ 0
12 /*
13 XXDELETE2 EXEC PGM=IDCAMS
14 XXSYSPRINT DD SYSOUT=*
15 XXSYSIN DD *
16 DELETE (TEST.CRP.BASISM.DATA) CL
17 SET MAXCC EQ 0
18 DELETE (TEST.CRP.BASISM.KEY) CL
19 SET MAXCC EQ 0
20 DELETE (TEST.CRP.POLDOSKM.DATA) CL
21 SET MAXCC EQ 0
22 DELETE (TEST.CRP.KLANTPOM.DATA) CL
23 SET MAXCC EQ 0
XX*
STMT NO. MESSAGE
5 IEFC002I INCLUDE GROUP IFCR10A WAS EXPANDED USING PRIVATE LIBRARY TEST.JCL9.CNTL
8 IEFC601I INVALID JCL STATEMENT
9 IEFC601I INVALID JCL STATEMENT
10 IEFC601I INVALID JCL STATEMENT
11 IEFC601I INVALID JCL STATEMENT
12 IEFC601I INVALID JCL STATEMENT
15 IEFC601I INVALID JCL STATEMENT
16 IEFC601I INVALID JCL STATEMENT
17 IEFC601I INVALID JCL STATEMENT
18 IEFC601I INVALID JCL STATEMENT
19 IEFC601I INVALID JCL STATEMENT
20 IEFC601I INVALID JCL STATEMENT
21 IEFC601I INVALID JCL STATEMENT
22 IEFC601I INVALID JCL STATEMENT
23 IEFC601I INVALID JCL STATEMENT
|
Cheers,
Hanul |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Apr 24, 2003 1:54 am Post subject: |
|
|
Hanul,
JCL manual says Include statement cannot have DD * statements.
Question: Can someone explain why not?
Diba. |
|
Back to top |
|
 |
Hanul Beginner
Joined: 23 Apr 2003 Posts: 4 Topics: 1
|
Posted: Thu Apr 24, 2003 2:28 am Post subject: |
|
|
Right, now I noticed...
But you're right, why not??
Hanul |
|
Back to top |
|
 |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Thu Apr 24, 2003 4:08 pm Post subject: |
|
|
Hi Hanul,
I'd guess that INCLUDEs are considered similar to PROCs where in-stream data is not allowed.
You could probably use DD DDNAME=anyname instead of DD *, then code in the jobstream after the INCLUDE:
//anyname DD *
instream data
.
.
.
But you'd have to take the sysin data out of the include.
Regards, Jack. |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Fri Apr 25, 2003 4:19 am Post subject: |
|
|
Slade,
Still the question remains why procs and includes would have this restriction.
Maybe it would be bad practice to have in-stream data in procs but otherwise I don't see any reason.
Diba. |
|
Back to top |
|
 |
CaptBill Beginner
Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
|
Posted: Fri Apr 25, 2003 10:47 am Post subject: |
|
|
Dibakar,
When you play any game, you have to follow the rules for that game. If you do not follow the rules, you get thrown out of the game.
When you use JCL, you have to follow the rules for JCL. Someone at sometime made the rule that there is no instream data allowed in a PROC. You may disagree with the rule, but it is still the rule and you have to follow it or you will be in violation and not get to run your job. |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Fri Apr 25, 2003 3:17 pm Post subject: |
|
|
The whole purpose of the SYSIN file is to provide input to the program that is changeable. Therefore, it would seem silly to have it be part of an included member or proc where everyone gets the same values.
Put the data into a PDS (maybe with a symbolic member name) or put it in your JOB stream as suggested by slade.
Bill |
|
Back to top |
|
 |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Fri Apr 25, 2003 4:05 pm Post subject: |
|
|
Hi Dibakar,
It probably all boils down to the fact that things are done in a given sequence. In this case I'd imagine the JCL being read and when the in-stream data is detected it id put into a special dataset for later use by the appplication. The pros and includes are then expanded and placed into the JCJ, the symbolics are resolved, yada yada yada.
When PROCs and INCLUDEs were first introduced to the industry, the process was probably reviewed and someone at IBM said, "What happens if someone puts in-stream data into a PROC/INCLUDE ?" The answer was "tell them they can't do that, we'd have to turn the process upside down to accommodate it".
Regards, Jack. |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Apr 28, 2003 2:45 am Post subject: |
|
|
Thanks everybody,
I often get these questions because manuals often talk about rules but not why they were made.
Regards,
Diba. |
|
Back to top |
|
 |
|
|