My input file contain 3 character account prefix followed by account range
Position 1-3 Account prefix
Position 4-6 Start Range
Position 7-9 End Range
The input file need to be exploded based on the start range and end range and then sort based on account prefix.
Example Input file
ADZ001005
ABC005009
DEG010014
Expected Output file
ABC005
ABC006
ABC007
ABC008
ABC009
ADZ001
ADZ002
ADZ003
ADZ004
ADZ005
DEG010
DEG011
DEG012
DEG013
DEG014
Is it possible using sort without using E15/E35 routines?
Splitting record based on range
Moderators: Frank Yaeger, Moderator Group
Jathampy,
The following DFSORT/ICETOOL JCL will give you the desired results
The following DFSORT/ICETOOL JCL will give you the desired results
Code: Select all
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
ADZ001005
ABC005009
DEG010014
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(IN) USING(CTL2)
SORT FROM(T1) USING(CTL3)
//CTL1CNTL DD *
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(10:7,3,ZD,SUB,4,3,ZD,EDIT=(TTT))),
IFTHEN=(WHEN=INIT,OVERLAY=(10:+1,ADD,10,3,ZD,EDIT=(TTT))),
IFTHEN=(WHEN=(10,3,ZD,LE,2),OVERLAY=(10:C'002'))
OUTFIL FNAMES=CTL2CNTL,REMOVECC,NODETAIL,BUILD=(80X),
TRAILER1=(2:C'OUTFIL FNAMES=T1,REPEAT=',MAX=(10,3,ZD,EDIT=(TTT)))
//*
//CTL2CNTL DD DSN=&&C1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//OUT DD SYSOUT=*
//CTL3CNTL DD *
SORT FIELDS=(1,3,CH,A),EQUALS
OUTREC IFOUTLEN=9,
IFTHEN=(WHEN=INIT,OVERLAY=(10:SEQNUM,3,ZD,START=0,RESTART=(1,3))),
IFTHEN=(WHEN=INIT,OVERLAY=(04:4,3,ZD,ADD,10,3,ZD,EDIT=(TTT)))
OUTFIL FNAMES=OUT,OMIT=(4,3,CH,GT,7,3,CH),BUILD=(1,6)
//*
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page