IMS status code

IMS status AK: Invalid field name in SSA

IMS status code AK means the field name in an SSA qualification isn't valid for the segment the SSA names. IMS can't find that field for that segment in the DBD, as the PCB sees it.

Other names for this code

Also written as status code AK, IMS AK, DL/I status AK, AK status code, invalid field name SSA.

What it means

A qualified SSA compares a field in a segment with a value, for example ORDER (ORDNUM EQ00012345). The field name must be 8 bytes, padded with blanks, and it must be defined for that segment type in the DBD. If IMS can't match the name to a field in that segment, it rejects the call with AK.

AK can come back on any call that has a qualified SSA. That means GU, GN and GNP and their hold forms, and ISRT calls that qualify the parent levels. It is a programming or setup error. The segment name in the SSA was accepted, otherwise the call would have got AC, but the field inside the qualification wasn't.

Common causes

  • The field name is misspelled, or isn't padded with blanks to 8 bytes.
  • The field belongs to a different segment. A key field from the parent was used in the SSA for the child, for example.
  • The program uses the wrong PCB. If the PCB order in the entry statement doesn't match the PSB, the call reaches a PCB for another database whose DBD doesn't have that field. Adding a PCB to the PSB without changing the program is a common way to cause this.
  • The program accesses a logical child through its logical parent and qualifies on a field that isn't available in that view of the segment.
  • The DBD changed, and the field was renamed or removed, but the program still uses the old name.

How to find the problem

  1. Display the SSA in hex just before the call and note the segment name and the 8-byte field name.
  2. Look up that segment in the DBD source and check that a FIELD statement with that exact name sits under it.
  3. Check which PCB the call used, and compare the PCB order in the program's entry statement with the PSB.
  4. If the PSB was changed recently, for example to add an index PCB, check whether the program was changed to match.

How to fix it

  • Correct the field name and pad it to 8 bytes.
  • Use a field that belongs to the segment named in the SSA. Qualify the parent with its own SSA.
  • Make the program's PCB list match the PSB, then recompile or relink as needed.
  • After a DBD change, run DBDGEN, PSBGEN and ACBGEN as your shop requires, and update programs that use the old field names.

IBM documentation

IBM documentation: status AK. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

The field is in the DBD. Why do I still get AK?

Check which segment it's defined under and which PCB the call used. A field from another segment, or a PCB for a different database, gives AK.

Can adding a PCB to a PSB cause AK?

Yes. If the program's entry statement doesn't list the new PCB in the same position as the PSB, later calls go to the wrong PCB and their field names no longer match.

What is the difference between AK and AC?

AC means the segment name or the order of the SSAs is wrong. AK means the segment is fine but the field name in the qualification isn't.