Example of how to use multiple qualification statements

The following example shows how you can use multiple qualification statements.

Given the sample Medical database, we want to answer the following question:

Did we see patient number 04120 during 1992?

To find the answer to this question, you need to give IMS more than the patient’s name; you want IMS to search through the ILLNESS segments for that patient, read each one, and return any that have a date in 1992. The call you would issue to do this is:
GU   PATIENTb(PATNObbbEQ04120)
     ILLNESSb(ILLDATEb>=19920101&ILLDATEb<=19921231)
In other words, you want IMS to return any ILLNESS segment occurrences under patient number 04120 that have a date on or after January 1, 1992, and on or before December 31, 1992, joined with an AND connector. Suppose you wanted to answer the following request:
Did we see Judy Jennison during January of 1992 or during July of 1992? Her patient number is 05682.
You could issue a GU call with the following SSAs:
GU   PATIENTb(PATNObEQ05682)
     ILLNESSb(ILLDATEb>=19920101&ILLDATEb<=19920131|ILLDATEb>=19920701&ILLDATEb<=19920731)

To satisfy this request, the value for ILLDATE must satisfy either of the two sets. IMS returns any ILLNESS segment occurrences for the month of January 1992, or for the month of July 1992.