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
 
compare two files on fields with different declarations

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
madishpa

New User


Joined: 18 May 2007
Posts: 27
Location: Hyderabad

PostPosted: Fri Aug 12, 2011 1:16 pm    Post subject: compare two files on fields with different declarations
Reply with quote

I need to compare two files on field with different declarations.

field on which files is to be compared is amount.

Input file1:

lrecl - 80, recfm - fb

Amount is first 8 bytes in first file . declaration is 9(5).9(2)


Inut file2 :

lrecl - 80, recfm - fb

Amount is first 5bytes in second file , declaration is s9(5)v9(2) comp-3.


If the amount in file1 matches with file2 , then record should be written to output file from first file

Output file :

Lrecl - 80 , recfm - fb

Could you please provide dfsort job for the above requirement.

Thanks
Madishpa
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1522
Location: Chennai

PostPosted: Fri Aug 12, 2011 1:22 pm    Post subject:
Reply with quote

Quote:
Could you please provide dfsort job for the above requirement.

Hi, What have you done to approach the requirement? & where are you having difficulty.. If you are stuck somewhere then we would be glad to help in resolving.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Aug 12, 2011 3:53 pm    Post subject:
Reply with quote

Please post some sample input data and sample output data....
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Fri Aug 12, 2011 5:26 pm    Post subject:
Reply with quote

madishpa,
Do you have any other key fields that you can use (along with amount field) to match records from both the files? Using amount as a key field to match 2 files, makes your job more vulnerable to have many to many match, in which case you would end up with more number of matched record than present in your File1.

However, see if below works...
Code:
//STEP0001 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTJNF1 DD DISP=SHR,DSN=INPUT FILE1 FB/80
//SORTJNF2 DD DISP=SHR,DSN=INPUT FILE1 FB/80
//SORTOUT  DD DSN=OUTPUT FILE FB/80         
//SYSIN DD *                                 
  JOINKEYS FILE=F1,FIELDS=(01,7,A)           
  JOINKEYS FILE=F2,FIELDS=(01,7,A)           
  REFORMAT FIELDS=(F1:1,80)                 
  OPTION COPY                               
/*                                           
//JNF2CNTL DD *                             
  INREC BUILD=(1:1,4,PD,TO=ZD,LENGTH=07)     
/*                                           

Thanks,
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Aug 12, 2011 5:31 pm    Post subject: Re: compare two files on fields with different declarations
Reply with quote

madishpa wrote:
Inut file2 :

lrecl - 80, recfm - fb

Amount is first 5bytes in second file , declaration is s9(5)v9(2) comp-3.



s9(5)v9(2) comp-3 would be 4 bytes not 5.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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