I was asked by a co-worker if there is a way to copy a file through Icetool to any of two posible DD DSNAMES based on the value of a field of a third file. The example goes as follows:
We have a File A, which could have one of two possible values, 'YYY' or 'ZZZ', as an example.
We also have, another input file, file B, which has a lot of records. This file has a LRECL of 100.
Now, the problem is, that we need to copy File B to DDNAME Output1 if the valules of file A are YYY. Otherwise, we need to copy the whole File B to DDNAME Ouput2 if the values in file A are ZZZ.
In short:
Code:
IF FILE A = YYY THEN
COPY FILE B TO OUTPUT 1
ELSE
IF FILE B = ZZZ THEN
COPY FILE B TO OUPUT 2
END IF
END-IF
Is there a way to acomplish this through Icetool or another sort Options?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT/ICETOOL job that will do what you asked for assuming FILEA has RECFM=FB. (If FILEA has RECFM=VB, the job would need to be modified slightly.)