Welcome to the world of Mainframe. 欢迎来到大型机的中文世界!

Notes in my PLI studying (ENDFILE)

This is some notes about a condition parameter ENDFILE.

As we know , ENDFILE is used for checking whether the read operation is reach the end of the input file, 

for examp:

DCL EOF    BIT      INIT(’1′B);

ON ENDFILE (IPUTF) EOF = ’0′B;

DO WHILE(EOF); 

       some statements;

END;

1. Suppose there are two input files with more than one record for input, you should define two EOF to control the ENDFILE condition, otherwise system will abend your job;

2. In the example, if you initialize the EOF with INIT(’0′B), you should specify the value of EOF in the WHILE statement like DO WHILE(EOF = ’1′B) instead of DO WHILE(EOF), otherwise the do while loop will not execute.

 I hope these notes will be useful for you guys, happy new year~~~^o^

相关文章

  • Top Links

  • 功能

  • 文章归档