View previous topic :: View next topic
|
Author |
Message |
comp_ashok
New User
Joined: 30 Nov 2007 Posts: 15 Location: India
|
|
|
|
Hi All,
Input file : FB, Lrec=80
108/05/03
108/05/06
108/05/04
108/05/04
108/05/04
108/05/06
108/05/01
108/05/04
108/05/06
108/05/01
Output file : FB, lrec=80
108/05/01 01
108/05/03 02
108/05/04 03
108/05/06 04
Note*-> Value written after space is the line number. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
comp_ashok,
The following DFSORT JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
108/05/03
108/05/06
108/05/04
108/05/04
108/05/04
108/05/06
108/05/01
108/05/04
108/05/06
108/05/01
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
INREC OVERLAY=(81:2,2,5,2,8,2)
SORT FIELDS=(81,6,Y2T,A)
SUM FIELDS=NONE
OUTREC BUILD=(1,10,SEQNUM,2,ZD,13,68)
/*
|
|
|
Back to top |
|
|
comp_ashok
New User
Joined: 30 Nov 2007 Posts: 15 Location: India
|
|
|
|
Hi Skolusu
Thanks for prompt reply.
I did my work with SEQNUM in OUTREC statement only. My SYSIN card
Code: |
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1,10,SEQNUM,2,ZD)
|
This worked fine to my requirement. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Ashok,
Kolusu assumed that the yy in your yy/mm/dd dates could reflect 19yy and 20yy dates and coded for that by using the Y2T format. If the yy in your dates only reflect 20yy dates, then your control statements will work fine. |
|
Back to top |
|
|
zero
New User
Joined: 01 Dec 2007 Posts: 21 Location: Hyderabad
|
|
|
|
Hi,
i tried to do this using ICETOOL.
Code: |
//TOOLIN DD *
SELECT FROM(INDD1) TO(T1) ON(1,9,CH) FIRST
COPY FROM(T1) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(11:SEQNUM,2,ZD))
OUTFIL FNAMES=OUTDD1
/* |
the desired result is coming up.
But, here, my concern is i have used two verbs : SELECT and COPY.
is there any way to assign line numbers while using SELECT itself ?
Thank You,
... |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
zero,
You need to show us the error messages also. You really don't need the second copy statement. You can create the seqnum in the SELECT operator itself like shown below
Code: |
//TOOLIN DD *
SELECT FROM(INDD1) TO(OUTDD1) ON(1,9,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
OUTFIL FNAMES=OUTDD1,OVERLAY=(11:SEQNUM,2,ZD)
/* |
Hope this helps...
Cheers |
|
Back to top |
|
|
|