Not sure what you mean, except MAYBE that you have a search field on the child that lets you find the ones you need. Then once you find one, you also need information from that child's parent segment. If that's the case, then you can do it VERY easily using what's known as a 'path' call.
A path call is when you read all of the segment in the hierarchical path in one read. You can use a combination of qualified and unqualified SSA to do the read.
So let's say you need to find all ILLNESS segments where the symptom was 'COUGH'. The root is PATIENT, and the ILLNESS segment is a child of patient. Your call can look like this:
CALL 'CBLTDLI' USING GN
db-pcb
WS-PATIENT-ILLNESS
PATIENT
ILLNESS(SYMPTOM EQ COUGH)
What will happen is that IMS will return both the parent and the child into the WS-PATIENT-ILLNESS working storage area. So you have to set up those segments as contiguous:
01 WS-PATIENT-ILLNESS.
05 PATIENT.
05 ILLNESS.
So when you do the call, you cam just check the ILLNESS segment for what you want, then if it's a match, simply read the fields from the parent segment, because it's ALREADY THERE!!!
And don't let some schmuck try and cry that it's going to cause a lot more IO, because it doesn't. The real IO is from reading the child segments, which you'd have to do anyway.
The important thing is to make good use of the search fields so that you don't actually return any segments that aren't close to what you're looking for.
The only weirdness with this is to expect some unusual PCB status codes. Since you'll be hopping over hierarchical boundaries, you get normal return codes GA and GK. These are valid for this kind of strategy, so code for them. You'll get GE/GB at the end of DB.