View previous topic :: View next topic
|
Author |
Message |
jaganmoni1
New User
Joined: 31 Oct 2008 Posts: 35 Location: CANADA
|
|
|
|
Hi,
I have two input PS files. File-1 contains 5 digit branch numbers of type 9(05).
File-1 is FB and record length is 5
File -2 also contains the 5 digit branch number in packed format i.e. S9(05) comp-3.
File-2 is FB and record length is 30. Branch number is the first filed.
Output file must contain the records of file-2 only if file-2 branch number is available in file-1. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show an example of the records in each input file (relevant fields only) and what you expect for output. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. |
|
Back to top |
|
|
jaganmoni1
New User
Joined: 31 Oct 2008 Posts: 35 Location: CANADA
|
|
|
|
Hi Frank,
Please see below for requested information.
File-1 Layout:
Code: |
01 BRANCH-RECORD.
05 LTB-BRNACH-NO PIC 9(05).
05 FILLER PIC X(75).
|
File-1 always contains only unique records.
Please see below for the data how it looks like in File-1:
Code: |
----+----1----+----2----+----3----+----4----+----5----
***************************** Top of Data ************
00331
50088
80002
**************************** Bottom of Data ********** |
File-2 Layout:
Code: |
01 FINAL-BALANCE-RECORD.
05 FINBAL-TRANSIT PIC S9(5) COMP-3
* BRANCH NUMBER
05 FINBAL-ACCOUNT PIC S9(7) COMP-3
* ACCOUNT NUMBER
05 FINBAL-LOAN PIC X(1).
* LOAN NUMBER (2 BCD DIGITS)
05 FINBAL-OS-BALANCE PIC S9(9)V99 COMP-3
* YESTERDAY'S OS BALANCE (ADJUSTED)
05 FINBAL-PROCESS-TYPE PIC X(1).
* PROCESSING TYPE
05 FINBAL-SUBTYPE PIC X(3).
* SUBTYPE FOR LOAN
05 FINBAL-REGION PIC X(1).
* REGION CODE 'E'=EAST,'W'=WEST
05 FINBAL-SIC-CODE PIC S9(5) COMP-3
* SIC CODE
05 FINBAL-AGGR-TOTAL-BKDTE-BAL PIC S9(13)V99 COMP-3
* AGGREGATED TOTAL OF BACKDATES' BALANCE |
File-2 may contain duplicate branch numbers.
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
-----------------------------------------------------------
********************************* Top of Data **************
-----------------------------------------------------------
.....ä........3190E.á*........
02300420001111FFFFC04500000000
07C003C100111C3190505C0000000C
-----------------------------------------------------------
.....ä........3190E.á*........
02300420001111FFFFC04500000000
07C003C500111C3190505C0000000C
-----------------------------------------------------------
......æ....Ø..3189E.á*........
03100090000800FFFFC04500000000
03C000C100300C3189505C0000000C
-----------------------------------------------------------
......æ.....e.3085E.á*........
03100090000280FFFFC04500000000
03C000C200705C3085505C0000000C
----------------------------------------------------------- |
If file-2 branch number is available in File-1, then only File-2 record must be written on output file. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/5)
//IN2 DD DSN=... input file2 (FB/30)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/30)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,3,PD) WITHALL WITH(1,31) USING(CTL3)
/*
//CTL1CNTL DD *
INREC BUILD=(1,5,ZD,TO=PD,LENGTH=3,31:C'BB')
/*
//CTL2CNTL DD *
INREC OVERLAY=(31:C'VV')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(31,2,CH,EQ,C'VB'),BUILD=(1,30)
/*
|
|
|
Back to top |
|
|
jaganmoni1
New User
Joined: 31 Oct 2008 Posts: 35 Location: CANADA
|
|
|
|
Hi Frank,
I am very sorry to give the late reply as I am out of office from past three days.
This job is working fine without any issues. Thanks a lot for your quick reply. Looks like this ICETOOL is amazing and we can reduce most of the cobol programs which handle the files processing.
By seeing your answers for different queries I am very much interesting to acquire more and more knowledge on ICETOOL.
Once again thanks a lot for your help on same |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I'm glad I could help and happy to hear you like DFSORT's ICETOOL. |
|
Back to top |
|
|
|