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
 

 

Compare and create an output file

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

New User


Joined: 26 Apr 2007
Posts: 49
Location: Delhi

PostPosted: Thu Jun 07, 2007 10:31 am    Post subject: Compare and create an output file
Reply with quote

Hi,
Say I have two files. File A is subset of File B.
Is there a way through which I can write the records (File B - File A) that is the non matching records of File A in File B, in a third file , File C.

I want it to be done through JCL.

Thanks in advance.
Mahua
Back to top
View user's profile Send private message

pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Thu Jun 07, 2007 11:31 am    Post subject: Re: Compare and create an output file
Reply with quote

U can implement SUPERC logic in JCL ...
using EXEC PGM=SUPERC....
and in output u can specify a Dataset to store the result....

I not not sure of the job syntax... u have to try icon_idea.gif
Back to top
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Thu Jun 07, 2007 12:01 pm    Post subject:
Reply with quote

check this code...
Code:

//SUPERC EXEC PGM=ISRSUPC,
//       PARM=(DELTAL,LINECMP,'','')
//OLDDD  DD DSN=data.set.one,DISP=SHR
//NEWDD  DD DSN=data.set.two,DISP=SHR
//OUTDD  DD DSN=data.set.output,DISP=(NEW,CATLG,DELETE),
                     DCB=(.....)
/*


SUPERC compare can be of following types:

File Compare
Summarizes differences between two files being compared

Line Compare
Record oriented. Shows matching, inserted, deleted and reformatted lines. Most useful for comparing lines of program source code. Can be used to help detect regressions and to validate appropriateness of code modifications.

Word Compare
Reveals differences in data strings delimited by spaces and punctuation marks, such as commas. Finds matching words, even when they are on different lines. Most useful for comparing two text data sets and tracking revisions in text documents.

Byte Compare
Finds differences in bytes. Best for comparing machine-readable and unformatted data.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Jun 07, 2007 12:19 pm    Post subject:
Reply with quote

Quote:
Is there a way

You can try with ICETOOL sort.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 07, 2007 11:01 pm    Post subject:
Reply with quote

Hi,

If you want to use SUPERC, please go through the link:
http://www.ibmmainframes.com/viewtopic.php?t=21544

Hopefully above link provides the answer.
As Devzee said, if SORT can be used, search for Smart DFSORT Tricks manual, you'll get solution of problem there.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 07, 2007 11:12 pm    Post subject:
Reply with quote

anuj_model wrote:
As Devzee said, if SORT can be used, search for Smart DFSORT Tricks manual, you'll get solution of problem there.

In the attachment search for:
'Create files with matching and non-matching records'.

& yeah by search I mean search on this site not in Google or so. icon_smile.gif
by the way for current requirement attachment is enough. Thanks to Frank Yaeger for this.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Fri Jun 08, 2007 1:55 am    Post subject:
Reply with quote

anuj_model Just a thought... You could have given the URL link and there is no need to attach the PDF.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jun 08, 2007 1:57 pm    Post subject:
Reply with quote

Devzee wrote:
anuj_model Just a thought... You could have given the URL link and there is no need to attach the PDF.


Yeah, that's a better idea. I tried to find the URL first but search on keyword DFSORT given me a lot of results.
This PDF was handy to me, so I attached for an easy reference.

I'll take care about this in future posts. icon_smile.gif
Back to top
View user's profile Send private message
ahr

New User


Joined: 24 Apr 2007
Posts: 14
Location: India

PostPosted: Fri Jun 08, 2007 5:22 pm    Post subject: Re: Compare and create an output file
Reply with quote

I am just giving an idea to extract the non-matching records from 2 files.

If you have reasonable knowledge in Easytrieve, you can do the below solution in 2 or 3 hours.

Sort File-A, File-B on a key,

Use Easytrieve to compare both the files and write the output to File-C.

Use the below logic to extract non-matching records.

Read records from FILE-A and FILE-B

Put the below logic in a loop.

If KEY-A = KEY-B
read File-A for next record
read File-B for next record
Else
If KEY-A > KEY-B
read File-B for next record
Else
read FILE-A for next record
END-IF
END-IF.

Hope I answered your question.
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: Sat Jun 09, 2007 9:52 pm    Post subject:
Reply with quote

Quote:
I tried to find the URL first but search on keyword DFSORT given me a lot of results.
This PDF was handy to me, so I attached for an easy reference.


The URL for the Smart DFSORT Tricks is:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

I've posted it many, many times on this board.

Please DO NOT attach the pdf in the future. I do revise the pdf so posting a static copy will eventually make it out-of-date.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jun 11, 2007 9:33 pm    Post subject:
Reply with quote

Thanks Frank.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
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


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