First of thanks for all your help in every topic. I'm trying to achieve the below requirement using JCL without writing a program.
As you can see CAUGHT will be in either of 3 fixed positions for a group, between 001 to 002 or 001 to 003. it will b mostly in 002 or 003 and only once or it maynot available for that group.
If CAUGHT is seen in any one of fixed poostions in 002 or 003 in that group, i just want to write the name to the o/p, (i.e) LISA, TINA, RAGG in the below example and neglect MATT and DINO as they dont have CAUGHT.
INPUT CODE -
001AAALISA MATHS MATHS
002BBBLISA MATHS CAUGHT
001AAATINA PHYSI PHYSI
002BBBTINA PHYSI CAUGHT
001AAAMATT CHEM CHEM
002BBBMATT CHEM
003BBBMATT
001AAADINO MATHS MATHS
002BBBDINO MATHS
001AAARAGG BIOLO BIOLO
002BBBRAGG BIOLO CAUGHT
003BBBRAGG
002BBBLISA MATHS CAUGHT
001AAATINA PHYSI PHYSI
002BBBTINA PHYSI CAUGHT
001AAAMATT CHEM CHEM
002BBBMATT CHEM
003BBBMATT
001AAADINO MATHS MATHS
002BBBDINO MATHS
001AAARAGG BIOLO BIOLO
002BBBRAGG BIOLO CAUGHT
003BBBRAGG
expected o/p
LISA
TINA
RAGG