View previous topic :: View next topic
Author
Message
charanmsrit New User Joined: 25 Oct 2007Posts: 81 Location: Australia
I need to copy a file to another without sorting but eliminate duplicates to have only unique records in the same order as source file.
Back to top
PeD Active User Joined: 26 Nov 2005Posts: 459 Location: Belgium
What about SORT manuals !!!!!
So simple as command COPY and option SUM FIELDS ....
Please READ READ READ
Back to top
charanmsrit New User Joined: 25 Oct 2007Posts: 81 Location: Australia
Hi Ped,
As for my knowledge SUM FIELDS works on fields specified on SORT FIELDS command. i have already tried it but in vain.
[img]PRODUCT LICENSED FOR CPU SERIAL NUMBER 38D9F, MODEL 2094 720 LICEN
SYSIN :
SORT FIELDS=COPY 0159001
SUM FIELDS=NONE 0160001
WER276B SYSDIAG= 1346685, 3521787, 3521787, 5678437
WER164B 8,932K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 400K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER050I SUM CONTROL STATEMENT IGNORED
WER108I SORTIN : RECFM=F ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=F ; LRECL= 80; BLKSIZE= 80
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 292K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B SORTIN : EXCP'S=2,UNIT=3390,DEV=225F,CHP=(D0D1D2D3D4D5D6D7,2),VOL=TS
WER416B SORTOUT : EXCP'S=2,UNIT=3390,DEV=205D,CHP=(D0D1D2D3D4D5D6D7,2),VOL=TS
WER416B TOTAL OF 4 EXCP'S ISSUED FOR COPYING
WER054I RCD IN 704, OUT 704
WER169I RELEASE 1.2 BATCH 0453 TPF LEVEL 3.1
WER052I END SYNCSORT - JBNAMEA,STEP060,,DIAG=8200,51C4,AA3D,2877,CBD2,6DCA,2A[/img]
Back to top
PeD Active User Joined: 26 Nov 2005Posts: 459 Location: Belgium
I am not a great expert in sort, but I just read some documentation and I found this for the benefit ......... of myself
using SYNCTOOL with correct JCL requirements, something like
Code:
COPY FROM(IN1) TO(T1)
SELECT FROM(T1) TO(ON1) ON(1,80,CH) NODUPS
Where IN1 is your input dataset, ON1 your output dataset and T1 an temporary dataset reuse in Select
I am sure there is a better solution, but it is working.
Last remark you are using SYNCSORT and not DFSORT. I am using ICETOOL from IBM.
Back to top
PeD Active User Joined: 26 Nov 2005Posts: 459 Location: Belgium
OK I have to continue to read because here I eliminated all duplicates.
So wait and see
Back to top
charanmsrit New User Joined: 25 Oct 2007Posts: 81 Location: Australia
Thanks Ped for your concern. but ON(1,80,CH) option again sort the records but i don't want to sort the records. i want the output in same order as input. only thing is to have unique records.
Back to top
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006Posts: 6966 Location: porcelain throne
OP is using SYNCSORT
Back to top
PeD Active User Joined: 26 Nov 2005Posts: 459 Location: Belgium
Ok but making a intermediary pass including a sequence number at the end
Code:
//STEPS EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=your.input.file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//ON1 DD DSN=your.output.file,..............
//TOOLIN DD *
SORT FROM(IN1) TO(T1) USING(CTL1)
SORT FROM(T1) TO(ON1) USING(CTL2)
/*
//CTL1CNTL DD *
INREC FIELDS=(1,80,81:SEQNUM,8,ZD)
SORT FIELDS=(1,80,CH,A)
SUM FIELDS=NONE
/*
//CTL2CNTL DD *
SORT FIELDS=(81,8,ZD,A)
OUTREC FIELDS=(1,80)
/*
But not tested. Anyway should be OK.
Still my previous remark : it is sample for DFSORT, not sure for SYNCSORT.
Back to top
charanmsrit New User Joined: 25 Oct 2007Posts: 81 Location: Australia
Great Pierre, it really worked. thanks a ton
Back to top
PeD Active User Joined: 26 Nov 2005Posts: 459 Location: Belgium
You are welcome ... as others said
Back to top
Please enable JavaScript!