View previous topic :: View next topic |
Author |
Message |
Sridhar Reddy Beginner
Joined: 17 Feb 2003 Posts: 6 Topics: 3
|
Posted: Mon Feb 17, 2003 7:40 am Post subject: Writing JCL in Cobol Program |
|
|
How to write JCL in Cobol program. If you can provide me with an example that will help me a lot. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Feb 17, 2003 7:49 am Post subject: |
|
|
Sridhar Reddy,
Code: |
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 OUTFILE-REC 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 OUTFILE-REC
WRITE FILE-REC
END-PERFORM.
|
|
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Feb 17, 2003 7:59 am Post subject: |
|
|
Kolusu,
Is sit possible to submit this JCL through the same same Cobol program?
Diba |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Feb 17, 2003 9:21 am Post subject: |
|
|
Dibakar,
You can write the jcl to an output file pointing to INTRDR which will submit the jcl.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. SUBJCL
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OUTPUT-FILE
ASSIGN TO OUTPUT.
FILE SECTION.
FD OUTPUT-FILE
RECORD CONTAINS 80 CHARACTERS
LABEL RECORDS ARE OMITTED
DATA RECORD IS OUTPUT-REC.
01 OUTPUT-REC PIC X(80).
WORKING-STORAGE SECTION.
01 W-SUB PIC 9(03).
PROCEDURE DIVISION.
PERFORM VARYING W-SUB FROM 1 BY 1 UNTIL W-SUB > N
MOVE JCL-STATEMENT(W-SUB) TO OUTPUT-REC
WRITE OUTPUT-REC
END-PERFORM
CLOSE OUTPUT-FILE
|
In the jcl code it as
Code: |
//STEP1 EXEC PGM=SUBJCL
//*
//OUTPUT DD SYSOUT=(A,INTRDR)
|
This JCL will be submitted upon closing of the file.
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Feb 17, 2003 9:25 am Post subject: |
|
|
Thanks kolusu!
Diba |
|
Back to top |
|
|
Sridhar Reddy Beginner
Joined: 17 Feb 2003 Posts: 6 Topics: 3
|
Posted: Fri Feb 21, 2003 3:43 am Post subject: |
|
|
Thanks Kolusu
Sridhar |
|
Back to top |
|
|
haseen_mohammed Beginner
Joined: 20 Feb 2006 Posts: 27 Topics: 14
|
Posted: Mon Feb 20, 2006 10:30 am Post subject: |
|
|
hi,
in my program i want to spool a job..ie the jcl should be written to spool and it will execute from there when t spool is closed. how can i easily declare the jcl statements in working storage and use when writing to spool.if i can declare them like an array it will be easier. but how to implement.
some one please help me .. |
|
Back to top |
|
|
|
|