IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comparing two files and create match records in o/p


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 11, 2013 1:13 pm
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top