大型机 Cobol Mainframe jcl - 图文

更新时间:2023-10-11 15:48:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

1 将文件内容在系统中输出

//CN001000 JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID //STEP1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=CN0010.XCY.JCL3,DISP=SHR //SYSUT2 DD SYSOUT=* //SYSIN DD DUMMY

2 cond的用法,设置判断返回参数以决定是否执行本作业步

//CN001000 JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * SET MAXCC=8 /* //**************************************************************

//STEP2 EXEC PGM=IEBGENER,COND=(8,NE,STEP1) //SYSPRINT DD SYSOUT=* //SYSUT1 DD * XCY IS A GOOD BOY! /* //SYSUT2 DD SYSOUT=* //SYSIN DD DUMMY //*******************************************************************

//STEP3 EXEC PGM=IEBGENER,COND=(8,EQ,STEP1) //SYSPRINT DD SYSOUT=* //SYSUT1 DD * YES HE IS. /* //SYSUT2 DD SYSOUT=* //SYSIN DD DUMMY

3 将两个sds文件复制到一个已有的文件当中

//CN001009 JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID //STEP1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=CN0010.XCY.JCL1,DISP=SHR // DD DSN=CN0010.XCY.JCL2,DISP=SHR //SYSUT2 DD DSN=CN0010.XCY.JCL3,DISP=SHR //SYSIN DD DUMMY

4 将一个sds中的数据一部分复制到一个新建立的sds当中,record选择范围

//CN001000 JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID //COPY EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=CN0010.XCY.JCL1,DISP=SHR //SYSUT2 DD DSN=CN0010.XCY.JCL5,DISP=(NEW,CATLG), // UNIT=SYSDA,SPACE=(CYL,(1,1)), // DCB=(RECFM=FB,LRECL=40,BLKSIZE=800) //SYSIN DD * GENERATE MAXFLDS=5,MAXLITS=4 RECORD FIELD=(5,1,,1),FIELD=(20,21,,6),FIELD=(9,61,ZP,26), FIELD=(9,70,ZP,31),FIELD=(4,'TEST',,36) /*

5 临时数据集的应用

//CN001000 JOB NOTIFY=&SYSUID,MSGLEVEL=(1,1) //BUILD EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD * XCY IS A GOOD BOY //SYSUT2 DD DSN=&&TEMP1,DISP=(,PASS), // SPACE=(TRK,(1,1)),DCB=(LRECL=80,RECFM=FB), // UNIT=SYSDA //SYSIN DD DUMMY //**************************************************************** //BUILD2 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=&&TEMP1,DISP=(OLD,DELETE) //SYSUT2 DD DSN=CN0010.XCY.DATA,DISP=(,CATLG,DELETE), // SPACE=(TRK,(1,1)),DCB=(LRECL=80,RECFM=FB), // UNIT=SYSDA //SYSIN DD DUMMY

6 将一个sds内容复制到新建立的pds的一个member中

//CN001027 JOB NOTIFY=&SYSUID,MSGLEVEL=(1,1) //STEP1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=CN0010.XCY727.SDS,DISP=SHR //SYSUT2 DD DSN=CN0010.XCY727.XCC(XCY1),DISP=(NEW,CATLG), // SPACE=(TRK,(1,1,1)),VOL=SER=SUER01,UNIT=SYSDA //SYSIN DD DUMMY

X

7 将sds排序输出到另一个sds中,sort field选择排序范围

//CN001027 JOB NOTIFY=&SYSUID,MSGLEVEL=(1,1) //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=CN0010.XCY727.SDS,DISP=SHR //SORTOUT DD DSN=CN0010.XCY727.SDS2,DISP=SHR //SYSIN DD * SORT FIELDS=(1,2,CH,A,9,3,CH,A) /*

8将sds排序并去除重复项,输出到另一个sds中

//CN001027 JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=CN0010.XCY727.SDS,DISP=SHR //SORTOUT DD DSN=CN0010.XCY727.SDS2,DISP=SHR //SYSIN DD * SORT FIELDS=(1,3,CH,A) SUM FIELDS=NONE /*

8 根据排序情况将sds内容分为三个sds,去除重复

//CN001027 JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=CN0010.XCY727.SDS,DISP=SHR //SORTOF01 DD DSN=CN0010.XCY727.SDS3,DISP=(NEW,CATLG), // SPACE=(CYL,(1,4),RLSE),DCB=(LRECL=80,RECFM=FB,BLKSIZE=80) //SORTOF02 DD DSN=CN0010.XCY727.SDS4,DISP=(NEW,CATLG), // SPACE=(CYL,(1,4),RLSE),DCB=(LRECL=80,RECFM=FB,BLKSIZE=80) //SORTOF03 DD DSN=CN0010.XCY727.SDS5,DISP=(NEW,CATLG), // SPACE=(CYL,(1,4),RLSE),DCB=(LRECL=80,RECFM=FB,BLKSIZE=80) //SYSIN DD * SORT FIELDS=COPY OUTFIL FILES=01,INCLUDE=(1,6,CH,EQ,C'MOHANK') OUTFIL FILES=02,INCLUDE=(1,6,CH,EQ,C'SURESH') OUTFIL FILES=03,INCLUDE=(1,6,CH,EQ,C'KRISHN') /*

9 创建gdg

//CN001027 JOB NOTIFY=CN0010 //******************************** //* CREATE A GDG * //********************************

//GDGCREAT EXEC PGM=IDCAMS //GDGMODEL DD DSN=CN0010.XCY27.GDGMDL,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(0)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000,DSORG=PS) //SYSPRINT DD SYSOUT=* //SYSIN DD *

DEFINE GDG (NAME(CN0010.XCY27.GDG) LIMIT(100) /*

10 在gdg中创建两个数据集

//CN001027 JOB NOTIFY=CN0010 //********************************** //* CREATE 2 DATASETS IN A GDG * //**********************************

//CDS1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD * THIS LINE IS WRITTEN INTO DATASET IN GDG. //SYSUT2 DD DSN=CN0010.XCY27.GDG(+1),DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(1,1)),DCB=CN0010.XCY27.GDGMDL //SYSIN DD DUMMY //CDS2 EXEC PGM=IEFBR14 //GDG DD DSN=CN0010.XCY27.GDG(+2),DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(5,5)),DCB=CN0010.XCY27.GDGMDL

11 删除gdg

//CN001027 JOB NOTIFY=CN0010 //************************************

//* BEFORE DELETING A GDG,WE MUST * //* DELETE ALL DATASET IN IT. * //************************************

//DELDS EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE CN0010.XCY27.GDG.* DELETE CN0010.XCY27.GDGMDL

//**************************************

//DELGDG EXEC PGM=IDCAMS,COND=(0,NE) //SYSPRINT DD SYSOUT=* //SYSIN DD *

DELETE CN0010.XCY27.GDG GDG /*

12 将两组数据排序进两个sds,再用merge合并排序

//CN001000 JOB NOTIFY=CN0010 //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * MOHANK 23423423434534344 KIRAN MOHANK 13342345345345345 RAJEEV ARAMES 34535345325354324 SURESH SURESH 98347385385933987 PULI //SORTOUT DD DSN=CN0010.XCY727.SDS,DISP=SHR //SYSIN DD * SORT FIELDS=(1,5,CH,A) //STEP2 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD *

RAMESH 67575789769876785 MADHU KRISHN 50830948530859340 OIIED KRISHN 30495849572938495 MADHU

SURESH 98347385385933987 PULI //SORTOUT DD DSN=CN0010.XCY727.SDS3,DISP=SHR //SYSIN DD * SORT FIELDS=(1,5,CH,A) //STEP3 EXEC PGM=ICEMAN,COND=(0,NE) //SYSOUT DD SYSOUT=* //SORTIN01 DD DSN=CN0010.XCY727.SDS,DISP=SHR //SORTIN02 DD DSN=CN0010.XCY727.SDS3,DISP=SHR //SORTOUT DD DSN=CN0010.XCY727.SDS4,DISP=SHR //SYSIN DD * MERGE FIELDS=(1,5,CH,A) /*

本文来源:https://www.bwwdw.com/article/41nf.html

Top