MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

INCLUDE problem and starting an external JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Hanul
Beginner


Joined: 23 Apr 2003
Posts: 4
Topics: 1

PostPosted: Wed Apr 23, 2003 7:52 am    Post subject: INCLUDE problem and starting an external JCL Reply with quote

Hi,

I have 2 stupid questions Wink
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
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed Apr 23, 2003 9:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Hanul
Beginner


Joined: 23 Apr 2003
Posts: 4
Topics: 1

PostPosted: Wed Apr 23, 2003 9:05 am    Post subject: Reply with quote

Thanks, Cogito-Ergo-Sum
Meanwhile I found the answer to my second stupid question myself, I used SYSOUT=(X,INTRDR). Very Happy

Now only the first stupid question remains Wink

Hanul
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Apr 23, 2003 9:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Hanul
Beginner


Joined: 23 Apr 2003
Posts: 4
Topics: 1

PostPosted: Thu Apr 24, 2003 1:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Thu Apr 24, 2003 1:54 am    Post subject: Reply with quote

Hanul,

JCL manual says Include statement cannot have DD * statements.

Question: Can someone explain why not?

Diba.
Back to top
View user's profile Send private message Send e-mail
Hanul
Beginner


Joined: 23 Apr 2003
Posts: 4
Topics: 1

PostPosted: Thu Apr 24, 2003 2:28 am    Post subject: Reply with quote

Right, now I noticed... Embarassed

But you're right, why not??

Hanul
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Thu Apr 24, 2003 4:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Fri Apr 25, 2003 4:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Fri Apr 25, 2003 10:47 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri Apr 25, 2003 3:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Fri Apr 25, 2003 4:05 pm    Post subject: Reply with quote

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". Idea

Regards, Jack.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Mon Apr 28, 2003 2:45 am    Post subject: Reply with quote

Thanks everybody,

I often get these questions because manuals often talk about rules but not why they were made.

Regards,
Diba.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group