Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem in Sort Utility

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Wed Apr 27, 2005 6:07 pm    Post subject: Problem in Sort Utility
Reply with quote

I have two record set A and B

I want record set C whcih contain only records which ar in A but not in B.

Is it possible through any Utility. If yes , How?
Please let me know.
Back to top
View user's profile Send private message

somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Wed Apr 27, 2005 7:13 pm    Post subject:
Reply with quote

Rupesh.Kothari
This may be possible using SORT.
Please provide the following details. So that some body will be able to help you.

1. Sort Utility name: DFSORT/SYNCSORT
2.File Type and LRECL
3.Key field position and length.
4.Whether the files have duplicates etc..
5.Sample Input and expected output.

Regds
-Som
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Apr 27, 2005 8:12 pm    Post subject:
Reply with quote

Rupesh,

I think this "Smart DFSORT Trick" will show you how to do what you want to do using DFSORT's ICETOOL. It covers the cases where there are no duplicates within each file and where there are duplicates within each file:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst02.html#t05

If you need more specific help, answer Som's questions so we know exactly what you're trying to do.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Wed Apr 27, 2005 10:53 pm    Post subject: Re: Sort Utility
Reply with quote

Hi Soms

Thanks for your responce

1. Sort Utility name: DFSORT/SYNCSORT
Any utility

2.File Type and LRECL

Filetype = FB and LRECL= 80

3.Key field position and length.
Total record length means 80

4.Whether the files have duplicates etc..

File may contain duplictaes

5.Sample Input and expected output.

Record in File A
Vickey
Harry
Mogtel
Chikki
Bippu

Records in B
Harry
Marry
Expect
Vickey

Expected Records in C
Mogtel
Chikki
Bippu


let me know if you want more info.
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Wed Apr 27, 2005 11:28 pm    Post subject:
Reply with quote

Rupesh,
Did you check the link provided by Frank(He is the DFSORT guru) ?
That will give exactly what you are looking for.
It has two jobs one wihout duplicates and the other with duplicates.
Check the file OUT1 mentioned in these jobs. This will give you the unmatched records present in File A.

Regds
-Som
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Thu Apr 28, 2005 11:03 am    Post subject: Re: Sort Utility
Reply with quote

Hi,
I checked the link but the JCL provided there is not working. as I m new in mainframe Could you guide me?
Thanks
Rupesh Kothari
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 28, 2005 9:07 pm    Post subject:
Reply with quote

Quote:
I checked the link but the JCL provided there is not working. as I m new in mainframe Could you guide me?


I wrote "the JCL there" and it certainly does work with DFSORT/ICETOOL. If it does not work for you, then there's some difference in what you did. In order for us to actually help you, you have to give us the appropriate information so we can see what you did and what the result was.

Post the actual JCL and control statements YOU used and the //TOOLMSG and //DFSMSG messages YOU received.
Back to top
View user's profile Send private message
prasaad_rao

New User


Joined: 26 Apr 2005
Posts: 2

PostPosted: Fri May 06, 2005 3:55 pm    Post subject:
Reply with quote

File A
SORT FIELDS = COPY
OUTREC FIELDS = (1,80,C'1')

File B

SORT FIELDS = COPY
OUTREC FIELDS = (1,80,C'2')

Now concatenate the tWo files
SORT FIELDS = (1,8,CH,A) /* the name field position
SUM FIELDS = (81,1,ZD)
OUTFILE FILES = 01,
INCLUDE = (81,1,CH,EQ,C'1')
OUTREC FIELDS = (1,80)
OUTFILE FILES = 02,
INCLUDE = (81,1,CH,EQ,C'2')
OUTREC FIELDS = (1,80
OUTFILE FILES = 03,
INCLUDE = (81,1,CH,EQ,C'3')
OUTREC FIELDS = (1,80


File 1 contains the records of file A not in file B
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Fri May 06, 2005 4:09 pm    Post subject:
Reply with quote

Hi Prasaad,

Could you explain your sort more clearly...

Thanks
Tanden
Back to top
View user's profile Send private message
prasaad_rao

New User


Joined: 26 Apr 2005
Posts: 2

PostPosted: Fri May 06, 2005 4:13 pm    Post subject:
Reply with quote

Hi Rupesh,
i think u can get the desired records by Using Syncsort.But as shown below u have to u Sort utility 3 times,

File A
SORT FIELDS = COPY
OUTREC FIELDS = (1,80,C'1')

File B

SORT FIELDS = COPY
OUTREC FIELDS = (1,80,C'2')

Now concatenate the tWo files
SORT FIELDS = (1,8,CH,A) /* the name field position
SUM FIELDS = (81,1,ZD)
OUTFILE FILES = 01,
INCLUDE = (81,1,CH,EQ,C'1')
OUTREC FIELDS = (1,80)
OUTFILE FILES = 02,
INCLUDE = (81,1,CH,EQ,C'2')
OUTREC FIELDS = (1,80
OUTFILE FILES = 03,
INCLUDE = (81,1,CH,EQ,C'3')
OUTREC FIELDS = (1,80


Regards
Satya
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us