I have a master file and I want to move the records from master to multiple files based on 2 fields (Field A and Field B)values. I' am using OUTFIL & INCLUDE for this. The problem here for me is I have many combinations of Field A and Field B which should go to File-1. Same case for the records which should go to File-2. For ex..
OUTFIL FNAMES=File-1,
INCLUDE=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'702')
OUTFIL FNAMES=File-1,
INCLUDE=(2,6,CH,EQ,C'1',AND,9,11,CH,EQ,C'703')
.......and many more conditions for File-1
OUTFIL FNAMES=File-2,
INCLUDE=(2,6,CH,EQ,C'2',AND,9,11,CH,EQ,C'702')
OUTFIL FNAMES=File-2,
INCLUDE=(2,6,CH,EQ,C'2',AND,9,11,CH,EQ,C'703')
.......and many more conditions for File-2
.......and many more conditions for multiple output files. (File-n)
Only first OUTFIL& INCLUDE condition for every output file is considered and all the duplicated DDnames are ignored by ICETOOL. As a result, I dont have records in File-1 & File-2 which satisfies the highlighted INCLUDE condtions. Is there a solution for my problem? Great if you can help.
Thanks for your reply Expat. I' am not coding OUTFIL INCLUDE in my JCL manually. Rather, I' am dynamically creating OUTFIL INCLUDE sysin by unloading records from a table. I have a table like below:
Field-1 Field-2 FileName
=================
FileName may repeat for different combinations of Field-1 and Field-2.
By unloading the below query to a file gives me a dynamic sysin for OUTFIL INCLUDE which I' am using in my JCL.
SELECT
'OUTFIL FNAMES=',FileName,
', INCLUDE=(2,6,CH,EQ, C''',Field-1,
''',AND,9,11,CH,EQ,C''',Field-2,''')'
FROM table-name;
Is there any option in ICETOOL to consider duplicate DD Names?
A third possible way would be to generate an ICETOOL COPY/USING for each condition so you can use multiple OUTFIL statements to a MOD ddname. However, this is inefficient, and also might give you multiple copies of a record in an output file that you don't want.
Thank you so much Frank. Before I started my work, I didn't realised that we cannot use duplicated DD names in OUTFIL. Then, as you said, instead of rework, I was wondering if availabe, I can specify "Use duplicated DD Names" option. Thanks again and I will get back to you with my result.