I have two files of length 500 and same structure . I am comparing the files and updating the first file (F1) , with values from 50th position of F2. I am using be below JCL to update my first file and working fine.
ICE214A F DUPLICATE, CONFLICTING, OR MISSING OUTFIL STATEMENT OPERANDS
IFTHEN=(WHEN=(501,1,CH,EQ,C'1'),
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,500),
can you please let me know how can I correct the error and create the unmatched file in the same step.
Please learn to use the code tags to make things easier to read. They are easy to use
OUTFIL FNAMES=OUT1,INCLUDE=(601,1,CH,EQ,C'B'),
IFTHEN=(WHEN=(501,1,CH,EQ,C'B'),OVERLAY=(50:502,1)),
BUILD=(1,500)
$
DUPLICATE, CONFLICTING, OR MISSING OUTFIL STATEMENT OPERANDS
IFTHEN=(WHEN=(501,1,CH,EQ,C'1'),
$
BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,500)
Infact I have tried other combination for the syntax also. But the results seems to be same. Can we use overlay with build ? If not how can we use instead of this .
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
I think your parentheses are misplaced. You want to overlay & build for the case where "B" and, separately, select the records where case is "1". Then all other records to the SAVE output.
I am comparing the files and updating the first file (F1) , with values from 50th position of F2.
What you have is overlaying byte 50 of the record from file 1 with the first byte from the record in file 2. Is this what you want? or should this be :
I am getting the expected results for overlay , that is file F1 in 50th position is updating perfectly with the 50 th position from file F2. , with my first JCL. Only problem is when I tried to write the unmatched records for F1 , I am getting error.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
I believe that your JCL is working OK. It is your Sort control statements that you are having problems with. JCL and program control statements are not the same thing.
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
I misread the REFORMAT statement v
However, I suggested moving the last close parenthesis of the IFTHEN from after the OVERLAY to after the BUILD, then continue into the next IFTHEN which has the OVERLAY omitted and has the closing parenthesis after a separate BUILD.
In your first IFTHEN= group, subparameters BUILD=, and OVERLAY= are mutually exclusive.
You need to review the logic of your parameters.
P.S.
It might be easier to catch similar problems, including misplaced parenthesis, if you aligned your code properly (with logical indentation), and divided parameters by lines.
This is an extra recommendation besides of standard one: always use code tags in your questions.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
As sergeyken pointed out, your original problem is having BUILD and OVERLAY in the same OUTFIL, you cannot have both, you can have ONLY either one of those.
Quote:
I also want to create a file with unmatched records from first file (F1)
From this it looks like you are trying to create 2 outputs
OUT1 - All the records from F1 with pos-50 replaced for matching records in F2.
OUT2 - ONLY non-matching records from F1.
If that is what you want, then you can keep the OUT1 OUTFIL same as what you showed in your very first post and add another OUTFIL like this (untested).
But your later posts show that you are including only matching records into OUT1, if that is what you want you can add an INCLUDE in OUT1 OUTFIL to extract only 'B' records.
IFOUTLEN would help limit your final record length - if that is what you were trying to do with the extra BUILD. You had it in your original control card but looks like you left that out in your 'modified' control card.