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: 33
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

Senior Member


Joined: 14 Mar 2007
Posts: 10535
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: 33
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

Senior Member


Joined: 14 Mar 2007
Posts: 10535
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: 379
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: 379
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
No new posts Anyone know how to copy Unix files? John Poulakos JCL & VSAM 7 Wed Oct 10, 2018 12:57 am
No new posts PL/I read error for HFS files Joe Kirsch PL/I & Assembler 6 Fri Sep 28, 2018 9:13 pm
No new posts Need help on the multiple files refor... wik123 DFSORT/ICETOOL 7 Wed Sep 19, 2018 10:47 am
No new posts ICETOOL - Finding keys within a file nartcr DFSORT/ICETOOL 10 Mon Sep 17, 2018 6:39 am
No new posts Merge two files and sum up the count ... preeti6 JCL & VSAM 6 Thu Sep 06, 2018 10:57 am

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