Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
using sort utility i want to compare the records with in the

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: using sort utility i want to compare the records with in the
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Feb 04, 2016 7:17 pm    Post subject: Reply to: using sort utility i want to compare the records with in the
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Feb 04, 2016 8:54 pm    Post subject: Reply to: using sort utility i want to compare the records with in the
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Feb 04, 2016 9:34 pm    Post subject: Reply to: using sort utility i want to compare the records with in the
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: 578
Location: USA

PostPosted: Thu Feb 04, 2016 10:08 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Feb 04, 2016 10:49 pm    Post subject:
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    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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us