IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT - Copy file without sorting


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Sat Jun 14, 2008 1:55 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Jun 14, 2008 3:52 pm
Reply with quote

What about SORT manuals !!!!!


So simple as command COPY and option SUM FIELDS ....

Please READ READ READ
Back to top
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Sat Jun 14, 2008 4:08 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Jun 14, 2008 4:40 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Jun 14, 2008 4:44 pm
Reply with quote

OK I have to continue to read because here I eliminated all duplicates.

So wait and see
Back to top
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Sat Jun 14, 2008 4:51 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jun 14, 2008 5:11 pm
Reply with quote

OP is using SYNCSORT
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Jun 14, 2008 6:50 pm
Reply with quote

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
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Sat Jun 14, 2008 10:30 pm
Reply with quote

Great Pierre, it really worked. thanks a ton icon_smile.gif
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Jun 14, 2008 10:32 pm
Reply with quote

You are welcome ... as others said icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top