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
 

 

Match unmatc from single file

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

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Nov 28, 2013 7:03 pm    Post subject: Match unmatc from single file
Reply with quote

I have a input file where there are two types of records
1. Records from position 1-30 (rest are blank)
2. Records from position 41-80 (rest are blank)

Now there is comman key in both these two type of records of 10 bytes
11-20 (in first type of record)
51-60 (in second type of records)


I want the output as below
1. if the key is match, i want consolidated record of two records means from pos 1-80 where 11-20 and 51-60 will have same value as key is matched
2. if the key is not matching then i want to retain both the records as it is

Input

Code:
54545022  JOHNS   12     54775                                         
54545022  FACT005 89     88545                                         
54545022  GTOP    88     54566                                         
                                        STREET 15 MILLER5589 652 5398566
                                        STREET 15 FACT005 89 652 5398FSD
                                        STREET 15 GTOP    88 652 5398TRE



Output

Code:
54545022  JOHNS   12     54775                                         
54545022  FACT005 89     88545          STREET 15 FACT005 89 652 5398FSD
54545022  GTOP    88     54566          STREET 15 GTOP    88 652 5398TRE
                                        STREET 15 MILLER5589 652 5398566



Here FACT005 89,GTOP 88 are matching keys

As the volume of records is huge i need to do it in single step.
Hope i am clear with reuirement
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Nov 28, 2013 7:22 pm    Post subject: Reply to: Match unmatc from single file
Reply with quote

As the volume of records is huge, you need to do it efficiently. Efficiently dictates how many steps, not the other way around.

JOINKEYS with the same DSN as both inputs

In JNF1CNTL create a record only containing the "left side" data.

In JNF2CNTL create a record only containing the "right side" data.

JOIN UNPAIRED,F1,F2

REFORMAT with F1:entire-record,F2:entire-record

That's about it.

Unless you can have duplicate keys in either or both sets of data...
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Nov 28, 2013 7:30 pm    Post subject:
Reply with quote

But unpaired will retain only unmatch records but i want both match and unmatch records
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Nov 28, 2013 7:32 pm    Post subject: Reply to: Match unmatc from single file
Reply with quote

Well, instead of asserting that, why don't you read the manual? If you don't believe the manual, why don't you experiment? If you then sill feel the need to make the same objection, by all means do so.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Fri Nov 29, 2013 7:16 pm    Post subject:
Reply with quote

for the same requirement mentioned above i am using the same file in
SORTJNF1,SORTJNF2 and keys are starting at position 34 and 75 both are of 10 bytes.Keys are alphanumeric

i am using below sort card

Code:
JOINKEYS FILE=F1,FIELDS=(34,10,A)                         
 JOINKEYS FILE=F2,FIELDS=(75,10,A)                         
 JOIN UNPAIRED,F1,F2                                       
 REFORMAT FIELDS=(F1:1,45,F2:47,58)                       
  SORT FIELDS=COPY                                         



But in output i am getting only spaces,but i want a consolidated record for both match and unmatch keys
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Sat Nov 30, 2013 4:25 am    Post subject: Reply to: Match unmatc from single file
Reply with quote

Quote:
where 11-20 and 51-60 will have same value as key is matched


Quote:
JOINKEYS FILE=F1,FIELDS=(34,10,A)
JOINKEYS FILE=F2,FIELDS=(75,10,A)
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Sat Nov 30, 2013 1:23 pm    Post subject:
Reply with quote

Hi Bill

Sorry for confusion this file has different layout but the requirement is same

keys start from position 34 and 75
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Sat Nov 30, 2013 5:52 pm    Post subject: Reply to: Match unmatc from single file
Reply with quote

What happened to your JNFnCTNL files? You have probably included blank data for all the blank keys, which will match before the match you want.

When creating the "left side" data, you remove all the keys which are blank. When creating the "right side" data you do the same. You need to have the JOINKEYS sort the data for the match, so the sort will be more efficient the less data you give it. Cut down the records, as I suggested.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Dec 03, 2013 12:47 am    Post subject:
Reply with quote

It can be done in a single step itself instead of joinkeys. Just use an IFTHEN validating the space for record type 1 and place the key at the end of the record.

Now sort on the key value at the end and use WHEN=GROUP on OUTREC to push the value for matched records. Use OUTFIL sections with Trailer3 to get just 1 record per key.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Dec 03, 2013 3:45 pm    Post subject:
Reply with quote

Hi Skolusu

Thanks for reply

I am unable to understand WHEN=GROUP logic
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 03, 2013 8:03 pm    Post subject:
Reply with quote

Hello,

There are several examples in previous topics.

Suggest you use the SEARCH facility (in the blue line near the top) to locate some. Most have sample data and the sort code to do this.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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