View previous topic :: View next topic
|
Author |
Message |
Bharath RajaramSridharan
New User
Joined: 10 Dec 2012 Posts: 20 Location: Australia
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Firstly, what you are calling "HEX" is just "packed-decimal". |
|
Back to top |
|
|
Bharath RajaramSridharan
New User
Joined: 10 Dec 2012 Posts: 20 Location: Australia
|
|
|
|
Hi Bill,
The fields which I have mentioned as Hex are Packed Decimal data type. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Bharath RajaramSridharan
New User
Joined: 10 Dec 2012 Posts: 20 Location: Australia
|
|
|
|
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 |
|
|
|