View previous topic :: View next topic
|
Author |
Message |
rahulcherekar
New User
Joined: 20 Feb 2007 Posts: 16 Location: New York
|
|
|
|
Hi,
My input file is as below:
RAHUL
AMIT
RAHUL
KRISHNA
RAHUL
KRISHNA
AMIT
TT
AMIT
and my desired output is:
RAHUL
AMIT
KRISHNA
TT
Please let me know, if I can use ICETOOL/DFSORT to get the desired ouput.
I tried using
"SPLICE FROM(SORTIN) TO(NODUPES) -
ON(001,012,CH) WITH(1,12) KEEPNODUPS"
and
" SELECT FROM(SORTIN) TO(NODUPES) -
ON(001,012,CH) FIRST "
- both gave me output in a sorted order.
AMIT
KRISHNA
RAHUL
TT
I can only think of writing a program now. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
do a search on sequence numbers in sort.
you input your data and append a sequence number.
sort on the name, drop dups.
sort on the number, remove the appended sequence number and output.
take a look at the sticky Frank created for the DFSORT/ICETOOL forum that contains links to reference material, including quick start guide. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Rahul,
You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
RAHUL
AMIT
RAHUL
KRISHNA
RAHUL
KRISHNA
AMIT
TT
AMIT
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(1,12,CH) FIRST USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
SORT FIELDS=(81,8,ZD,A)
OUTREC BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
rahulcherekar
New User
Joined: 20 Feb 2007 Posts: 16 Location: New York
|
|
|
|
It worked.
Thanks All for your help,
Rahul. |
|
Back to top |
|
|
|