Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comparing two files and create match records in o/p

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

New User


Joined: 10 Dec 2012
Posts: 20
Location: Australia

PostPosted: Mon Feb 11, 2013 8:59 am    Post subject: Comparing two files and create match records in o/p
Reply with quote

Hi,

I have two files as mentioned below. For each of the data in File 1, matching record in File 2 has to be written in the output.
File 1 (FB 80 ) - contains numeric data of size 9 - List of A/C's
Code:
----+----1---
576111111

File 2 (VB 381) - Hex format. List of Branch Code and A/C in HEX starting from Position 3
Code:
------+----1---
CC0811000056111
31011C00007111C


Need an output file with following contents (FB 80) - Mentioned in Hex Format

Record Hdr
Code:
----+----1---
0000000000000
000C00000000C

Record 1
Code:
----+----1---
0811000056111
011C00007111C

Record 2
Code:
----+----1---
0811099999999
011C99999999C

Record Trailer
Code:
----+----1---
0999099999999
999C99999999C


Record header and trailer - only one occurence
Record 1 is the matching record. Record 2 represents a single record for each branch code that gets matched (Record1) but with account code as Hex 9's in the output.

Require help in doing this with the DFSORT. Thanks.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Mon Feb 11, 2013 1:13 pm    Post subject: Reply to: Comparing two files and create match records in o/
Reply with quote

Firstly, what you are calling "HEX" is just "packed-decimal".
Back to top
View user's profile Send private message
Bharath RajaramSridharan

New User


Joined: 10 Dec 2012
Posts: 20
Location: Australia

PostPosted: Tue Feb 12, 2013 4:22 am    Post subject: Comparing two files and create match records in o/p
Reply with quote

Hi Bill,

The fields which I have mentioned as Hex are Packed Decimal data type.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Feb 12, 2013 4:44 am    Post subject:
Reply with quote

Hi Bharath,

Suggest you post what you have tried so far... That way someone here could easily correct where you have gone wrong...
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Feb 12, 2013 4:55 am    Post subject: Reply to: Comparing two files and create match records in o/
Reply with quote

use the following DFSORT JCL which will give you the desired results.




Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//INA      DD DISP=SHR,DSN=Your Input VB file
//INB      DD DISP=SHR,DSN=Your Input FB file                           
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION COPY                                               
  JOINKEYS F1=INA,FIELDS=(18,9,A)                           
  JOINKEYS F2=INB,FIELDS=(01,9,A)                           
  REFORMAT FIELDS=(F1:5,13)                                 
  OUTFIL REMOVECC,BUILD=(1,13,/,1,4,X'09999999999999999C'),
  HEADER1=(X'0000000C',X'00000000000000000C'),             
  TRAILER1=(X'0999999C',X'09999999999999999C')             
//*                                                         
//JNF1CNTL DD *                                             
  INREC BUILD=(1,4,7,13,15,5,PD,M11,LENGTH=9)               
//*
Back to top
View user's profile Send private message
Bharath RajaramSridharan

New User


Joined: 10 Dec 2012
Posts: 20
Location: Australia

PostPosted: Tue Feb 12, 2013 6:10 am    Post subject: Comparing two files and create match records in o/p
Reply with quote

Thanks Skolusu.

I am getting the desired result now. I have modified the OUTFIL and Header/Trailer to add spaces (67X) to the file to match my requirement of output file record length of 80.
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us