kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Aug 13, 2007 2:46 pm Post subject: |
|
|
Piscesian,
Try this JCL. I assumed that your date starts in pos1 for 10 bytes in CCYY-MM-DD format.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
M01END,C'31'
M02END,C'28'
M03END,C'31'
M04END,C'30'
M05END,C'31'
M06END,C'30'
M07END,C'31'
M08END,C'31'
M09END,C'30'
M10END,C'31'
M11END,C'30'
M12END,C'31'
M13END,C'29'
//SORTIN DD DSN=your input file,
// disp=shr
//SORTOUT DD dsn=your output file,
// disp=(new,catlg,delete),
// unit=sysda,
// space=(trk,(1,1),rlse)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(21:01,04,ZD,MOD,+4,EDIT=(T),
22:01,04,ZD,MOD,+100,EDIT=(TTT),
25:01,04,ZD,MOD,+400,EDIT=(TTT),
30:+1,ADD,06,02,ZD,EDIT=(TT))),
IFTHEN=(WHEN=(25,3,ZD,EQ,0,OR,
(21,1,ZD,EQ,0,AND,22,3,ZD,GT,0)),
OVERLAY=(28:C'L'),HIT=NEXT),
IFTHEN=(WHEN=(30,2,ZD,EQ,13),
OVERLAY=(01:+1,ADD,01,04,ZD,EDIT=(TTTT),
06:C'01',
09:M01END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,02,AND,
28,1,CH,EQ,C' '),
OVERLAY=(06:30,2,09:M02END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,02,AND,
28,1,CH,EQ,C'L'),
OVERLAY=(06:30,2,09:M13END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,03),
OVERLAY=(06:30,2,09:M03END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,04),
OVERLAY=(06:30,2,09:M04END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,05),
OVERLAY=(06:30,2,09:M05END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,06),
OVERLAY=(06:30,2,09:M06END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,07),
OVERLAY=(06:30,2,09:M07END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,08),
OVERLAY=(06:30,2,09:M08END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,09),
OVERLAY=(06:30,2,09:M09END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,10),
OVERLAY=(06:30,2,09:M10END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,11),
OVERLAY=(06:30,2,09:M11END)),
IFTHEN=(WHEN=(30,2,ZD,EQ,12),
OVERLAY=(06:30,2,09:M12END))
OUTREC BUILD=(01,10)
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|