呼び出し元のプログラム
     ...
     03 x1  pic x.
     03 x2  pic x(100).
 procedure division.
      ...
     call subprog using x1
      ...
 
		サブプログラム
 working-storage section.
 01  y1       pic x(1000).
 linkage section.
 01  z1       pic x(1000).
 procedure division using z1.
     move z1 to y1
* This operation works, and transfers the contents of x1. It
* also transfers any data following x1 in the calling program,
* up to 1000 bytes or the end of allocated memory, whichever
* occurs first. If less than 1000 bytes is transferred, the
* remainder of y1 is space filled.
     move y1 to z1.
* This operation is not protected and fails, either by
* corrupting data beyond x1 in the calling program, or
* trying to write beyond allocated memory, which might
* result in a protection violation.
 
	 
説明:
ANSI COBOL 標準の規格では、CALL 文で渡されるパラメーターに関する一般規則として、「呼び出し先のプログラムのデータ項目の内容には、呼び出し元のプログラムの対応するデータ項目の内容に記述されているのと同じ文字位置数を記述しなければならない」としています。この COBOL システムを使用する場合も、PROTECT-LINKAGE 指令を指定せずにプログラムをコンパイルする場合には、この制約を守る必要があります。
PROTECT-LINKAGE 指令を設定すると、STRING 文で使用されている場合を除き、すべての項目についてこの制約が解除されます。呼び出し先のプログラムでは、適合しないパラメーターは文中の送信項目としてのみ使用され、受信項目としては使用されません。
呼び出し先のプログラムと呼び出し元のプログラム間で、対応がとれないパラメーター中の文字位置が一致しない文字です。この一致しない文字の内容は、呼び出し先のプログラムで送信項目として使用されるパラメーターに定義されません。
連絡節の項目に同時にメモリを割り当てる場合は、PROTECT-LINKAGE は設定せずに、CBL_ALLOC_MEM を使用してください。