1. IEFBR14
//* JCL for creating PDS
//STEP01 EXEC
PGM=IEFBR14
//DD1 DD
DSN=IDXXXXX.SRIBB.PDS,
// DISP=(NEW,KEEP,DELETE),
// SPACE=(TRK,(2,2,6),RLSE),
//
DCB=(LRECL=80,BLKSIZE=800,RECFM=FB),DSORG=PO
//SYSPRINT DD SYSOUT=*
//SYSOUT DD
SYSOUT=*
//SYSIN DD
DUMMY
2. IEBGENER
//* INLINE DATA move to PS
//STEP01 EXEC
PGM=IEBGENER
//SYSUT1 DD
*
12345
1234
123
12
1
/*
//SYSUT2 DD
DSN=IDxxxxx.YY.PS,
//
DISP=(MOD,KEEP,DELETE),
//
SPACE=(TRK,(2,2,0),RLSE), //
DCB=(LRECL=80,BLKSIZE=800,RECFM=FB),DSORG=PS
//SYSPRINT DD
SYSOUT=*
//SYSOUT DD
SYSOUT=*
//SYSIN DD
DUMMY
//* Copying 1 PS to another new PS
//STEP01 EXEC
PGM=IEBGENER
//SYSUT1 DD
DSN=IDxxxxx.X.PS,
// DISP=(SHR,KEEP,KEEP)
//SYSUT2 DD
DSN=IDxxxxx.XX.PS,
// DISP=(NEW,KEEP,KEEP),
// LIKE=IDxxxxx.X.PS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD
SYSOUT=*
//SYSIN DD
DUMMY
//* Merging 2 PS to 1 PS
//STEP01 EXEC
PGM=IEBGENER
//SYSUT1 DD
DSN=IDxxxxx.X.PS,
// DISP=(SHR,KEEP,KEEP)
// DD
DSN=IDxxxxx.YY.PS,
// DISP=(SHR,KEEP,KEEP)
//SYSUT2 DD
DSN=IDxxxxx.ZZ.PS,
// DISP=(NEW,KEEP,KEEP),
// LIKE=IDxxxxx.X.PS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD
SYSOUT=*
//SYSIN DD
DUMMY
3. SORT
//* Using SUM FIELDS to remove duplicates
//STEP01 EXEC
PGM=SORT
//SORTIN DD DSN=IDxxxxx.SRI.SORT.PS,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(16,3,CH,A)
SUM FIELDS=(2,4,ZD)
/*
//* INREC Fields
//STEP01 EXEC
PGM=SORT
//SORTIN DD DSN=IDxxxxx.SRI.SORT.PS,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(2,4,16,2,30,3)
SORT FIELDS=(1,4,CH,D)
INCLUDE COND=(30,3,CH,EQ,C'ECE')
/*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*CREATING MULTIPLE FILES OUT OF MY SINGLE INPUT FILE based on
conditions.
// SET A=IDxxxxx.SRI.SORT.PS
// SET B=IDXXXXX.MADU.PS
// SET C=IDXXXXX.CHENNAI.PS
// SET D=IDXXXXX.TRI.PS
//STEP01 EXEC PGM=SORT
//SORTIN DD
DSN=&A.,DISP=SHR
//SORTOF1 DD
DSN=&B.,DISP=(MOD,KEEP),LIKE=IDXXXXX.SRI.SORT.PS
//SORTOF2 DD
DSN=&C.,DISP=(MOD,KEEP),LIKE=IDXXXXX.SRI.SORT.PS
//SORTOF3 DD
DSN=&D.,DISP=(MOD,KEEP),LIKE=IDXXXXX.SRI.SORT.PS
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=1,STARTREC=1,STOPAFT=2
OUTFIL FILES=2,STARTREC=3,STOPAFT=2
/*
//*OUTFIL
FILES=1,INCLUDE=(55,7,CH,EQ,C'MADU ')
//* OUTFIL
FILES=2,INCLUDE=(55,7,CH,EQ,C'CHENNAI')
//* OUTFIL FILES=3,INCLUDE=(55,7,CH,EQ,C'TRI ')
//*STARTREC=5,ENDREC=10
//*ENDREC=30
//*TESTING
//STEP1 EXEC PGM=IEFBR14
//DD1 DD
DSN=IDxxxxx.INPUT.PS,DISP=(MOD,KEEP),
// LIKE=IDxxxxx.SMALL.PS
//DD2 DD
DSN=IDxxxxx.OUTPUT.PS1,DISP=(MOD,KEEP),
// LIKE=IDxxxxx.SMALL.PS
//DD3 DD
DSN=IDxxxxx.OUTPUT.PS2,DISP=(MOD,KEEP),
// LIKE=IDxxxxx.SMALL.PS
//DD4 DD
DSN=IDxxxxx.OUTPUT.PS3,DISP=(MOD,KEEP),
// LIKE=IDxxxxx.SMALL.PS
//SYSPRINT DD SYSOUT=*
//SYSIN DD
DUMMY
//STEP2 EXEC PGM=IEBGENER
//SYSUT1 DD *
1001 TOMANDJERRY
USA 50000
1002 MOLE
GERMANY 40000
1003 MADAGASKAR
UK 45000
1004 TOYSTORY
USA 45000
1005 KUNFUPANDA
CHINA 45000
1006 KRISHNA
INDIA 30000
1007 GANESHA
INDIA 30000
1008 HEMAN
GERMANY 45000
1009 HITMAN
USA 45000
1010 MASK
UK 50000
1011 SPIDERMAN
UK 50000
1012 UP
USA 50000
1013 FINDINGNEMO
USA 50000
1014 CHICKENRUN
USA 50000
1015 RATATOULLE
USA 50000
/*
//SYSUT2 DD DSN=IDxxxxx.INPUT.PS,DISP=(SHR,KEEP,KEEP)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY
//STEP3 EXEC PGM=SORT
//SORTIN DD DSN=IDxxxxx.INPUT.PS,DISP=(SHR,KEEP,KEEP)
//SORTOF1 DD DSN=IDxxxxx.OUTPUT.PS1,DISP=(MOD,KEEP,KEEP)
//SORTOF2 DD
DSN=IDxxxxx.OUTPUT.PS2,DISP=(MOD,KEEP,KEEP)
//SORTOF3 DD
DSN=IDxxxxx.OUTPUT.PS3,DISP=(MOD,KEEP,KEEP)
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(20,7,CH,A)
OUTFIL FILES=1,INCLUDE=(1,4,CH,LE,C'1006')
OUTFIL
FILES=2,INCLUDE=(1,4,CH,GE,C'1007',AND,1,4,CH,LE,C'1012')
OUTFIL
FILES=3,INCLUDE=(1,4,CH,GE,C'1013')
/*
No comments:
Post a Comment