Compare field in one file with field in other file



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Compare field in one file with field in other file

Postby pgkkreddy1 » Tue Apr 09, 2019 10:08 pm

Hi,

Good morning. Please help me out with below sort card

File1 data:

201903
201905
201906
201902

File 2 data:
201903

I want to get the data from file1, with condition file1value less than file 2 value
Please help me to get this, I used join but not working

SORT FIELDS=COPY                      
JOINKEYS FILES=F1,FIELDS=(1,4,a)        
JOINKEYS FILES=F2,FIELDS=(1,4 ,a)        
REFORMAT FIELDS=(F1:1,449,?,F2:1,4)    
INCLUDE COND=(1,4,BI,LT,451,4,BI)      


Regards,
KK reddy
pgkkreddy1
 
Posts: 24
Joined: Wed May 13, 2015 8:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare field in one file with field in other file

Postby NicC » Wed Apr 10, 2019 3:21 pm

What is not working? How is it not working? Is this the only attempt that you have made?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Compare field in one file with field in other file

Postby pgkkreddy1 » Fri Apr 12, 2019 6:45 pm

Thank you Nic for the Reply.
I tried some other ways. But able to get.
Please help me out
pgkkreddy1
 
Posts: 24
Joined: Wed May 13, 2015 8:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare field in one file with field in other file

Postby Garry F Carroll » Fri Apr 12, 2019 7:46 pm

I tried some other ways. But able to get.


This is not helpful. You need to explain clearly what you are trying to achieve. What format is your input? What is the DCB info for the datasets?

You show e.g. 201903 which is a 6-byte field and your sort control cards specify 4-byte fields to be treated as BI. Is this input in zoned-decimal (ZD) format or are you showing binary values from 4-byte fields?

What is your desired result? You say
I want to get the data from file1, with condition file1value less than file 2 value
Which value ? All your 4-byte fields as shown have the same value in both datasets. Bytes 5 & 6 are the only differences and these are not mentioned in your control cards. Why do you need a JOIN ? Is there only one record in the second dataset or can there be multiple records?

Can you show any of your failing jobs?

Garry.
Garry F Carroll
 
Posts: 28
Joined: Wed Sep 19, 2018 8:20 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Compare field in one file with field in other file

Postby pgkkreddy1 » Fri Apr 12, 2019 10:18 pm

Hi,

Thank you.

yes it is binary format. first 2 bytes year and second 2 bytes Month.

Jnf1 : 449 length and jnf2: 80 out file: 449

[code=mainframe]SYSIN :                                                          
  SORT FIELDS=COPY                                                
  JOINKEYS FILES=F1,FIELDS=(1,2,A,3,2,A)                          
  JOINKEYS FILES=F2,FIELDS=(1,2,A,3,2,A)                          
  REFORMAT FIELDS=(F1:1,449,?,F2:1,4)                            
  INCLUDE COND=(1,4,BI,EQ,451,4)                                  
                                *                                
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED    
WER251A  INCLUDE/OMIT INVALID FORMAT                              
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                    
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE      
             

Thank you
KK
pgkkreddy1
 
Posts: 24
Joined: Wed May 13, 2015 8:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare field in one file with field in other file

Postby Garry F Carroll » Sat Apr 13, 2019 1:11 am

Only part of the DCB provided.... are these datasets FB or VB ? If VB, you haven't allowed for the 4-byte RDW at the start of the record.

You've posted in the DFSORT forum but are using SYNCSORT - which is a competitor product and has a separate section. Try posting in the correct location in future.

You haven't shown anything from a failing job? The JCL, control cards and any output would be useful. You haven't said what your expected output should look like.
Please supply all relevent information when posting. which records should be output and where are you outputting these? Your INCLUDE might just output the "joined" records.

Garry.
Garry F Carroll
 
Posts: 28
Joined: Wed Sep 19, 2018 8:20 pm
Has thanked: 0 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post