C command code

You can use the C command code to indicate to IMS™ that (instead of supplying a qualification statement) you are supplying the segment's concatenated key as a means of identifying it. You can use either the C command code or a qualification statement, but not both.

You can use the C command code for all Get calls and for the ISRT call. When you code the concatenated key, enclose it in parentheses following the *C, and place it in the same position that would otherwise contain the qualification statement.

For example, suppose you wanted to satisfy this request:
Did Joan Carter visit the clinic on March 3, 2009? Her patient number is 07755.
The PATIENT segment's key field is the patient number, and the ILLNESS segment's key field is the date field, so the concatenated key is 0775520090303. This number is comprised of four digits for the year, followed by two digits for both the month and the day. You issue a GU call with the following SSA to satisfy the request:
GU   ILLNESSb*C(0775520090303)

Using the C command code is sometimes more convenient than a qualification statement because it is easier to use the concatenated key than to move each part of the qualification statement to the SSA area during program execution. Using the segment's concatenated key is the equivalent of giving all the SSA in the path to the segment qualified on their keys.

For example, suppose that you wanted to answer this request:
What treatment did Joan Carter, patient number 07755, receive on March 3, 2009?
Using qualification statements, you would specify the following SSA with a GU call:
GU    PATIENTb(PATNObbbEQ07755)
      ILLNESSb(ILLDATEbEQ20090303)
      TREATMNTb
Using a C command code, you can satisfy the previous request by specifying the following SSA on a GU call:
GU    ILLNESSb*C(0775520090303)
      TREATMNTb
If you need to qualify a segment by using a field other than the key field, use a qualification statement instead of the C command code.

Only one SSA with a concatenated key is allowed for each call. To return segments to your program in the path to the segment specified by the concatenated key, you can use unqualified SSA containing the D command code.

For example, if you want to return the PATIENT segment for Joan Carter to your I/O area, in addition to the ILLNESS segment, use the call:
GU    PATIENTb*Db

      ILLNESSb*C(0775520090303)

You can use the C command code with the object segment for a Get call, but not for an ISRT call. The object segment for an ISRT call must be unqualified.