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 

How to write embedded JCL in a cobol program?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ravii_cbe
Beginner


Joined: 28 Mar 2003
Posts: 6
Topics: 5
Location: Chennai

PostPosted: Wed May 28, 2003 6:32 am    Post subject: How to write embedded JCL in a cobol program? Reply with quote

Can you reply me a sample Cobol program to embedded the JCL (i.e how write a Cobol program to generate the JCL)
_________________
Thanks & Regards
M. RaviShankar
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed May 28, 2003 7:42 am    Post subject: Reply with quote

Ravi,

Code:

FD OUTPUT-FILE
RECORD CONTAINS 80 CHARACTERS
LABEL RECORDS ARE OMITTED
DATA RECORD IS OUTPUT-REC.

01 OUTPUT-REC               PIC X(80)

01 JCL-STATEMENT-AREA.
   05  JCL1.                                                 
        10  FILLER          PIC X(18)  VALUE                   
            '//JOBNAME JOB 0,'''.                             
        10  FILLER          PIC X(07)  VALUE 'NOTIFY'.       
        10  JCL-JOBNAME     PIC X(08)  VALUE SPACES.           
        10  FILLER          PIC X(45)  VALUE                   
            ''',MSGCLASS=Y,CLASS=D                        '.   
        10  FILLER          PIC X(02)  VALUE SPACES.   
       
.....N NUMBER OF JCL STATEMENTS.

01 INTRDR-STATEMENT        PIC X(80) VALUE SPACES.
01 W-SUB                        PIC 9(3) value + 0.

PROCEDURE DIVISION.

PERFORM VARYING W-SUB FROM 1 BY 1 UNTIL W-SUB >  N       
    MOVE JCL-STATEMENT(W-SUB) TO INTRDR-STATEMENT
    WRITE OUTPUT-REC FROM INTRDR-STATEMENT
END-PERFORM.


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CaptBill
Beginner


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

PostPosted: Wed May 28, 2003 12:46 pm    Post subject: Reply with quote

And when you write the JCL out and want to have the created JCL run a job, be sure to use the INTRDR parm on the output dataset.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
glingaraj
Beginner


Joined: 17 Sep 2003
Posts: 1
Topics: 0

PostPosted: Mon Sep 29, 2003 3:11 am    Post subject: Reply with quote

Quote:

INTRDR
Back to top
View user's profile Send private message
k_sharma
Beginner


Joined: 14 Aug 2003
Posts: 10
Topics: 3
Location: Dallas, US

PostPosted: Mon Sep 29, 2003 5:45 am    Post subject: Reply with quote

Hi
I think we have to give following in JCL also.

AB DD SYSOUT=(*,INTRDR)

Where AB is file name used in the above COBOL program.

Cheers
K Sharma
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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