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

Global Moderator


Joined: 14 Mar 2007
Posts: 10350
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: 22
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10350
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: 212
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: 212
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 Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts NDM 300 files from mainframe to linux shreya19 All Other Mainframe Topics 2 Thu Oct 26, 2017 11:40 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

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