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

Compare and create an output file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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

Superior Member


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

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

Hi,

If you want to use SUPERC, please go through the link:
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

Superior Member


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

PostPosted: Thu Jun 07, 2007 11:12 pm
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
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

Superior Member


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

PostPosted: Fri Jun 08, 2007 1:57 pm
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Jun 09, 2007 9:52 pm
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:

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

Superior Member


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

PostPosted: Mon Jun 11, 2007 9:33 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top