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

using sort utility i want to compare the records with in the


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kalakuntlavenkat

New User


Joined: 10 Nov 2008
Posts: 6
Location: Hyderabad

PostPosted: Thu Feb 04, 2016 6:14 pm
Reply with quote

Hi All,

I need help on sort utility to compare the records with in the file(taking first record and I want to compare with second record and second record with third record and so on....) and I want to insert a 'X" to that first record at end of the record if first records differed to second record after comparison.

record are on sorted order only based on this 4 fields.
for example -

Code:
POL_NBR(7)MODU_NBR(2)   POL_EFF_DT(8)    LOB(6)
A0EE8D8   26   20150914   664702
G29DST5   01   2015-07-18   664503
G29DST6   01   2015-07-18   664503
G29DTTC   01   2015-09-20   664503
G2B3BV8   09   2015-09-21   664503
G2B3Z5W   10   2015-09-20   664503
G2B975T   11   2015-09-18   664503
G2B975V   11   2015-09-18   664503
G2BNN30   07   2010-07-08   664503
G2BNN30   08   2011-07-08   664503
G2BR8XG   11   2015-09-29   664503
G2BRV9K   10   2015-02-17   664503
G2BTXWG   07   2014-11-01   664503
G2BV11F   08   2015-02-02   664503
G2BV11F   08   2015-02-02   664503
G2BV11F   08   2015-02-02   664503
G2BV11F   08   2015-02-02   664503
G2BV11F   08   2015-02-02   664503
G2BV5KB   10   2015-09-06   664503



Thanks in advance for the help.

Code'd
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 Feb 04, 2016 7:17 pm
Reply with quote

Use JOINKEYS with the same dataset for both inputs.

Using JNF1CNTL, extend your record with a sequence number starting at one.

Using JNF2CNTL, extend your record with a sequence number starting at zero.

JOIN UNPAIRED,F1

Specify all your data from both files in the REFORMAT statement.

Compare. Output your data with BUILD on INREC in the main task.

The final F1 record will be unmatched.

There are examples here.
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 Feb 04, 2016 8:54 pm
Reply with quote

Here's an example.
Back to top
View user's profile Send private message
kalakuntlavenkat

New User


Joined: 10 Nov 2008
Posts: 6
Location: Hyderabad

PostPosted: Thu Feb 04, 2016 9:22 pm
Reply with quote

Thanks Bill,

I need one more help on sorting

I am planning to compare two files based on fields located in different position(not at same place ) in the files. But the fields position in the two files are same.

I want compare these two files based on these fields, if I my first file first record does not match with second file first record, I need to insert ' " at end of the first record of the first file and if it matches I want insert 'X' to first file record and I want to write all the matched and unmatched records to output file from the only first input file only.

both file length are same like..150
first filed from 2 to 8
second field 15 to 22
third filed is from 34 to 41

pld help on this...it is an urgent. Thanks in advance.
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 Feb 04, 2016 9:34 pm
Reply with quote

What is unclear about what I described against what you want? Did you look through the link provided?

I could be run over, involved in a dramatic shoot-out, or sit on my router at any moment. What would you do then?

Unless you want to pay, you have to get down to it. If you get stuck, show what you've done and what problem you had.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Feb 04, 2016 10:08 pm
Reply with quote

If its small enough record length, you could PUSH records to next one and treat them like any other compare you would run through DFSort.

Quote:
I could be run over, involved in a dramatic shoot-out, or sit on my router at any moment. What would you do then?

Bill, I hope you are ok after dramatic post icon_smile.gificon_smile.gif
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 Feb 04, 2016 10:49 pm
Reply with quote

sqlcode1 wrote:
If its small enough record length, you could PUSH records to next one and treat them like any other compare you would run through DFSort.


There's an example of that in the post I linked to as well.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts REASON 00D70014 in load utility DB2 6
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top