Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SORT to omit DUPLICATES

Status
Not open for further replies.

DK007

Programmer
Jul 10, 2003
9
0
0
AU
I am guessing you can sort a file to omit duplicates, but I don't know the correct syntax.

At present I have

SORT (X,Y,CH,A)
OMIT (X,Y,CH,EQ'*') (to omit comments with * column 1)
INPUT
OUTPUT
FIN

What's the syntax to remove duplicates please.

Cheers,

DK.
 
Does this work if the field that is being sorted is an Alphanumeric field ??
 
The SUM command tells the sort to remove duplicates and to summarize the field(s) specified in the FIELDS parameter. With FIELDS=NONE, the summarize function is omitted, leaving the remove duplicates function.
 
I don't really mean to use this forum as a "debugging forum", but when I use your suggestion "SUM FIELDS=(NONE), my job abends with a "CONTROL STATEMENT ERROR". That's why I asked the above.

Here is my SORT Parm....
----+----1----+----2----+----3----+----4----+----5
/ SORT KEYS=(4,16,CH,A,)
/ SUM FIELDS=NONE
/ OMIT COND=(1,1,CH,EQ,C'*')
/ INPUT IN
/ OUTPUT OUT
/ FIN
 
Maybe because you don't have the parentheses around the NONE...

Steve
 
My reasponse was based on the proper parameters for use with the DFSORT product. What SORT product are you using? I've never heard of some of those parameters (SORT KEYS? INPUT IN? OUTPUT OUT? FIN?)
 
SORT/MERGE V12L10 <<<MPCJ63 .STEP0030>>>
/ SORT KEYS=(4,16,CH,A)
/ SUM FIELDS=NONE
JSK037E SYNTAX ERROR - NONE
/ OMIT COND=(1,1,CH,EQ,C'*')
/ INPUT IN
/ OUTPUT OUT
/ FIN
JSK002A CONTROL STATEMENT ERROR
JSK350I SORT/MERGE ABEND <<MPCJ63 .STEP0030>>

Have tried it with Parentheses as below also....
SORT/MERGE V12L10 <<<DMCDBK01.STEP0030>>>
/ SORT KEYS=(4,16,CH,A)
/ SUM FIELDS=(NONE)
JSK010E INVALID VALUE OR FLD - NONE
/ OMIT COND=(1,1,CH,EQ,C'*')
/ INPUT IN
/ OUTPUT OUT
/ FIN
JSK012E FLD(1) TYPE INVALID ON SUM
JSK002A CONTROL STATEMENT ERROR
JSK350I SORT/MERGE ABEND <<DMCDBK01.STEP0030>>


Still fails ......

It's a Fujitsu mainframe - does that make any difference ??
 
According to those error messages, you are running Fujitsu SORT.

According to a manual I found via Google, it appears that you code:

SUM-RECORDS
FIELDS=*NONE

"Out of all the records with identical SORT keys, one record is moved to the output and the rest are eliminated. No summation is performed.
 
It's not which mainframe that's important here, but which sort utility you are using. Clearly it's not DFSORT, as all DFSORT messages begin with 'ICE'.

Tried looking the message numbers up on Google without success.

Unless anyone else recognises it, you may have to RTFM...

Steve
 
Not to be picky, but where does COBOL come in?"

I agree. There should probably be a forum designated for JCL, Utilities, SORT, etc.
 
Before we figure out which forum this "belongs in" (which certainly is NOT COBOL, although ...)

I think some of us IBM-types have been jumping to conclussions.

I would like to know what OPERATING SYSTEM this is being done on *and* what sort product is being used.

It is *possible* that this is a "sort utility" that comes with the Fujitsu COBOL product - and is used on Windows.

If this is the case (the software comes with a Fujitsu COBOL product), I can see why it started in this forum.

I still think there will be better places to get an answer, but lets find out the environment first.

Bill Klein
 
OK - I posted in the 4th post of mine - "It's a Fujitsu mainframe - does that make any difference ??"

The reason for posting here is that there ISN'T a separate Mainframe Utils/JCL type forum. It comes into the COBOL forum because most of you COBOL programmers and IBM mainframers out there would have, undoubtedly coded a SORT step in a JCL proc in your careers.... I thought you'd be able to help......

As it turns out, none of the suggestions that have been proposed here work on a Fujitsu mainframe. Typical !!!! For whatever reason, Fujitsu "almost" copied IBM's utilites (IEBGENER = JSDGNER, IDCAMS = KQCAMS etc), but not the full functionlity.....

Any other suggestions as to how remove duplicate records from a file other that through a SORT. Obviously easy enough with another program, but I'm trying to fix the problem WITHOUT the need for another program.....



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top