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
 

 

Fetching records of a file via SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
skrishnavijay

New User


Joined: 26 Sep 2007
Posts: 25
Location: chennai

PostPosted: Fri Dec 07, 2007 9:56 pm    Post subject: Fetching records of a file via SYNCSORT
Reply with quote

Hi all,

I have the following requirement.

There are two files with some similar records(say file A has more records then file B). My intention is to get those records which are in file A and NOT in file B (i..e.. A - B).

Krishna
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Dec 07, 2007 10:03 pm    Post subject:
Reply with quote

Krishna,

If you are interested in using DFSORT util, follow the link -

http://www.ibmmainframes.com/viewtopic.php?t=5797&highlight=compare
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: Fri Dec 07, 2007 10:40 pm    Post subject:
Reply with quote

Krishna,

You haven't given enough information.

Please show an example of the records in each input file (relevant fields only) and what you expect for the output records. If input fileA can have duplicates within it, show that in your example. If input fileB can have duplicates within it, show that in your example.

Give the starting position, length and format of the relevant fields.

Give the RECFM and LRECL of each input file.
Back to top
View user's profile Send private message
skrishnavijay

New User


Joined: 26 Sep 2007
Posts: 25
Location: chennai

PostPosted: Fri Dec 07, 2007 11:07 pm    Post subject:
Reply with quote

File 1:

LRECL=80, (1,21,CH,A) Key position

000000000000000000024|........
000000000000000000132|........
000000000000000000024|........
000000000000000001879|........
000000000000000002134|........
000000000000012084883|........
000000000000000321833|........
000000000000000002134|........
000000000000000032156|........

File 2:

LRECL=80, (34,21,CH,A) Key position

..............................000000000000000000024|........
..............................000000000000000000132|........
..............................000000000000000000024|........
..............................000000000000000001879|........
..............................000000000000000002134|........
..............................000000000000000321833|........
..............................000000000000012084883|........

here File2 is subset of File1. I want records in File1 and NOT in File2.
I need to concern about Key field only and both file1 and file2 have duplicates.

Hope I am clear.

Thanks in advance,
Krishna
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: Fri Dec 07, 2007 11:50 pm    Post subject:
Reply with quote

Quote:
Hope I am clear.


Not really.

I assume you're matching by key, not by relative record number ... right?

It would have helped if you'd showed what you expect for output as I asked you to. Do you just expect this record from File1 for output?

000000000000000032156|........

If you have multiple records with the same key in file1 without a match in file2, do you want all of those file1 records for output, or just one of them.
For example, if file1 had:

000000000000000000892|........
000000000000000000892|........
000000000000000000892|........

would you want all three records for output or just one?
Back to top
View user's profile Send private message
skrishnavijay

New User


Joined: 26 Sep 2007
Posts: 25
Location: chennai

PostPosted: Mon Dec 10, 2007 10:48 am    Post subject: Reply to: Fetching records of a file
Reply with quote

Thanks for your patience.

I forgot to mention that my input & output files are fixed length(FB 80)

Yes.

As you said I want one of the records(duplicates) in file1 those doesn't have a match in file2 (I want the full record from file1)

Also we are using SYNCSORT. Could you please help me in this regard ?

Thanks in advance,
Krishna
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Mon Dec 10, 2007 1:36 pm    Post subject:
Reply with quote

skrishnavijay,

Please check with the following code for for your requirement.
Code:
// EXEC PGM=SORT                     
//SORTJNF1 DD *                       
000000000000000000024|........       
000000000000000000132|........       
000000000000000000024|........       
000000000000000001879|........       
000000000000000002134|........       
000000000000012084883|........       
000000000000000321833|........       
000000000000000002134|........       
000000000000000032156|........       
/*                                   
//SORTJNF2 DD *                       
.................................000000000000000000024|........   
.................................000000000000000000132|........   
.................................000000000000000000024|........   
.................................000000000000000001879|........   
.................................000000000000000002134|........   
.................................000000000000000321833|........   
.................................000000000000012084883|........   
/*                                                               
//SORTOUT DD SYSOUT=*                                             
//SYSOUT DD SYSOUT=*                                             
//SYSIN DD *                                                     
 JOINKEYS FILE=F1,FIELDS=(1,21,A)                                 
 JOINKEYS FILE=F2,FIELDS=(34,21,A)                               
 JOIN UNPAIRED,F1,ONLY                                           
 SORT FIELDS=(1,21,CH,A)                                         
 SUM FIELDS=NONE                                                 
/*                                                               
//

Output:
Code:
000000000000000032156|........
Back to top
View user's profile Send private message
skrishnavijay

New User


Joined: 26 Sep 2007
Posts: 25
Location: chennai

PostPosted: Mon Dec 10, 2007 3:34 pm    Post subject:
Reply with quote

Thanks a lot Shankar......!!

You are very helpful... Its working gr8.......!!!


Thanks,
Krishna
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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