raveendra_ibm Currently Banned New User
Joined: 07 Jan 2006 Posts: 31
|
|
|
|
Hi All,
Can you please help me out in meeting this requirement.
I have 3 files.
FILE A
Code: |
QWERTY 345 YTREWQ
ASDFGH 654 HGFDSA |
FILE B
Code: |
123456789 678 8766565
123423634 567 8896785 |
FILE C
Code: |
$$&%&*^*() 089 ^&*^*%*%
*&*(&(*&)) 889 #^%#%^%$ |
Now my requirement is to get a file that has records as follows:
Code: |
345 678 089
645 567 889 |
All the i/p files are VBA and max record length 240.
There are no keys. Just got to copy one field from each file to form a single record.
Please help !!!
Regards,
Raveendra. |
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
Hi,
This can be achived with the help of the sequence number.Create the sequence number for the each record in the first file and the second file.then select the required data(345,654) from file one and required data (678,567) from the file 2 based on the key value(ie..sequence number).
you will then get a file with the data like below.
345 678
654 567
then use this file as the filrst file and your 3 rd file as the second file and follow the same procedure to create the final file.
Thank you
Krishy |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The DFSORT/ICETOOL job below will do what you asked for.
Since the input files have RECFM=VBA, the data you show actually starts at position 6 (after 4-byte RDW and 1-byte cc), so I've adjusted the starting positions accordingly. I assumed you didn't want the cc in the output file, so it would have RECFM=VB and LRECL=21. You can change the job appropriately if those assumptions aren't correct.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (VBA/240)
//IN2 DD DSN=... input file2 (VBA/240)
//IN3 DD DSN=... input file3 (VBA/240)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD RECFM=VB,DSN=.. output file (VB/21)
// RECFM=VB
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
SPLICE FROM(T1) TO(OUT) ON(5,8,ZD) -
WITHEACH WITH(20,3) WITH(27,3) USING(CTL4)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,4,5:SEQNUM,8,ZD,13:13,3,29:X)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1,4,5:SEQNUM,8,ZD,20:16,3,29:X)
/*
//CTL3CNTL DD *
OUTREC FIELDS=(1,4,5:SEQNUM,8,ZD,27:17,3)
/*
//CTL4CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,4,13)
/*
|
|
|