Sunteți pe pagina 1din 16

JCL CASE STUDIES

AIXSMPPG
***************************** Top of Data ******************
//LEM15
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP0
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE AIX(NAME(LEM0U15.RAMESH.ALTER1.CLUS) RELATE(LEM0U15.RAMESH.CLUS)
KEYS(10,4)
CYLINDER(2,1)
NONUNIQUEKEY
UPGRADE
RECORDSIZE(18,18)
FREESPACE(10,20)
CONTROLINTERVALSIZE(2048)
)
DATA(NAME(LEM0U15.RAMESH.ALTER1.CLUS.DATA1)) INDEX(NAME(LEMOU15.RAMESH.ALTER1.CLUS.INDEX1))
/*
//
**************************** Bottom of Data ******************

BLDIXSMP

***************************** Top of Data **********


//LEM21
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP1
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//BASECLUST DD DSN=LEM0U02.RAMESH.CLUS1,DISP=SHR
//ALTIN
DD DSN=LEM0U02.RAMESH.ALTER1,DISP=SHR
//IDCUT1
DD DSN= ,DISP=SHR,AMP='AMORG'
//IDCUT2
DD DSN= ,DISP=SHR,AMP='AMORG'
//SYSIN
DD *
BLDINDEX INFILE(BASECLUST) OUTFILE(ALTIN)
/*
//
**************************** Bottom of Data ********

PATH

***************************** Top of Data *************


//LEM02
JOB LEM01,RAMESH,NOTIFY=&SYSUID
//STEP1
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE PATH(NAME(LEM0U02.RAMESH.CLUS2) PATHENTRY(LEM0U02.RAMESH.ALTER1) UPDATE)
/*
//
**************************** Bottom of Data ***********

GDGDS
***************************** Top of Data ************************
//TRN01GD JOB LEM01,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1
EXEC PGM=SEQ1
//STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//DD1
DD DSN=LEM0U11.MADHU1.GDG2(+1),DISP=(NEW,CTLG,DELETE),
//
SPACE=(TRK(2,1)),
//
DCB=(LRECL=80,BLKSIZE=180,RECFM=FB)
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
NANI
44
4000
LAL
33
3000
KAKA
22
2000
/*
//
**************************** Bottom of Data ****

GDGSAMP

***************************** Top of Data ********


//LEM04
JOB LEM01,RAMESH,NOTIFY=&SYSUID
//EXEC1
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE GDG(NAME(LEM0U11.RAMESH.GDG3) LIMIT(5) NOEMPTY SCRATCH )
/*
//
**************************** Bottom of Data ******

IEBCOPY

***************************** Top of Data ***********************


//LEMRAO
JOB LEM01,PARTHI,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1
EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1
DD DSN=LEM0U57.BHASKAR.PDS1,DISP=SHR
//SYSUT2
DD DSN=LEM0U57.BHASKAR.PDS2,DISP=SHR
//*
SPACE=(TRK,(2,3,3),RLSE),
//*
DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
//SYSIN
DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
//
**************************** Bottom of Data *********************

IEBGENER
***************************** Top of Data ******************
//LEMLION JOB LEM01,LION,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1
EXEC PGM=IEBGENER
//SYSPRINT DD *
//SYSUT1
DD DSN=LEM0U11.PARTHI.PPS,DISP=SHR
//SYSUT2
DD DSN=LEM0U11.PARTHI.DOP,DISP=(NEW,CATLG,KEEP),
//
SPACE=(TRK,(2,2),RLSE),
//
DCB=(RECFM=FB,LRECL=13,BLKSIZE=130)
//SYSIN
DD DUMMY
//
**************************** Bottom of Data ****************

INDVSAM
***************************** Top of Data *************
//LEM21
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE CLUSTER(NAME(LEM0U02.RAMESH.CLUS1) VOLUME(LEM001)
CYLINDER(3,1)
CONTROLINTERVALSIZE(4096)
FREESPACE(10,20)
KEY(3,0)
RECORDSIZE(18,18)
INDEXED
)
DATA(NAME(LEM0U02.RAMESH.CLUS1.DATA))
INDEX(NAME(LEM0U02.RAMESH.CLUS1.INDEX))
/*
//
**************************** Bottom of Data ***********

INSTMPRO

***************************** Top of Data *********


//LEMKAI
JOB LEM01,KATHIR,CLASS=Q,NOTIFY=&SYSUID
//PROC1
PROC
/STEP2
EXEC PGM=ADD1
//STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//
PEND
//STEPA
EXEC PROC1
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
**************************** Bottom of Data *******

MERGERUN

***************************** Top of Data *******************


//LEMSEQ
JOB LEM01,DEEPA,CLASS=Q,MSGCLASS=X,
//
NOTIFY=&SYSUID,REGION=0M
//STEP1
EXEC PGM=MERGEPGM
//STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT
DD SYSOUT=*
//DD1
DD DSN=LEM0U03.DEEPA.PS8,DISP=SHR
//DD2
DD DSN=LEM0U03.DEEPA.PS4,DISP=SHR
//DD3
DD
//DD4
DD DSN=LEM0U03.DEEPA.PS3,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(2,2),RLSE),
//
DCB=(LRECL=12,BLKSIZE=120,RECFM=FB)
//SYSIN
DD DUMMY
//
**************************** Bottom of Data *****************

CATALOG PROCEDURE

(PROCED)
***************************** Top of Data ************
//PROC1 PROC
//STEP1
EXEC PGM=ADDPGM
//STEPLIB
DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
**************************** Bottom of Data **********

CALL PROCEDURE JCL


***************************** Top of Data ********************
//LEM19
JOB LEM01,PARTHI,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//PROCLIB JCLLIB ORDER=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//STEP3
EXEC PROCED
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
040
050
/*
//
**************************** Bottom of Data ******************
PRUN
***************************** Top of Data ***********
//LEMKAT
JOB LEM01,KATHIR,CLASS=Q,NOTIFY=&SYSUID
//PROCLIB JCLLIB ORDER=LEM0U03.KATHIR.COBOL
//STEPX
EXEC CPROC
//SYSPRINT DD SYSOUT=*
//STEP1.SYSIN DD *
10
20
/*
//STEP2.SYSIN DD *
20
10
/*
//
**************************** Bottom of Data *********

CPROC
***************************** Top of Data **********
//STEP1
EXEC PGM=ADD1
//STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//STEP2
EXEC PGM=SUB1
//STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
**************************** Bottom of Data ********

RELVSAM - RLSE
***************************** Top of Data *********
//LEM03Q
JOB LEM01,VIJAY,CLASS=Q,NOTIFY=&SYSUID
//STEPQ
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE CLUSTER(
NAME(LEM0U03.VIJY.RRDS)
TRK(2,2)
CISZ(4096)
RECORDSIZE(12,12)
NUMBERED
)
DATA(
NAME(LEM0U03.VIJY.DATA1))
/*
//
**************************** Bottom of Data *******
SEQRNJCL SEQUENTIAL RUN JCL
***************************** Top of Data ***********************
//LEMSEQ JOB 'LEM01',LUX,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//JOBLIB
DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//STEP1
EXEC PGM=SEQFILE
//DD1
DD DSN=LEM0U019.RAJESH.COBOL,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(2,2),RLSE),
//
DCB=(LRECL=18,BLKSIZE=180,RECFM=FB)
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
27
RAJ
Y
30
JAY
NO
/*
//
**************************** Bottom of Data *********************

SEQVSAM SEQUENTIAL VSAM

***************************** Top of Data *****************


//LEM21
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP0
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE CLUSTER(NAME(LEM0U02.RAMESH.CLUS2) VOLUME(LEM01)
CYLINDER(2,1)
CONTROLINTERVALSIZE(4096)
RECORDSIZE(13,13)
NONINDEXED
)
DATA (NAME(LEM0U02.RAMESH.CLUS2.DATA)
/*
//
**************************** Bottom of Data ***************

SORTRUN SORTING RUNJCL

***************************** Top of Data **************************


//LEMSEQ
JOB LEM01,DEEPA,CLASS=Q,MSGCLASS=X,
//
NOTIFY=&SYSUID,REGION=0M
//STEP1
EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT
DD SYSOUT=*
//*STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//SORTIN
DD DSN=LEM0U06.ANUSHA.PS5,DISP=SHR
//SORTWRK
DD SPACE=(TRK,(2,2),RLSE)
//SORTOUT
DD DSN=LEM0U05.DEEPA.PSC1,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(2,2),RLSE),
//
DCB=(LRECL=12,BLKSIZE=120,RECFM=FB)
//SYSIN
DD *
SORT FIELDS=(1,2,CH,A)
/*
//
**************************** Bottom of Data ************************

SORTUTIL SORT UTILITY


***************************** Top of Data ********************
//LEMKAR
JOB LEM01,'LUX',CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1
EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT
DD SYSOUT=*
//SORTIN
DD DSN=LEM0U64.BALU.PS1,DISP=SHR
//SORTOUT DD DSN=LEM0U68.KARTHI.PS3,DISP=OLD
//*
SPACE=(TRK,(3,1),RLSE),
//*
DCB=(LRECL=13,BLKSIZE=130,RECFM=FB)
//SYSIN
DD
*
SORT FIELDS=(1,2,CH,A)
/*
//
**************************** Bottom of Data ******************

UTILREPR REPRO - UTILITY

***************************** Top of Data *********


//LEM21
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP2
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DDIN
DD DSN=LEM0U02.RAMESH.CLUS,DISP=SHR
//DDOUT
DD DSN=LEM0U02.RAMESH.CLUS2,DISP=SHR
//SYSIN
DD *
REPRO
INFILE(DDIN) OUTFILE(DDOUT)
/*
//
**************************** Bottom of Data *******
LEM0U97.KKG.COBOLPGM(EMPWRT) - 01.05
000001
000002
000003
000004
000005
000006
000007
000008
000009
000010
000011
000012
000013
000014
000015
000016
000017
000018
000019
000020
000021
000022
000023
000024
000025
000026
000027
000028
000029

IDENTIFICATION DIVISION.
PROGRAM-ID.
EMPWRT.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT EMPFILE ASSIGN TO AS-EMP1
FILE STATUS IS FS.
DATA DIVISION.
FILE SECTION.
FD EMPFILE
LABEL RECORDS ARE STANDARD.
01 EMP-REC.
02 EMPNO PIC X(5).
02 EMPNAME PIC X(10).
WORKING-STORAGE SECTION.
77 EOF PIC X.
77 FS PIC XX.
PROCEDURE DIVISION.
M-PARA.
OPEN OUTPUT EMPFILE.
PERFORM WRT-PARA UNTIL EOF = "N".
CLOSE EMPFILE.
STOP RUN.
WRT-PARA.
ACCEPT EMPNO.
ACCEPT EMPNAME.
WRITE EMP-REC.
ACCEPT EOF.
DISPLAY FS.

EDIT
LEM0U99.KKG.DEMO12(INDWRI)
****** ***************************** Top of Data ******
000001
IDENTIFICATION DIVISION.
000002
PROGRAM-ID. INDWRI.
000003
ENVIRONMENT DIVISION.
000004
INPUT-OUTPUT SECTION.
000005
FILE-CONTROL.
000006
SELECT EMP-FILE ASSIGN TO DD1
000007
ORGANIZATION IS INDEXED
000008
ACCESS MODE IS DYNAMIC
000009
RECORD KEY IS ENO.
000010
DATA DIVISION.
000011
FILE SECTION.
000012
FD EMP-FILE.
000013
01 EMP-REC.
000014
02 ENO PIC 9(3).
000015
02 ENAME PIC X(10).
000016
WORKING-STORAGE SECTION.
000017
77 CH1 PIC X VALUE IS "Y".
000018
PROCEDURE DIVISION.
000019
MAIN-PARA.
000020
OPEN OUTPUT EMP-FILE.
000021
PERFORM WRITE-PARA UNTIL CH1 = "N".
000022
CLOSE EMP-FILE.
000023
STOP RUN.
000024
WRITE-PARA.
000025
ACCEPT ENO.
000026
ACCEPT ENAME.
000027
WRITE EMP-REC.
000028
ACCEPT CH1.
EDIT
******
000100
000200
000300
000400
000500
000600
000700
000800
000900
001000
001100
001110
001200
001300
001310
001400
001500

LEM0U99.KKG.DEMO12(INDVSAM) ***************************** Top of Data *****************


//LEMKK
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE CLUSTER(NAME(LEM0U99.RAMESH.CLUS1) VOLUME(LEM001)
TRACKS(2,2)
CONTROLINTERVALSIZE(4096)
FREESPACE(10,20)
KEY(3,0)
RECORDSIZE(13,13)
INDEXED
)
DATA(NAME(LEM0U99.RAMESH.CLUS1.DATA))
INDEX(NAME(LEM0U99.RAMESH.CLUS1.INDEX))
/*
//

EDIT
******
000001
000002
000003
000004
000005
000006
000007
000008
000009
000010
000011
000012
000013
000014
000015
000016
000017
000018

LEM0U99.KKG.DEMO12(INDRUN) - 01.04
***************************** Top of Data ********
//LEMSURI JOB LEM01,'GEETHA',CLASS=Q,MSGCLASS=X,
//
NOTIFY=&SYSUID
//STEP1
EXEC PGM=INDWRI
//STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//DD1
DD DSN=LEM0U99.RAMESH.CLUS1,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
100
KKG
Y
200
ASHOK
Y
300
BASIL
N
/*
//

CKUMS PROGRAM -

IEBCOPY DEMO.

WORKING WELL

//*********************************************//
//* JCL PROGRAM TO COPY MEMBERS FROM PDS TO PDS
//*********************************************//
//LEMCPY JOB LEM01,CKUMS,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1
DD DSN=LEM0U05.CKUMS.COBOL,DISP=SHR
//SYSUT2
DD DSN=LEM0U02.CKUMS.JCL,DISP=SHR
//SYSIN
DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
//

IEBGENER

***************************** Top of Data *********************


//LT03BA
JOB 28104,BABY,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1
EXEC PGM=IEBGENER
//SYSUT1
DD DSN=LT03.BABY.PS,DISP=SHR
//SYSUT2
DD DSN=LT03.BABY.PS6,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(2,1),RLSE),
//
DCB=(LRECL=19,BLKSIZE=190,RECFM=FB)
//SYSPRINT DD SYSOUT=*
//SYSIN
DD DUMMY
//

1.NAME : AIXPROGRAM.
-------------------//LEM15
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP0
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE AIX(NAME(LEM0U15.RAMESH.ALTER1.CLUS) RELATE(LEM0U15.RAMESH.CLUS)
KEYS(10,4)
CYLINDER(2,1)
NONUNIQUEKEY
UPGRADE
RECORDSIZE(18,18)
FREESPACE(10,20)
CONTROLINTERVALSIZE(2048)
)
DATA(NAME(LEM0U15.RAMESH.ALTER1.CLUS.DATA1)) INDEX(NAME(LEMOU15.RAMESH.ALTER1.CLUS.INDEX1))
/*
//
2.NAME : BLDIXSMP
//LEM21
JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
//STEP1
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//BASECLUST DD DSN=LEM0U02.RAMESH.CLUS1,DISP=SHR
//ALTIN
DD DSN=LEM0U02.RAMESH.ALTER1,DISP=SHR
//IDCUT1
DD DSN= ,DISP=SHR,AMP='AMORG'
//IDCUT2
DD DSN= ,DISP=SHR,AMP='AMORG'
//SYSIN
DD *
BLDINDEX INFILE(BASECLUST) OUTFILE(ALTIN)
/*
//
3: NAME : GDG
//LEM04
//EXEC1
//SYSPRINT
//SYSIN

/*
//

JOB LEM01,RAMESH,NOTIFY=&SYSUID
EXEC PGM=IDCAMS
DD SYSOUT=*
DD *
DEFINE GDG(NAME(LEM0U11.RAMESH.GDG3) LIMIT(5) NOEMPTY SCRATCH )

4:NAME : IEBCOPY
//LEMRAO
//STEP1
//SYSPRINT
//SYSUT1
//SYSUT2
//*
//*

JOB LEM01,PARTHI,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
EXEC PGM=IEBCOPY
DD SYSOUT=*
DD DSN=LEM0U57.BHASKAR.PDS1,DISP=SHR
DD DSN=LEM0U57.BHASKAR.PDS2,DISP=SHR
SPACE=(TRK,(2,3,3),RLSE),
DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)

10

//SYSIN

DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2

/*
//
5: NAME : IEBGENER
//LEMLION
//STEP1
//SYSPRINT
//SYSUT1
//SYSUT2
//
//
//SYSIN
//

JOB LEM01,LION,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
EXEC PGM=IEBGENER
DD *
DD DSN=LEM0U11.PARTHI.PPS,DISP=SHR
DD DSN=LEM0U11.PARTHI.DOP,DISP=(NEW,CATLG,KEEP),
SPACE=(TRK,(2,2),RLSE),
DCB=(RECFM=FB,LRECL=13,BLKSIZE=130)
DD DUMMY

6: NAME : INDVSAM
//LEM21
//STEP
//SYSPRINT
//SYSIN

/*
//

JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
EXEC PGM=IDCAMS
DD SYSOUT=*
DD *
DEFINE CLUSTER(NAME(LEM0U02.RAMESH.CLUS1) VOLUME(LEM001)
CYLINDER(3,1)
CONTROLINTERVALSIZE(4096)
FREESPACE(10,20)
KEY(3,0)
RECORDSIZE(18,18)
INDEXED
)
DATA(NAME(LEM0U02.RAMESH.CLUS1.DATA))
INDEX(NAME(LEM0U02.RAMESH.CLUS1.INDEX))

7 : NAME :INSTREAMPROCEDURE
//LEMKAI
JOB LEM01,KATHIR,CLASS=Q,NOTIFY=&SYSUID
//PROC1
PROC
/STEP2
EXEC PGM=ADD1
//STEPLIB DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//
PEND
//STEPA
EXEC PROC1
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
8:NAME:MERGERUN
//LEMSEQ
//
//STEP1
//STEPLIB
//SYSPRINT
//SYSOUT
//DD1
//DD2

JOB LEM01,DEEPA,CLASS=Q,MSGCLASS=X,
NOTIFY=&SYSUID,REGION=0M
EXEC PGM=MERGEPGM
DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
DD SYSOUT=*
DD SYSOUT=*
DD DSN=LEM0U03.DEEPA.PS8,DISP=SHR
DD DSN=LEM0U03.DEEPA.PS4,DISP=SHR

11

//DD3
//DD4
//
//
//SYSIN
//

DD
DD DSN=LEM0U03.DEEPA.PS3,DISP=(NEW,CATLG,DELETE),
SPACE=(TRK,(2,2),RLSE),
DCB=(LRECL=12,BLKSIZE=120,RECFM=FB)
DD DUMMY

9.NAME: PATH
//LEM02
//STEP1
//SYSPRINT
//SYSIN

JOB LEM01,RAMESH,NOTIFY=&SYSUID
EXEC PGM=IDCAMS
DD SYSOUT=*
DD *
DEFINE PATH(NAME(LEM0U02.RAMESH.CLUS2) PATHENTRY(LEM0U02.RAMESH.ALTER1) UPDATE)

/*
//
10 : NAME :PROCEDURE
//PROC1 PROC
//STEP1
EXEC PGM=ADDPGM
//STEPLIB
DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
11:NAME:PROCEDURE RUNNING
//LEMKAT
JOB LEM01,KATHIR,CLASS=Q,NOTIFY=&SYSUID
//PROCLIB JCLLIB ORDER=LEM0U03.KATHIR.COBOL
//STEPX
EXEC CPROC
//SYSPRINT DD SYSOUT=*
//STEP1.SYSIN DD *
10
20
/*
//STEP2.SYSIN DD *
20
10
/*
//
12 : NAME :RELATIVE VSAM
//LEM03Q
JOB LEM01,VIJAY,CLASS=Q,NOTIFY=&SYSUID
//STEPQ
EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
DEFINE CLUSTER(
NAME(LEM0U03.VIJY.RRDS)
TRK(2,2)
CISZ(4096)
RECORDSIZE(12,12)
NUMBERED
)
DATA(
NAME(LEM0U03.VIJY.DATA1))
/*
//

12

13:NAME: SEQUENTIAL RUNJCL


//LEMSEQ JOB 'LEM01',LUX,CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//JOBLIB
DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
//STEP1
EXEC PGM=SEQFILE
//DD1
DD DSN=LEM0U019.RAJESH.COBOL,DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(2,2),RLSE),
//
DCB=(LRECL=18,BLKSIZE=180,RECFM=FB)
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
27
RAJ
Y
30
JAY
NO
/*
//
14: NAME :SEQUENTIAL VSAM
//LEM21
//STEP0
//SYSPRINT
//SYSIN

/*
//

JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
EXEC PGM=IDCAMS
DD SYSOUT=*
DD *
DEFINE CLUSTER(NAME(LEM0U02.RAMESH.CLUS2)
VOLUME(LEM01)
CYLINDER(2,1)
CONTROLINTERVALSIZE(4096)
RECORDSIZE(13,13)
NONINDEXED
)
DATA (NAME(LEM0U02.RAMESH.CLUS2.DATA)

15: NAME :SORT RUN


//LEMSEQ
//
//STEP1
//SYSPRINT
//SYSOUT
//*STEPLIB
//SORTIN
//SORTWRK
//SORTOUT
//
//
//SYSIN
/*
//

JOB LEM01,DEEPA,CLASS=Q,MSGCLASS=X,
NOTIFY=&SYSUID,REGION=0M
EXEC PGM=SORT
DD SYSOUT=*
DD SYSOUT=*
DD DSN=LEM0U01.LEMCICS.LOAD1,DISP=SHR
DD DSN=LEM0U06.ANUSHA.PS5,DISP=SHR
DD SPACE=(TRK,(2,2),RLSE)
DD DSN=LEM0U05.DEEPA.PSC1,DISP=(NEW,CATLG,DELETE),
SPACE=(TRK,(2,2),RLSE),
DCB=(LRECL=12,BLKSIZE=120,RECFM=FB)
DD *
SORT FIELDS=(1,2,CH,A)

13

16: NAME SORT UTILITY


//LEMKAR
JOB LEM01,'LUX',CLASS=Q,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1
EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT
DD SYSOUT=*
//SORTIN
DD DSN=LEM0U64.BALU.PS1,DISP=SHR
//SORTOUT DD DSN=LEM0U68.KARTHI.PS3,DISP=OLD
//*
SPACE=(TRK,(3,1),RLSE),
//*
DCB=(LRECL=13,BLKSIZE=130,RECFM=FB)
//SYSIN
DD
*
SORT FIELDS=(1,2,CH,A)
/*
//
17 : NAME :UTILITY REPRO
//LEM21
//STEP2
//SYSPRINT
//DDIN
//DDOUT
//SYSIN

JOB LEM01,RAMESH,CLASS=Q,NOTIFY=&SYSUID
EXEC PGM=IDCAMS
DD SYSOUT=*
DD DSN=LEM0U02.RAMESH.CLUS,DISP=SHR
DD DSN=LEM0U02.RAMESH.CLUS2,DISP=SHR
DD *
REPRO
INFILE(DDIN) OUTFILE(DDOUT)

/*
//

14

RELATIVE FILE - WRITE METHOD


****** ***************************** Top of Data *******
000001
IDENTIFICATION DIVISION.
000002
PROGRAM-ID. IND.
000003
ENVIRONMENT DIVISION.
000004
INPUT-OUTPUT SECTION.
000005
FILE-CONTROL.
000006
SELECT F1 ASSIGN TO OLF
000007
ORGANIZATION IS INDEXED
000008
ACCESS MODE IS RANDOM
000009
FILE STATUS IS FS.
000010
DATA DIVISION.
000011
FILE SECTION.
000012
FD F1.
000013
01 EMP-REC.
000014
02 EMPNO PIC 99.
000015
02 EMPNAME PIC A(10).
000016
02 EMPSALARY PIC 9(5).
000017
WORKING-STORAGE SECTION.
000018
77 C PIC X VALUE 'Y'.
000009
FILE STATUS IS FS.
000010
DATA DIVISION.
000011
FILE SECTION.
000012
FD F1.
000013
01 EMP-REC.
000014
02 EMPNO PIC 99.
000015
02 EMPNAME PIC A(10).
000016
02 EMPSALARY PIC 9(5).
000017
WORKING-STORAGE SECTION.
000018
77 C PIC X VALUE 'Y'.
000019
77 FS PIC XX.
000020
PROCEDURE DIVISION.
000021
MAIN-PARA.
000022
PERFORM OPEN-PARA.
000023
PERFORM WRITE-PARA UNTIL C = 'N'.
000024
PERFORM CLOSE-PARA.
000025
STOP RUN.
000026
OPEN-PARA.
000027
OPEN OUTPUT F1.
000018
77 C PIC X VALUE 'Y'.
000019
77 FS PIC XX.
000020
PROCEDURE DIVISION.
000021
MAIN-PARA.
000022
PERFORM OPEN-PARA.
000023
PERFORM WRITE-PARA UNTIL C = 'N'.
000024
PERFORM CLOSE-PARA.
000025
STOP RUN.
000026
OPEN-PARA.
000027
OPEN OUTPUT F1.
000028
WRITE-PARA.
000029
ACCEPT EMPNO.
000030
ACCEPT EMPNAME.
000031
ACCEPT EMPSALARY.
000032
WRITE EMP-REC.
000033
ACCEPT C.
000034
CLOSE-PARA.
000035
CLOSE F1.
****** **************************** Bottom of Data ************

15

INDEXED FILE HANDLING - WRITE


****** ***************************** Top of Data ******
000100
IDENTIFICATION DIVISION.
000200
PROGRAM-ID. INDXD.
000300
ENVIRONMENT DIVISION.
000400
INPUT-OUTPUT SECTION.
000500
FILE-CONTROL.
000600
SELECT FLE ASSIGN TO OLF
000700
ORGANIZATION IS INDEXED
000800
ACCESS MODE IS RANDOM
000900
RECORD KEY IS ENO
001000
FILE STATUS IS FS.
001100
DATA DIVISION.
001200
FILE SECTION.
001300
FD FLE.
001400
01 INREC.
001500
02 ENO PIC 99.
001600
02 ENAME PIC X(10).
001700
02 ESAL PIC 9(5).
001800
WORKING-STORAGE SECTION.
000900
RECORD KEY IS ENO
001000
FILE STATUS IS FS.
001100
DATA DIVISION.
001200
FILE SECTION.
001300
FD FLE.
001400
01 INREC.
001500
02 ENO PIC 99.
001600
02 ENAME PIC X(10).
001700
02 ESAL PIC 9(5).
001800
WORKING-STORAGE SECTION.
001900
77 FS PIC X(2).
002000
77 C PIC X VALUE "Y".
002100
PROCEDURE DIVISION.
002200
P1.
002300
OPEN OUTPUT FLE.
002400
PERFORM P2 UNTIL C = "N".
002500
CLOSE FLE.
002600
STOP RUN.
002700
P2.
001800
WORKING-STORAGE SECTION.
001900
77 FS PIC X(2).
002000
77 C PIC X VALUE "Y".
002100
PROCEDURE DIVISION.
002200
P1.
002300
OPEN OUTPUT FLE.
002400
PERFORM P2 UNTIL C = "N".
002500
CLOSE FLE.
002600
STOP RUN.
002700
P2.
002800
ACCEPT ENO.
002900
ACCEPT ENAME.
003000
ACCEPT ESAL.
003100
WRITE INREC.
003200
ACCEPT C.

16