I have an input file (LRECL=80,RECFM-FB) as shown below. I want to overlay type "08" with information from type "02" and "05" records. I have 6 character key starting at 5th position and tried using WHEN=GROUP with BEGIN=(1,2,CH,EQ,C'02') and PUSH but not getting expected results. The information on output type 08 record need to have either "X" or "Y" at 33rd position based on type "05" (error record) along with info overlayed from type "02" record.
Input:-
Code:
----+----1----+----2----+----3
02 ABCDE1 GEMINI 1971 2014 N
05 ABCDE1ERROR RECORD
08 ABCDE19801
08 ABCDE19901
02 XYZAB2 VAHINI 1969 2004 N
05 XYZAB2ERROR RECORD
08 XYZAB29702
08 XYZAB29502
08 XYZAB28902
02 EFGHI3 RAMANI 1985 1994 M
08 EFGHI39403
Output:
Code:
----+----1----+----2----+----3----+----4
02 ABCDE1 GEMINI 1971 2014 N
05 ABCDE1ERROR RECORD
08 ABCDE19801 GEMINI 1971 2014 X
08 ABCDE19901 GEMINI 1971 2014 X
02 XYZAB2 VAHINI 1969 2004 N
05 XYZAB2ERROR RECORD
08 XYZAB29702 VAHINI 1969 2004 X
08 XYZAB29502 VAHINI 1969 2004 X
08 XYZAB28902 VAHINI 1969 2004 X
02 EFGHI3 RAMANI 1985 1994 M
08 EFGHI39403 RAMANI 1985 1994 Y
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
OK, you have given us the input records and the expected output records, ( I have assumed that these are the expected output as you have not stated if these are the expected output or actual output), but not the rules of what goes where and why it goes there.
Please expand on what conditions should perform what actions.
Expat/Bill, these are the rules - What I gave in my first post was expected output. Type 02 and 08 always exist but type 05 does not on all.
Quote:
The information on output type 08 record need to have either "X" or "Y" at 33rd position based on type "05" (error record) along with info overlayed from type "02" record.
02 ABCDE1 GEMINI 1971 2014 N Y GEMINI 1971 2014
05 ABCDE1ERROR RECORD X GEMINI 1971 2014 A
08 ABCDE19801 GEMINI 1971 2014 Y
08 ABCDE19901 GEMINI 1971 2014 Y
02 XYZAB2 VAHINI 1969 2004 N Y VAHINI 1969 2004
05 XYZAB2ERROR RECORD X VAHINI 1969 2004 X
08 XYZAB29702 VAHINI 1969 2004 Y
08 XYZAB29502 VAHINI 1969 2004 Y
08 XYZAB28902 VAHINI 1969 2004 Y
02 EFGHI3 RAMANI 1985 1994 M Y RAMANI 1985 1994
08 EFGHI39403 RAMANI 1985 1994 Y
Expected Output:-
Code:
----+----1----+----2----+----3----+----4
02 ABCDE1 GEMINI 1971 2014 N
05 ABCDE1ERROR RECORD
08 ABCDE19801 GEMINI 1971 2014 X
08 ABCDE19901 GEMINI 1971 2014 X
02 XYZAB2 VAHINI 1969 2004 N
05 XYZAB2ERROR RECORD
08 XYZAB29702 VAHINI 1969 2004 X
08 XYZAB29502 VAHINI 1969 2004 X
08 XYZAB28902 VAHINI 1969 2004 X
02 EFGHI3 RAMANI 1985 1994 M
08 EFGHI39403 RAMANI 1985 1994 Y
Ramsri, That is because we extended inrec to by PUSH but didnt really brought everything to output.
There is way to get away with it if you really want, I leave that upto you to work on. Do post back your finding if you think of work on.
Cluse is to parse only once rather that in inrec and outrec.