Page 1 of 1

i need compare to file..

PostPosted: Tue Mar 09, 2010 10:11 am
by NARASIMHA PRASAD RAO
Hi all,

i have 2 i/pfiles file A and file B .. for exp those record lenth is 4 ...\
file A:
1111
2222
5555
7777
file B:
3333
5555
8888 BY USEING THESE 2 INPUTFILES.I NEED THE O/P FILES HAS BELOW
FILE C:( THE COMMON RECORDS IN BOTH FILES A and B "5555" NEED TO BE REMOVED for the file A)
1111
2222
7777
File D :( ITS CONTAINS the common records on both files A and B)
5555


Can please need one give the solution to get this O/P FILES... USEING DFSORT...

Re: i need compare to file..

PostPosted: Tue Mar 09, 2010 10:41 am
by dick scherrer
Hello and welcome to the forum,

Your topic has been moved to the DFSORT part of the forum (from "Other Mainframe").

What should happen with the 8888 record, etc?

Re: i need compare to file..

PostPosted: Tue Mar 09, 2010 11:38 pm
by Frank Yaeger
NARASIMHA,

Your example and description are confusing. For example, 7777 is NOT common to File A and File B, yet you show it in File C. Why?
5555 and 7777 only appear in File A, yet you show one in File C and one in File D. Why? What about 8888 which only appears in File B?

You need to show a better example of your input and expected output and explain the "rules" for getting from input to output. If File A can have duplicates within it, show that in your example. If File B can have duplicates within it, show that in your example.

Also give the RECFM and LRECL of each file and the starting position, length and format of each relevant field.

Once you're described your requirement adequately, we can show you how to do what you want to do with DFSORT.

: i need compare to file..

PostPosted: Wed Mar 10, 2010 11:39 am
by NARASIMHA PRASAD RAO
i want delete the records in file A those same records avilable in File B...

Re: i need compare to file..

PostPosted: Wed Mar 10, 2010 11:47 am
by dick scherrer
Hello,

Now, go back, reread what Frank posted, and provide all of the requested information.
You need to show a better example of your input and expected output and explain the "rules" for getting from input to output. If File A can have duplicates within it, show that in your example. If File B can have duplicates within it, show that in your example.

Also give the RECFM and LRECL of each file and the starting position, length and format of each relevant field.

Re: i need compare to file..

PostPosted: Wed Mar 10, 2010 11:50 am
by NARASIMHA PRASAD RAO
i want delete the records in file A those mtachrecords avilable in File B... so the common record'5555
' need to be deleted...no need TO takecare off fileB records those records are not match with file A.

Re: i need compare to file..

PostPosted: Wed Mar 10, 2010 12:35 pm
by NARASIMHA PRASAD RAO
file A and file B both are soted files and they donot have any dulicates,bOTH file RECFM is FB and LRECLIS 4

Re: i need compare to file..

PostPosted: Wed Mar 10, 2010 1:16 pm
by NARASIMHA PRASAD RAO
file A and file B both are sroted files and they donot have any dulicates,bOTH file RECFM is FB and LRECL is 4

Re: i need compare to file..

PostPosted: Wed Mar 10, 2010 10:40 pm
by skolusu
Narasimha Prasad Rao,

The following DFSORT JCL will give you the desired results

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DUMMY,LRECL=4,RECFM=FB,BLKSIZE=27996                     
//SORTOUT  DD DSN=&&HDR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)           
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                     
  OUTFIL REMOVECC,NODETAIL,HEADER1=(4C'$')                             
//*                                                                     
//STEP0200 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT           
//         DD DSN=your input file A,DISP=SHR
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT           
//         DD DSN=your input file B,DISP=SHR
//UNQ      DD SYSOUT=*                                                 
//MATCH    DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'$$$$'),PUSH=(5:ID=1))   
  SORT FIELDS=(1,4,CH,A),EQUALS                                       
  SUM FIELDS=(5,1,ZD)                                                 
  OUTFIL FNAMES=UNQ,INCLUDE=(5,1,ZD,EQ,1),BUILD=(1,4)                 
  OUTFIL FNAMES=MATCH,BUILD=(1,4),                                     
  INCLUDE=(5,1,ZD,EQ,3,AND,1,4,CH,NE,C'$$$$')                         
//*

Re: i need compare to file..

PostPosted: Thu Mar 11, 2010 1:29 pm
by NARASIMHA PRASAD RAO
Thanks you sir