vvkswm wrote:Hi,I tried the Below JCL with NOEQUALS.Then also the output is same as EQUALS.
Please can you explain me the use of EQUALS in jcl while sorting records.
wow really? Did you even read my prior response?
skolusu wrote:If you really want to see the difference between EQUALS and NOEQUALS you need to play with input that has more duplicates.
I have no idea why people are so persistent on trying to prove EQUALS and NOEQUALS gets the same results.
Run this JCL and pay attention to the 6th byte, which is in the ascending order. I am sorting on the first 3 bytes which is basically the word "key" for every record.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
KEY0 A
KEY3 B
KEY4 C
KEY1 D
KEY2 E
KEY3 F
KEY4 G
KEY5 H
KEY6 I
KEY7 J
KEY0 K
KEY0 L
KEY0 M
KEY0 N
KEY0 O
KEY0 P
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC OVERLAY=(250:C'VVKSWM STRONGLY BELIEVES EQUALS HAS NO VALUE')
SORT FIELDS=(1,3,CH,A),NOEQUALS
//*
Copy the output and now re-run the job with EQUALS and then compare the output.
P.S: If you strongly believe that EQUALS and NOEQUALS makes no difference to the order of the Output , you can stop coding it and get burned. It is up to you. Good Luck