Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Finding difference between two PS files!!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 32
Location: India

PostPosted: Mon Oct 30, 2017 1:13 pm    Post subject: Finding difference between two PS files!!!
Reply with quote

Hi all,

I have the following file:

File 1:

Code:
"STARTOFDATA","FILE_GENERATION_TIMESTAMP={20171025_004001_EST};APPLICATION_MNEMO
"ENDOFDATA","RECORDCOUNT={115501};PRINCIPAL_RECORDCOUNT={0};GROUP_RECORDCOUNT={7998

File2:

Code:
"STARTOFDATA","FILE_GENERATION_TIMESTAMP={20171026_004001_EST};APPLICATION_MNEMO
"ENTITLEMENT","PERSON","50027SCOTT23","50027SCOTT23","ACCOUNT RECON","RESOURCE",
"ENTITLEMENT","PERSON","50027VIKK123","50027VIKK123","ACCOUNT RECON","RESOURCE",
"ENDOFDATA","RECORDCOUNT={115501};PRINCIPAL_RECORDCOUNT={0};GROUP_RECORDCOUNT={8000


Both the files are of same record length 850 and FB. I need to write the unmatched records in file 2 to a PS. Here we can see the time stamp, two additional records and record count differs.

Code:
//SORTTSC  EXEC PGM=SORT                                     
//SORTJNF1 DD DSN=G0435V00,DISP=SHR
//SORTJNF2 DD DSN=G0436V00,DISP=SHR
//UNMATCH  DD DSN=UNMATCH,         
//            DISP=(OLD,CATLG,CATLG),                         
//            UNIT=,                                         
//            DATACLAS=TST090P5,                             
//            DCB=(LRECL=850,BLKSIZE=0,RECFM=FBS),           
//            SPACE=                                         
//SYSOUT   DD SYSOUT=*                                       
//SYSIN    DD *                                               
  OPTION COPY                                                 
  JOINKEYS F1=SORTJNF1,FIELDS=(1,850,A)                       
  JOINKEYS F1=SORTJNF1,FIELDS=(1,850,A)
  JOINKEYS F2=SORTJNF2,FIELDS=(1,850,A)
  JOIN UNPAIRED,F2,ONLY               
  OUTFIL FNAMES=UNMATCH,BUILD=(1,850) 
/*                   


I used the above JCL and got the below output:

Code:
"ENDOFDATA","RECORDCOUNT={115501};PRINCIPAL_RECORDCOUNT={0};GROUP_RECORDCOUNT={8
"ENTITLEMENT","PERSON","50027SCOTT23","50027SCOTT23","ACCOUNT RECON","RESOURCE",
"ENTITLEMENT","PERSON","50027VIKK123","50027VIKK123","ACCOUNT    RECON","RESOURCE",
"STARTOFDATA","FILE_GENERATION_TIMESTAMP={20171026_004001_EST};APPLICATION_MNEMO

I have got the unmatched records, but the start and end records are swapped.

Can anyone help me with this sort?

Thanks!

CODE' D
Back to top
View user's profile Send private message

enrico-sorichetti

Moderator


Joined: 14 Mar 2007
Posts: 10472
Location: italy

PostPosted: Mon Oct 30, 2017 2:34 pm    Post subject: Reply to: Finding difference between two PS files!!!
Reply with quote

why did You post into the JCL section when there are specific section for the sort questions?

tell what sort product You are using and the topic will be moved to the proper section

messages starting with
WER... ==> SYNCSORT
ICE... ==> IBM DFSORT
Back to top
View user's profile Send private message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 32
Location: India

PostPosted: Mon Oct 30, 2017 3:18 pm    Post subject:
Reply with quote

We use syncsort. Sorry for the inconvenience caused!
Thanks!
Back to top
View user's profile Send private message
enrico-sorichetti

Moderator


Joined: 14 Mar 2007
Posts: 10472
Location: italy

PostPosted: Mon Oct 30, 2017 3:37 pm    Post subject:
Reply with quote

moved!
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 303
Location: Maryland

PostPosted: Mon Oct 30, 2017 6:39 pm    Post subject: Re: Finding difference between two PS files!!!
Reply with quote

Vignesh Sid wrote:
I have got the unmatched records, but the start and end records are swapped.

Can anyone help me with this sort?

Your JOINKEYS statements do not specify SORTED option. That's why the sort utility performs its internal sort before attempting to join both inputs (FYI: there is no other way to join long files unless they are either sorted, or assumed to be sorted).

When just adding SORTED option you'll get the error "Fx FILE IS NOT SORTED", or similar.
You can try to play with the options "SORTED,NOSEQCK" but the desired output is not guaranteed since the input comes in random order.

Another method:
1) re-number input records from F2 on input (using //CTL2CNTL DD),
2) then SORT by this sequenced field after JOIN (to restore the original order), and
3) finally truncate this field in either OUTREC, or OUTFIL statement.
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 303
Location: Maryland

PostPosted: Mon Oct 30, 2017 7:03 pm    Post subject:
Reply with quote

A typo in my previous message:

It must be //JNF2CNTL DD instead of //CTL2CNTL DD

Sorry for that
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us