Академический Документы
Профессиональный Документы
Культура Документы
to be dangerous
By Gabe Gargiulo
Aug 1998
Just Enough JCL. Please copy and give away. Mainframe information, downloads http://www.members.aol.com/rexxauthor/mainfram.htm 1
The purpose of this booklet is to get you started with JCL when there is no other way - you don’t
have time to go to a class, don’t want to buy a complete book on it and try to find the things you
need to know.
This is nowhere near being complete. (And its not finished yet) It just gets you going. For the
complete story, contact me about courses in .JCL(and COBOL, SQL, REXX, TSO/ISPF). E mail
address REXXAUTHOR@AOL.COM or see
http://members.aol.com/rexxauthor/courses.htm
JCL Example 2
Sample JCL DD Statements 6
Just Examples 10
JCL Example
2 3 4 5
1 1//TSOUSR1A JOB (12345),’JOE DOKES’,
6 7 8
2 // MSGCLASS=X,CLASS=A,NOTIFY=TSOUSR1
9
3 //* SAMPLE JOB
10 11 12
4 //STEP1 EXEC PGM=SAMPLE1
13 14
5 //STEPLIB DD DSN=TSOUSR1.LOAD,DISP=SHR
15 16 17
6 //INFILE DD DSN=TSOUSR1.DATA(MEMBER),DISP=SHR
18 19
7 //OUTFILE DD SYSOUT=*
20
8 //SYSOUT DD SYSOUT=*
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 2
3
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 3
4
This is the COBOL program that might be used with the above JCL.
The small numbers are notes that will be explained later.
This is not a book on COBOL. For better explanations of COBOL see the
book on COBOL.
IDENTIFICATION DIVISION.
PROGRAM-ID. 'SAMPLE1' 1
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
2
SELECT IN-FILE ASSIGN INFILE. 3
4
SELECT OUT-FILE ASSIGN OUTFILE. 5
DATA DIVISION.
FILE SECTION.
FD IN-FILE 6
RECORD CONTAINS 80 CHARACTERS
RECORDING MODE F.
01 IN-FILE-RECORD PIC X(80).
FD OUT-FILE 7
RECORD CONTAINS 96 CHARACTERS
RECORDING MODE F.
01 OUT-FILE-RECORD PIC X(96).
WORKING-STORAGE SECTION.
77 EOF-FLAG PIC X(3) VALUE SPACE.
PROCEDURE DIVISION.
DISPLAY 'I AM THE SAMPLE1 PROGRAM STARTING' 8
OPEN INPUT IN-FILE 9
OPEN OUTPUT OUT-FILE 10
READ IN-FILE
AT END
DISPLAY 'EMPTY FILE'
MOVE 'EOF' TO EOF-FLAG
END-READ
MOVE IN-FILE-RECORD TO OUT-FILE-RECORD
WRITE OUT-FILE-RECORD
MOVE 'HELLO THERE' TO OUT-FILE-RECORD
WRITE OUT-FILE-RECORD
CLOSE IN-FILE OUT-FILE
DISPLAY 'I AM THE SAMPLE1 PROGRAM ENDING'
GOBACK.
1 This is the program name. With many compile procedures this name
is the name that is used in the JCL
2 The name IN-FILE is a user-chosen name for one of the files
used by this program. This name is used everywhere else in
the program to talk about the file.
3 The name INFILE is the JCL name for the file, officially called
the DDNAME. It is found only once in the program. Its only purpose
is to link the program’s file definition to the JCL’s file definition
known as the DD statement.
The system will use information from both the program and the JCL
to fully define the file. Information found in the program
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 4
5
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 5
6
Some definitions.
Permanent Not deleted until you request it, or for generation datasets, when a dataset
exceeds the limit and is deleted by the system.
Temporary Automatically deleted by the system before the job ends.
Catalogued Everything except temporary is catalogued. Its name is placed in the
system catalog, like a directory, to make it easy to find it later.
Sequential Not VSAM. Records accessed sequentially, from beginning of the file onward.
No random access. No reading backwards.
Generation Type of sequential where the system assign a new name each time
you create a new file.
PDS member A subset of a PDS (Partitioned Data Set) or library. A file within a PDS or library.
PDS A file containing smaller files known as members.
VSAM A file type that is beyond the scope of this book.
Example:
//INFILE DD *
Maria
Christine
/*
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 6
7
Example:
//INFILE DD DSN=MY.DATASET.DATA,DISP=SHR
Example:
//INFILE DD DSN=MY.DATASET.DATA,DISP=OLD
Example:
//INFILE DD DSN=MY.DATASET.DATA(0),DISP=SHR
Example:
//INFILE DD DSN=MY.DATASET.DATA(M1),DISP=SHR
Example:
//INFILE DD DSN=&&TEMP,DISP=(OLD,DELETE)
Example:
//INFILE DD DSN=MY.DATASET.DATA(0),DISP=OLD
Example:
//INFILE DD DUMMY,
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 7
8
Spooled to printer
//ddname dd SYSOUT=printer-class
Example:
//OUTFILE DD SYSOUT=*
Example:
//OUTFILE DD DSN=MY.DATASET.DATA,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,1)
Example:
//ddname DD DSN=MY.DATASET.DATA,DISP=(NEW,CATLG,DELETE),
// UNIT=TAPE
//* other parameters may be required by your company
Example:
//OUTFILE DD DSN=MY.DATASET.DATA(+1),DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,1),
// DCB=MODEL.DSCB optional at some companies. find out your co's name
Permanent disk, new or existing PDS member. Existing member will be overwritten
PDS was Previously Catalogued.
//ddname DD DSN=dataset-name(member-name),DISP=SHR
Example:
//OUTFILE DD DSN=MY.DATASET.DATA(M1),DISP=SHR
Example:
//OUTFILE DD DSN=&&TEMP,DISP=(NEW,PASS,DELETE),
// UNIT=SYSDA,SPACE=(TRK,1)
Example:
//OUTFILE DD UNIT=SYSDA,SPACE=(TRK,1)
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 8
9
Example:
//OUTFILE DD DSN=MY.DATASET.DATA(+1),DISP=(NEW,CATLG,DELETE),
// UNIT=TAPE,
// DCB=MODEL.DSCB optional at some companies. find out your co's name
Example:
//OUTFILE DD DUMMY,
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 9
10
Just Examples
//* GDG1DEF DEFINE A GENERATION DATA GROUP
//GDG1DEF EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG (NAME(TSOUSR1.SAMPLE.GDG.BASE) -
LIMIT(10) NOEMPTY SCRATCH)
/*
//* GDG4DEL THIS WILL DELETE ALL THE MEMBERS OF THE GROUP
//ADIOS EXEC PGM=IEFBR14
//BYEBYE DD DSN=TSOUSR1.SAMPLE.GDG.BASE,DISP=(OLD,DELETE)
DEFINE CLUSTER +
NAME(TSOUSR1.VSAM.KSDS) +
CYLINDERS(1,1) +
KEYS(10,0) +
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 10
11
RECORDSIZE(80,80) +
INDEXED)
/*
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 11
12
DEFINE CLUSTER +
NAME(TSOUSR1.VSAM.ESDS) +
CYLINDERS(1,1) +
RECORDSIZE(80,80) +
NONINDEXED)
/*
DEFINE CLUSTER +
NAME(TSOUSR1.VSAM.RRDS) +
CYLINDERS(1,1) +
RECORDSIZE(80,80) +
NUMBERED)
/*
/*
//INDD DD *
MARIA
CHRISTINE
ANIE
SUSAN
NADIA
/*
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 12
13
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 13
14
http://hometown.aol.com/rexxauthor/mainfram.htm
REXX Reference
Description of all REXX verbs, keywords, and built-in functions as found in MVS,
VM/CMS and OS/2.
About 100 pages. Ready to ship.
Order from MVS Training (800) 356 9093.
http://www.mvs-training.com
More information and information about REXX in general at:
WWW.REXXFILES.COM
SQL Reference
Description of all SQL verbs, keywords, and built-in functions
About 100 pages. More information, ordering,
http://www.members.aol.com/rexxauthor/sqlbk.htm
Just Enough TSO/ISPF. Freeware No copyright. Please copy and give away. 14