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

SYNCSORT records are not matching for certain IDs


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vm_gayathri

New User


Joined: 29 Apr 2013
Posts: 3
Location: India

PostPosted: Thu Oct 15, 2015 9:31 pm
Reply with quote

HI All,

I have a sortin file with 2100143 records . Im sorting the file with Sort cards (1,4,BI,A) . This is a clone job of existing system , so I can compare the o/p for validation.

When I run the above job , The sort records are not matching for certain ID's . I have shown the example below

Sortout Im getting
670485 570 2 110348218
670485 570 2 110331856
670485 570 2 110331856
670485 570 2 110326497
670485 570 2 110326497
670485 570 2 110326497
670485 570 2 110278462
670485 570 2 110278462
670485 570 2 110348218
670485 570 2 110331856
670485 570 2 [b]110278462 [/b]
670485 570 2 110451042
670485 570 2 110451042
670485 570 2 110451042

Expected Output
670485 570 2 110348218
670485 570 2 110331856
670485 570 2 110331856
670485 570 2 110326497
670485 570 2 110326497
670485 570 2 110326497
670485 570 2 110278462
670485 570 2 110278462
670485 570 2 110348218
670485 570 2 110331856
670485 570 2 110451042
670485 570 2 110451042
670485 570 2 110451042
670485 570 2 110278462


For the claim 670485 the value 110278462 is coming in misplaced location. It should come as last record but it is coming before .

JCL I used

//SORT3 EXEC PGM=SORT,
// PARM='VSCORET=64MB,CORE=MAX,BMSG'
//SORTIN DD DSN=File1,DISP=SHR
//SORTOUT DD DSN=&TAPE..File2,UNIT=SILO,
// DISP=(,CATLG,DELETE),LABEL=RETPD=45,
// DCB=BLKSIZE=0
//SYSIN DD DSN=sysin card,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*

Initially we tought it could be space issue with sort , so i have used VCORETin parm . I tried using maxsort also but still same issue comes.

Can some help me how to proceed ?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Oct 15, 2015 9:58 pm
Reply with quote

usually the order of records with the same key is unpredictable

OPTION EQUALS will keep the records with the same key in the sequence they were in the input file
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Oct 15, 2015 11:10 pm
Reply with quote

Yes, enrico is correct. Your JCL is useless in determining the problem. Your sysout would be necessary, as long as it shows the value for EQUALS.

With NOEQUALS, duplicate keys are processed in whatever order is convenient at the time, which means the order can change from run to run, with nothing being changed (a few more, or fewer, bytes available from memory for a SORT can cause a difference, for instance).
Back to top
View user's profile Send private message
vm_gayathri

New User


Joined: 29 Apr 2013
Posts: 3
Location: India

PostPosted: Fri Oct 16, 2015 12:03 pm
Reply with quote

Thanks for the reply ,

But im not expecting this result. Because in my sortin the claims will be in scattered order. I do not want to maintain that input sequence. The existing system which runs the same job with same sortcard is giving 110278462 as last record from the sort. i too expect the same as im just cloning the job to my system.

there was another sort step with the same issue , we gave same PARM='VSCORET=64MB,CORE=MAX,BMSG and it gave the expected sequence order. So I tried the same for this sort step also but it is not coming as expected.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 16, 2015 1:05 pm
Reply with quote

With NOEQUALS, the order of the output for non-unique keys is not guaranteed.

With EQUALS, the order of the output for non-unique keys guaranteed to be the same order as those keys were on the input (ie first of that key output will have been the first of that key on input, second will be second, and so on).

Whacking lots of memory at something may (or may not) "improve" the number of times you get the same output order for the same data when you have NOEQUALS. But. And it's a big one. There is no guarantee of order with NOEQUALS. Plus wasted resources.

Post your sysout, or just blindly take our advice. Bear in mind that any step which has had the pitiful fix applied (if it is for non-unique keys not being in input order) are also subject to failure at any moment, and may have regularly not been cooperating with you.
Back to top
View user's profile Send private message
vm_gayathri

New User


Joined: 29 Apr 2013
Posts: 3
Location: India

PostPosted: Fri Oct 16, 2015 2:04 pm
Reply with quote

Please find the sysout details below


SARPAGE 10
SYNCSORT FOR Z/OS 1.4.1.0R U.S. PATENTS: 4210961, 5117495 (C) 2010 SYNCSO
z/OS 2.1.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 14154, MODEL 2817 506 LICEN
SYSIN :
************************************************* 0001000
*** SORT FILE BY ID-CLM 0002000
************************************************* 0004000
SORT FIELDS=(1,4,BI,A) 0040700
WER276B SYSDIAG= 2595012, 7285596, 7285596, 6222365
WER164B 21,300K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 12K BYTES RESERVE REQUESTED, 16,872K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 97; BLKSIZE= 27936
WER073I SORTIN : DSNAME=XSST00.TCAT.XS.O8XS8129
WER110I SORTOUT : RECFM=FB ; LRECL= 97; BLKSIZE= 32689
WER074I SORTOUT : DSNAME=BATCH.XS.TEST.TCAT.O9XS8129
WER410B 16,176K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 16,176K BYTES USED
WER036B G=78336,B=584,BIAS=00
WER162B 5,880,000 PREALLOCATED SORTWORK TRACKS, 0 DYNAMICALLY ALLOCATED,
WER162B 0 ACQUIRED IN SECONDARY EXTENTS, 5,873,235 RELEASED, TOTAL OF 3,623
WER124I PREALLOCATED/USED SORTWORK SPACE USAGE FACTOR > 999.99
WER045C END SORT PHASE
WER493I ZIIP PROCESSOR USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
SORTIN : EXCP'S=28,UNIT=3390,DEV=E2C8,CHP=(A2A3A4A5A6A7474C,1),VOL=TSCM09
SORTOUT : EXCP'S=26,UNIT=3490,DEV=AFB5,CHP=F4F0BCB8
SORTWK01 : EXCP'S=31,UNIT=3390,DEV=770C,CHP=(4AB6ABECA878B343,1),VOL=WK0426
SORTWK02 : EXCP'S=7,UNIT=3390,DEV=7901,CHP=(4AB6ABECA878B343,1),VOL=WK0487
SORTWK03 : EXCP'S=3,UNIT=3390,DEV=7D0F,CHP=(4AB6ABECA878B343,1),VOL=WK0451
SORTWK04 : EXCP'S=3,UNIT=3390,DEV=7D0E,CHP=(4AB6ABECA878B343,1),VOL=WK0450
SORTWK05 : EXCP'S=2,UNIT=3390,DEV=7E0D,CHP=(4AB6ABECA878B343,1),VOL=WK0453
SORTWK06 : EXCP'S=7,UNIT=3390,DEV=710E,CHP=(4AB6ABECA878B343,1),VOL=WK0406
SORTWK07 : EXCP'S=13,UNIT=3390,DEV=7A0C,CHP=(4AB6ABECA878B343,1),VOL=WK0436
SORTWK08 : EXCP'S=0,UNIT=3390,DEV=7503,CHP=(4AB6ABECA878B343,1),VOL=WK0476
SORTWK09 : EXCP'S=0,UNIT=3390,DEV=7403,CHP=(4AB6ABECA878B343,1),VOL=WK0473
SORTWK10 : EXCP'S=0,UNIT=3390,DEV=710C,CHP=(4AB6ABECA878B343,1),VOL=WK0404
SORTWK11 : EXCP'S=0,UNIT=3390,DEV=730E,CHP=(4AB6ABECA878B343,1),VOL=WK0510
SORTWK12 : EXCP'S=0,UNIT=3390,DEV=760D,CHP=(4AB6ABECA878B343,1),VOL=WK0422
SORTWK13 : EXCP'S=0,UNIT=3390,DEV=7E03,CHP=(4AB6ABECA878B343,1),VOL=WK0503
SORTWK14 : EXCP'S=0,UNIT=3390,DEV=780C,CHP=(4AB6ABECA878B343,1),VOL=WK0429
SORTWK15 : EXCP'S=0,UNIT=3390,DEV=7E02,CHP=(4AB6ABECA878B343,1),VOL=WK0502
SORTWK16 : EXCP'S=0,UNIT=3390,DEV=780F,CHP=(4AB6ABECA878B343,1),VOL=WK0432
SORTWK17 : EXCP'S=0,UNIT=3390,DEV=7603,CHP=(4AB6ABECA878B343,1),VOL=WK0479
SORTWK18 : EXCP'S=0,UNIT=3390,DEV=7B0F,CHP=(4AB6ABECA878B343,1),VOL=WK0443
SORTWK19 : EXCP'S=0,UNIT=3390,DEV=7D04,CHP=(4AB6ABECA878B343,1),VOL=WK0501
SORTWK20 : EXCP'S=0,UNIT=3390,DEV=7303,CHP=(4AB6ABECA878B343,1),VOL=WK0470
SORTWK21 : EXCP'S=0,UNIT=3390,DEV=700C,CHP=(4AB6ABECA878B343,1),VOL=WK0400
SORTWK22 : EXCP'S=0,UNIT=3390,DEV=750E,CHP=(4AB6ABECA878B343,1),VOL=WK0419
SORTWK23 : EXCP'S=0,UNIT=3390,DEV=7304,CHP=(4AB6ABECA878B343,1),VOL=WK0471
SORTWK24 : EXCP'S=0,UNIT=3390,DEV=7602,CHP=(4AB6ABECA878B343,1),VOL=WK0478
SORTWK25 : EXCP'S=0,UNIT=3390,DEV=7C03,CHP=(4AB6ABECA878B343,1),VOL=WK0497
SORTWK26 : EXCP'S=0,UNIT=3390,DEV=7704,CHP=(4AB6ABECA878B343,1),VOL=WK0483
SORTWK27 : EXCP'S=0,UNIT=3390,DEV=770B,CHP=(4AB6ABECA878B343,1),VOL=WK0425
SORTWK28 : EXCP'S=0,UNIT=3390,DEV=7D0C,CHP=(4AB6ABECA878B343,1),VOL=WK0448
SORTWK29 : EXCP'S=0,UNIT=3390,DEV=7C0C,CHP=(4AB6ABECA878B343,1),VOL=WK0444
SORTWK30 : EXCP'S=0,UNIT=3390,DEV=710D,CHP=(4AB6ABECA878B343,1),VOL=WK0405
SORTWK31 : EXCP'S=0,UNIT=3390,DEV=7F0D,CHP=(4AB6ABECA878B343,1),VOL=WK0457
SORTWK32 : EXCP'S=0,UNIT=3390,DEV=770D,CHP=(4AB6ABECA878B343,1),VOL=WK0427
SORTWK33 : EXCP'S=0,UNIT=3390,DEV=780E,CHP=(4AB6ABECA878B343,1),VOL=WK0431
SORTWK34 : EXCP'S=0,UNIT=3390,DEV=7A02,CHP=(4AB6ABECA878B343,1),VOL=WK0490
SORTWK35 : EXCP'S=0,UNIT=3390,DEV=720E,CHP=(4AB6ABECA878B343,1),VOL=WK0410
SORTWK36 : EXCP'S=0,UNIT=3390,DEV=7103,CHP=(4AB6ABECA878B343,1),VOL=WK0464
SORTWK37 : EXCP'S=0,UNIT=3390,DEV=7B0E,CHP=(4AB6ABECA878B343,1),VOL=WK0442
SORTWK38 : EXCP'S=0,UNIT=3390,DEV=790C,CHP=(4AB6ABECA878B343,1),VOL=WK0435
SORTWK39 : EXCP'S=0,UNIT=3390,DEV=7F04,CHP=(4AB6ABECA878B343,1),VOL=WK0507
SORTWK40 : EXCP'S=0,UNIT=3390,DEV=7A03,CHP=(4AB6ABECA878B343,1),VOL=WK0491
SORTWK41 : EXCP'S=0,UNIT=3390,DEV=700D,CHP=(4AB6ABECA878B343,1),VOL=WK0401
SORTWK42 : EXCP'S=0,UNIT=3390,DEV=7C0E,CHP=(4AB6ABECA878B343,1),VOL=WK0446
SORTWK43 : EXCP'S=0,UNIT=3390,DEV=730C,CHP=(4AB6ABECA878B343,1),VOL=WK0508
SORTWK44 : EXCP'S=0,UNIT=3390,DEV=7002,CHP=(4AB6ABECA878B343,1),VOL=WK0460
SORTWK45 : EXCP'S=0,UNIT=3390,DEV=7A0D,CHP=(4AB6ABECA878B343,1),VOL=WK0437
SORTWK46 : EXCP'S=0,UNIT=3390,DEV=710F,CHP=(4AB6ABECA878B343,1),VOL=WK0407
SORTWK47 : EXCP'S=0,UNIT=3390,DEV=7C0D,CHP=(4AB6ABECA878B343,1),VOL=WK0445
SORTWK48 : EXCP'S=0,UNIT=3390,DEV=7F0C,CHP=(4AB6ABECA878B343,1),VOL=WK0456
SORTWK49 : EXCP'S=0,UNIT=3390,DEV=7004,CHP=(4AB6ABECA878B343,1),VOL=WK0462
SORTWK50 : EXCP'S=0,UNIT=3390,DEV=7E0E,CHP=(4AB6ABECA878B343,1),VOL=WK0454
SORTWK51 : EXCP'S=0,UNIT=3390,DEV=7909,CHP=(4AB6ABECA878B343,1),VOL=WK0511
SORTWK52 : EXCP'S=0,UNIT=3390,DEV=760F,CHP=(4AB6ABECA878B343,1),VOL=WK0424
SORTWK53 : EXCP'S=0,UNIT=3390,DEV=7A0E,CHP=(4AB6ABECA878B343,1),VOL=WK0438
SORTWK54 : EXCP'S=0,UNIT=3390,DEV=740C,CHP=(4AB6ABECA878B343,1),VOL=WK0413
SORTWK55 : EXCP'S=0,UNIT=3390,DEV=7803,CHP=(4AB6ABECA878B343,1),VOL=WK0485
SORTWK56 : EXCP'S=0,UNIT=3390,DEV=7C04,CHP=(4AB6ABECA878B343,1),VOL=WK0498
SORTWK57 : EXCP'S=0,UNIT=3390,DEV=7703,CHP=(4AB6ABECA878B343,1),VOL=WK0482
SORTWK58 : EXCP'S=0,UNIT=3390,DEV=730F,CHP=(4AB6ABECA878B343,1),VOL=WK0412
SORTWK59 : EXCP'S=0,UNIT=3390,DEV=7404,CHP=(4AB6ABECA878B343,1),VOL=WK0474
SORTWK60 : EXCP'S=0,UNIT=3390,DEV=7E0F,CHP=(4AB6ABECA878B343,1),VOL=WK0455
SORTWK61 : EXCP'S=0,UNIT=3390,DEV=7A0F,CHP=(4AB6ABECA878B343,1),VOL=WK0439
SORTWK62 : EXCP'S=0,UNIT=3390,DEV=7802,CHP=(4AB6ABECA878B343,1),VOL=WK0484
SORTWK63 : EXCP'S=0,UNIT=3390,DEV=750C,CHP=(4AB6ABECA878B343,1),VOL=WK0417
SORTWK64 : EXCP'S=0,UNIT=3390,DEV=7C0F,CHP=(4AB6ABECA878B343,1),VOL=WK0447
SORTWK65 : EXCP'S=0,UNIT=3390,DEV=7B03,CHP=(4AB6ABECA878B343,1),VOL=WK0494
SORTWK66 : EXCP'S=0,UNIT=3390,DEV=7F0E,CHP=(4AB6ABECA878B343,1),VOL=WK0458
SORTWK67 : EXCP'S=0,UNIT=3390,DEV=720C,CHP=(4AB6ABECA878B343,1),VOL=WK0408
SORTWK68 : EXCP'S=0,UNIT=3390,DEV=7003,CHP=(4AB6ABECA878B343,1),VOL=WK0461
SORTWK69 : EXCP'S=0,UNIT=3390,DEV=7504,CHP=(4AB6ABECA878B343,1),VOL=WK0477
SORTWK70 : EXCP'S=0,UNIT=3390,DEV=7202,CHP=(4AB6ABECA878B343,1),VOL=WK0466
SORTWK71 : EXCP'S=0,UNIT=3390,DEV=7F0F,CHP=(4AB6ABECA878B343,1),VOL=WK0459
SORTWK72 : EXCP'S=0,UNIT=3390,DEV=7B02,CHP=(4AB6ABECA878B343,1),VOL=WK0493
SORTWK73 : EXCP'S=0,UNIT=3390,DEV=7B04,CHP=(4AB6ABECA878B343,1),VOL=WK0495
SORTWK74 : EXCP'S=0,UNIT=3390,DEV=7D02,CHP=(4AB6ABECA878B343,1),VOL=WK0499
SORTWK75 : EXCP'S=0,UNIT=3390,DEV=780D,CHP=(4AB6ABECA878B343,1),VOL=WK0430
SORTWK76 : EXCP'S=0,UNIT=3390,DEV=740F,CHP=(4AB6ABECA878B343,1),VOL=WK0416
SORTWK77 : EXCP'S=0,UNIT=3390,DEV=7604,CHP=(4AB6ABECA878B343,1),VOL=WK0480
SORTWK78 : EXCP'S=0,UNIT=3390,DEV=740E,CHP=(4AB6ABECA878B343,1),VOL=WK0415
SORTWK79 : EXCP'S=0,UNIT=3390,DEV=700E,CHP=(4AB6ABECA878B343,1),VOL=WK0402
SORTWK80 : EXCP'S=0,UNIT=3390,DEV=7D0D,CHP=(4AB6ABECA878B343,1),VOL=WK0449
SORTWK81 : EXCP'S=0,UNIT=3390,DEV=7804,CHP=(4AB6ABECA878B343,1),VOL=WK0486
SORTWK82 : EXCP'S=0,UNIT=3390,DEV=720D,CHP=(4AB6ABECA878B343,1),VOL=WK0409
SORTWK83 : EXCP'S=0,UNIT=3390,DEV=7F03,CHP=(4AB6ABECA878B343,1),VOL=WK0506
SORTWK84 : EXCP'S=0,UNIT=3390,DEV=700F,CHP=(4AB6ABECA878B343,1),VOL=WK0403
SORTWK85 : EXCP'S=0,UNIT=3390,DEV=7104,CHP=(4AB6ABECA878B343,1),VOL=WK0465
SORTWK86 : EXCP'S=0,UNIT=3390,DEV=790A,CHP=(4AB6ABECA878B343,1),VOL=WK0433
SORTWK87 : EXCP'S=0,UNIT=3390,DEV=7D03,CHP=(4AB6ABECA878B343,1),VOL=WK0500
SORTWK88 : EXCP'S=0,UNIT=3390,DEV=7E04,CHP=(4AB6ABECA878B343,1),VOL=WK0504
SORTWK89 : EXCP'S=0,UNIT=3390,DEV=790B,CHP=(4AB6ABECA878B343,1),VOL=WK0434
SORTWK90 : EXCP'S=0,UNIT=3390,DEV=760E,CHP=(4AB6ABECA878B343,1),VOL=WK0423
SORTWK91 : EXCP'S=0,UNIT=3390,DEV=7302,CHP=(4AB6ABECA878B343,1),VOL=WK0469
SORTWK92 : EXCP'S=0,UNIT=3390,DEV=7402,CHP=(4AB6ABECA878B343,1),VOL=WK0472
SORTWK93 : EXCP'S=0,UNIT=3390,DEV=7204,CHP=(4AB6ABECA878B343,1),VOL=WK0468
SORTWK94 : EXCP'S=0,UNIT=3390,DEV=7702,CHP=(4AB6ABECA878B343,1),VOL=WK0481
SORTWK95 : EXCP'S=0,UNIT=3390,DEV=7102,CHP=(4AB6ABECA878B343,1),VOL=WK0463
SORTWK96 : EXCP'S=0,UNIT=3390,DEV=7B0C,CHP=(4AB6ABECA878B343,1),VOL=WK0440
SORTWK97 : EXCP'S=0,UNIT=3390,DEV=7203,CHP=(4AB6ABECA878B343,1),VOL=WK0467
SORTWK98 : EXCP'S=0,UNIT=3390,DEV=7B0D,CHP=(4AB6ABECA878B343,1),VOL=WK0441
TOTAL OF 66 EXCP'S ISSUED FOR SORTWORKS
TOTAL OF 120 EXCP'S ISSUED FOR SORTING
FILESIZE 203,715,132 BYTES
RCD IN 2100156, OUT 2100156
NOEQUALS, BALANCE IN EFFECT
RELEASE 1.4 BATCH 0525 TPF LEVEL 1.0


JCL

//SORT3 EXEC PGM=SORT,
// PARM='VSCORET=40M,VSCORE=5M,BMSG'
//SORTWK01 DD UNIT=(SYSDA,5),SPACE=(CYL,(4000,4000))
//SORTWK02 DD UNIT=(SYSDA,5),SPACE=(CYL,(4000,4000))
;
;
;
//SORTWK99 DD UNIT=(SYSDA,5),SPACE=(CYL,(4000,4000))
//SORTIN DD DSN=INPUT FILE,DISP=SHR
//SORTOUT DD DSN=&TAPE..Output,UNIT=SILO,
// DISP=(,CATLG,DELETE),LABEL=RETPD=45,
// DCB=BLKSIZE=0
//SYSIN DD DSN=SORTCARD,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//****************************
[/u]
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 16, 2015 2:45 pm
Reply with quote

Code:
NOEQUALS, BALANCE IN EFFECT


So, you'll get output for duplicate keys in the same order as input purely by coincidence.

If you want to ensure duplicate keys appear in the output in the same order as the input, you have to specify EQUALS. There are several ways to do that, consult your documentation.

If you don't want your output in that order, then there is simply no way to guarantee the order of duplicate keys from run to run.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top