MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changed data in output file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Thu Nov 13, 2003 2:12 pm    Post subject: Changed data in output file Reply with quote

Hi everyone,

I have 2 files of LREC = 3000. I want to compare the first record in first file with first record in 2nd file. Then write the changed(modified) data in the output file(If any). Is it possible by any sort utility.

Example

Input File 1:

12345ABCDEFGfalse.

Input File 2:

12345ABCEDFGtrue.


Output file :

ABCEDFGtrue.


(first 5 bytes should be spaces.. as there was no data change).. I want out put also in the same format as input(But only modified data in the output)

Please let me know if I am not clear enough...

Actually my input file is very big enough(3000 bytes).


Thanks
Anand
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Nov 13, 2003 2:27 pm    Post subject: Reply with quote

I think, ISRSUPC (=3.13) is a better option here.

Nevertheless, what would you do if the number of records in the datasets are unequal?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Thu Nov 13, 2003 2:59 pm    Post subject: Reply with quote

Anand,

A couple of questions. Do you want to compare each and every byte of lrecl 3000? Do you have a key to compare?

The hardest part would getting only the differences(modified data) in the output record.

Do you have easytrieve at your shop?

cogito: Superc is not ideal tool for comparing files with lrecl greater than 250.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Thu Nov 13, 2003 3:03 pm    Post subject: Reply with quote

Kolusu,

Thanks for your reply... I have to compare each and every byte. And I have easy treive in my shop..

Thanks
Anand
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Nov 13, 2003 3:24 pm    Post subject: Reply with quote

Why is it so, Kolusu?

I quickly skimmed the manual. But, I do not see this written explicitly anywhere.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Thu Nov 13, 2003 4:27 pm    Post subject: Reply with quote

Anand,

The following JCl will give you the desired results.A brief explanation of the Job. The jobs reads in both the files and then takes each record from both the files and compares it against each and every byte in both records. If they differ then we write it out to the output record.

Code:

//STEP0100 EXEC PGM=EZTPA00                                 
//STEPLIB  DD DSN=EASYTREV.LOADLIB,               
//            DISP=SHR                                     
//SYSPRINT DD SYSOUT=*                                     
//SYSOUT   DD SYSOUT=*                                     
//SYSSNAP  DD SYSOUT=*                                     
//SYSUDUMP DD SYSOUT=*                                     
//INFILE1  DD DSN=YOUR INPUT FILE1,
//            DISP=SHR
//INFILE2  DD DSN=YOUR INPUT FILE2,
//            DISP=SHR
//OUTPUT   DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE),
//            DCB=(LRECL=3000,RECFM=FB,BLKSIZE=0)
//SYSIN    DD *
                                                                       
  FILE INFILE1                                                         
       IN-REC1          01 01  A OCCURS 3000                           
                                                                       
  FILE INFILE2                                                         
       IN-REC2          01 01  A OCCURS 3000                           
                                                                       
                                                                       
  FILE OUTPUT  FB(0 0)                                                 
       OUT-REC          01 01  A OCCURS 3000                           
                                                                       
  W-SUB                 W 04 N                                         
  S-WRITE-OUTPUT        W 01 A                                         
                                                                       
***********************************************************************
* MAINLINE                                                            *
***********************************************************************
                                                         
 JOB INPUT NULL                                           
                                                           
   GET INFILE1                                             
   GET INFILE2                                             
                                                           
   DO WHILE INFILE1                                       
      S-WRITE-OUTPUT  = 'N'                               
      W-SUB           = 1 

      DO UNTIL W-SUB GT 3000                                 
         IF IN-REC1 (W-SUB) = IN-REC2 (W-SUB)             
            OUT-REC (W-SUB) = ' '                         
         ELSE                                             
            S-WRITE-OUTPUT  = 'Y'                         
            OUT-REC(W-SUB)  = IN-REC2 (W-SUB)             
         END-IF                                           
         W-SUB              = W-SUB + 1   
      END-DO                                               
                                                           
      IF S-WRITE-OUTPUT     = 'Y'
         PUT OUTPUT                                       
      END-IF                                               
                                                           
      GET INFILE1                                         
      GET INFILE2                                         
   END-DO                                                 
                                                           
   STOP                           
//*



Hope this helps...

cheers

kolusu

Cogito: Superc is not a good tool for comparing datasets with lrecl greater than 250 is due to the truncation in the outputlisting. The max output listing you can have is only 205 or something , don't remember the exact length.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Fri Nov 14, 2003 2:58 pm    Post subject: Reply with quote

Kolusu,

Actually my input file have all types of data(char, integer, & comp).. Does ur solution work in that case?

Thanks
Anand
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Fri Nov 14, 2003 3:34 pm    Post subject: Reply with quote

Anand,

Why don't your test it for yourself and let me know if it works for the scenario you mentioned?

Thanks

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Thu Apr 06, 2006 11:52 am    Post subject: Reply with quote

Hi Kolusu !

Refering the code above, Is the comparision based on a key ?
How different is it from File - Aid ? Could you please explain.

Thanks and Regards,
Raveendra.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Thu Apr 06, 2006 12:01 pm    Post subject: Reply with quote

Quote:

Refering the code above, Is the comparision based on a key ?
How different is it from File - Aid ? Could you please explain

raveendra_ibm,

If you have read the posts clearly you would have found this

Quote:

The jobs reads in both the files and then takes each record from both the files and compares it against each and every byte in both records. If they differ then we write it out to the output record.


Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Thu Apr 06, 2006 12:55 pm    Post subject: Reply with quote

Hi Kolusu,

Sorry...... missed that.

Thanks,
Raveendra.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group