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

Eliminate DUPLICATES and SORT at the same time


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

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Wed Dec 03, 2008 12:05 pm
Reply with quote

Hi ...
Is it possible to eliminate DUPLICATES and at the same time , again use SORT FIELDS in the sort card to Sort a particular field in the ascending order ? Giving the SORT FIELDS twice gives the error :
Code:

WER269A  SORT STATEMENT    : DUPLICATE STATEMENT FOUND


I am trying to select Unique records using SORT FIELDS on the column -
SORT FIELDS=(15,10,CH,A)
and then when I write my report I am trying to sort the output records based on the STATE by using
SORT FIELDS=(68,2,CH,A)

How else can I get my output sorted Statewise without using SORT FIELDS again.
The following is my SORT CARD :
Code:

JOINKEYS FILE=F1,FIELDS=(15,10,A)                           
SORT FIELDS=(15,10,CH,A),EQUALS                             
SUM FIELDS=NONE                                             
JOINKEYS FILE=F2,FIELDS=(01,10,A)                           
REFORMAT FIELDS=(F2:1,67,F1:25,6)                           
SORT FIELDS=(68,2,CH,A),EQUALS                               
OUTFIL REMOVECC,                                             
       HEADER2=(30:'J A Y S   R E P O R T   O N  IYUIOS 5',/,
                35:'LAST PURCHASES MADE IN 2003',//,         
                02:'NAME',                                   
                20:'STREET ADDRESS',                         
                52:'CITY',                                   
                68:'STATE',                                 
                75:'DATE',/),                               
        OUTREC=(02:11,15,                                   
                20:31,20,                                   
                52:51,15,                                   
                68:68,2,                   
                73:70,2,C'/',72,2,C'/',68,2)
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 03, 2008 12:15 pm
Reply with quote

JayC,

As the message indicates, Syncsort does not support the usage of more than one SORT statement. Also you cannot expect it to work the way you're expecting.

The JOIN operation sorts your input files on the key fields by default unless you specify the 'SORTED' option which implies that the files are presorted. You can specify only a single SORT statement which takes the JOINed records as input. If you describe what exactly you are trying to do, somebody here might be able to help.
Back to top
View user's profile Send private message
JayC

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Wed Dec 03, 2008 12:29 pm
Reply with quote

Much obliged....Didn't expect it to work my way...
I was asking if there is any other way....

Thanks for the info.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 03, 2008 12:44 pm
Reply with quote

Quote:
I was asking if there is any other way
Can be answered only when you explain what you are trying to do. Post a few sample records and describe the rules for getting the output along with input/output file attributes.
Back to top
View user's profile Send private message
JayC

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Thu Dec 04, 2008 11:21 am
Reply with quote

Thanks for the clarification Arun
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Dec 04, 2008 1:04 pm
Reply with quote

Quote:
Thanks for the clarification Arun
JayC,

It was not a clarification. It was a request from me asking you to post some more details about your requirement. icon_biggrin.gif
Back to top
View user's profile Send private message
JayC

New User


Joined: 27 Sep 2008
Posts: 70

PostPosted: Thu Dec 04, 2008 2:23 pm
Reply with quote

I understood that Arun, icon_smile.gif
It was a general doubt that struck me, I frankly don't have a requirement that I am trying to get to. I

ts just that I was trying to do some thing and this just struck me.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top