und code x(3)
A/C number 9(9)
Trans date x(10)
MS number 9(8)
dollar 9(4)V99
shares9(2)V99
In file1:
Fund Code A/C number Trans date MS number
----------------- ------------------ ----------------- ----------------
024 901238678 10/10/05 00000000
110 911123344 14/10/05 12330000
801 938765555 01/10/05 00000000
890 931293847 24/10/05 16783333
File2:
Fund Code A/C number Dollar Shares
----------------- ------------------ ----------- -----------
024 901238678 3000.00 12.33
110 911123344 1200.00 23.33
801 938765555 1250.20 33.03
932 903333847 3222.33 55.55
992 990022000 2222.25 02.11
Output file3 should be like this:
Fund code A/C no Trans date dollars shares
024 901238678 10/10/05 3000.00 12.33
110 911123344 14/10/05 1200.00 23.33
801 938765555 01/10/05 1250.20 33.03
Using Icetool, i want to merge file1 and file2 based on common fieldsfund code and account number.
Help me with code.
Here the file is copied to a temp file.So we have to specify in some way, the maximum limit for records(here 80).that is why it is used.
We can do that in other way also.
Code:
OUTREC FIELDS=(1:1,22,23:58X)
(fill spaces from 23-80.)
if we don't specify this then there will be an error in SPLICE operation to OUT file,because the tmp file(T1) will be of unknown LRECL.
The first COPY with CPY1CNTL will set the LRECL of T1 to 22. Since T1 is a MOD data set, the second COPY with CPY2CNTL will use the LRECL of T1 set previously and truncate the records to 22 bytes. The SPLICE will use the 22 byte records from T1 and set the LRECL of OUT to 22.
Also, you don't need WITHEACH or CTL3CNTL. And the Fund and A/C fields are 12 bytes, not 13 bytes according to the description.
So this would be the DFSORT/ICETOOL job I'd use - OUT will have LRECL=34, although you could change that to something else if necessary by using CPY3CNTL with OUTFIL FNAMES=OUT,OUTREC=(1,34,n:X).
In the above steps dont u think the T1 temp file will be
over written by the IN2 file contents and will display nothing in the resultant file except the key part.
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
fixdoubts wrote:
In the above steps dont u think the T1 temp file will be
over written by the IN2 file contents and will display nothing in the resultant file except the key part.