°æ°í
  ¹Ú¿ì¹üÀÇ Çã¶ô ¾øÀÌ´Â »ó¾÷Àû »ç¿ëÀ» ±ÝÇÕ´Ï´Ù.


 
2.4.6.4  PERFORM/VARYING option
 
 
  [Çü½Ä] 
                                       
  PERFORM ÇÁ·Î½ÃÁ®¸í-1 [ THRU ÇÁ·Î½ÃÁ®¸í-2 ]            
  VARYING µ¥ÀÌÅ͸í-1 FROM { µ¥ÀÌÅ͸í-2 }
BY
{ µ¥ÀÌÅ͸í-3 } UNTIL Á¶°Ç½Ä-1    
  ¸®ÅͶö-1 ¸®ÅͶö-2  
  { AFTER µ¥ÀÌÅ͸í-4 FROM { µ¥ÀÌÅ͸í-5 }
BY
{ µ¥ÀÌÅ͸í-6 } UNTIL Á¶°Ç½Ä-2 }  
  ¸®ÅͶö-3 ¸®ÅͶö-4  
  { AFTER µ¥ÀÌÅ͸í-7 FROM { µ¥ÀÌÅ͸í-8 }
BY
{ µ¥ÀÌÅ͸í-9 } UNTIL Á¶°Ç½Ä-3 }  
  ¸®ÅͶö-5 ¸®ÅͶö-6  
                                       
 
¨ç
 VARYING  µÚÀÇ µ¥ÀÌÅ͸íÀ» ±âÁØÀ¸·Î
FROM  µÚÀÇ °ªÀ» ÃʱâÄ¡·Î Çϸç,
BY  µÚÀÇ °ªÀ» Áõ°¡Ä¡·Î ÇÏ¿©,
UNTIL µÚÀÇ Á¶°Ç½ÄÀ» ¸¸Á·ÇÒ ¶§±îÁö ÇÁ·Î½ÃÁ®¸íÀ» ¹Ýº¹ ¼öÇàÇÕ´Ï´Ù.
¨è  VARYING ±¸·Î´Â 1Â÷¿ø ¹è¿­ÀÇ ¼öÇàÀÌ °¡´ÉÇϸç,
ù ¹ø° AFTER±¸±îÁö »ç¿ëÇϸé 2Â÷¿ø ¹è¿­ÀÇ ¼öÇàÀÌ °¡´ÉÇϸç,
µÎ ¹ø° AFTER±¸±îÁö »ç¿ëÇϸé 3Â÷¿ø ¹è¿­ÀÇ ¼öÇàÀÌ °¡´ÉÇÕ´Ï´Ù.
 
 
 
  [¿¹¹® 1] 
PERFORM  A-RTN  VARYING  I  FROM  1  BY  1  UNTIL  I > 10.
 
  <Çؼ³> 
¢¿
 µ¥ÀÌÅ͸í I°¡ ÃʱâÄ¡ 1, Áõ°¡Ä¡ 1, I > 10 ±îÁö A-RTNÀ» 10ȸ ¹Ýº¹ ¼öÇàÇÕ´Ï´Ù.
 I = 11 À̸é PERFORM ´ÙÀ½ ¹®ÀåÀ¸·Î ¼öÇàÀÌ ¿Å°ÜÁý´Ï´Ù.
 
 
 
  [¿¹¹® 2] 
PERFORM A-RTN VARYING I FROM 1 BY 1 UNTIL I > 3
AFTER J FROM 1 BY 1 UNTIL J > 4
AFTER K FROM 1 BY 1 UNTIL K > 5.
:
A-RTN.
MOVE 0 TO A(I, J, K).
 
 
 
  [¿¹¹® 3] 
PERFORM B-RTN VARYING I FROM 1 BY 1 UNTIL I > 3.
:
B-RTN.
PERFORM C-RTN VARYING J FROM 1 BY 1 UNTIL J > 4.
:
C-RTN.
PERFORM A-RTN VARYING K FROM 1 BY 1 UNTIL K > 5.
:
A-RTN.
MOVE 0 TO A(I, J, K).
 
  <Çؼ³> 
¨ç
 [¿¹¹®2], [¿¹¹® 3]Àº (3¸é 4Çà 5¿­ÀÇ 3Â÷¿ø ¹è¿­)¿¡ ÃʱâÄ¡ 0À» ºÎ¿©ÇÏ´Â µ¿ÀÏÇÑ ÀǹÌÀÇ ¹®ÀåÀÔ´Ï´Ù.
 Áï, A-RTNÀ» 60ȸ(3*4*5) ¹Ýº¹ ¼öÇàÇÕ´Ï´Ù.
 
¢¿
 º¯¼ö°ª (I, J, K)À» ¹è¿­¿¡¼­ ƯÈ÷ ÷ÀÚ¶ó°í ÇÕ´Ï´Ù.
 [ WORKING-STORAGE SECTION ]¿¡¼­ ±â¾ï Àå¼Ò¸¦ ¸¸µé¾î ÁÝ´Ï´Ù.
 
 
ÁöÀû ¼ÒÀ¯±ÇÀ» º¸È£ÇսôÙ.
 
¢Ð ¢½ ¢Ñ