Rational Developer for System z
PL/I for Windows, Version 8.0, プログラミング・ガイド

図 9 のプログラムは、図 8 のプログラムで作成したデータを読み取り、データ・セット SYSPRINT を使用してそのデータを表示します。SYSPRINT データ・セットは CON 装置に関連付けられているため、プログラム実行の前に関連付けが解除されない場合、出力は画面上に表示されます。 (SYSPRINT の詳細については、SYSIN ファイルおよび SYSPRINT ファイルの使用方法を参照してください。)

図 9. ストリーム指向データ伝送によるデータ・セットへのアクセス
 /********************************************************************/
 /*                                                                  */
 /*  DESCRIPTION                                                     */
 /*    Read a CONSECUTIVE data set and print the 30-byte records     */
 /*    to the screen.                                                */
 /*                                                                  */
 /*  USAGE                                                           */
 /*    The following command is required to establish                */
 /*    the environment variable to run this program:                 */
 /*                                                                  */
 /*      SET DD:WORK=BDAY.OCT                                        */
 /*                                                                  */
 /*    Note: This sample program uses the CONSECUTIVE data set       */
 /*          created by the previous sample program BDAY.            */
 /*                                                                  */
 /********************************************************************/

 BDAY1: proc options(main);

   dcl Work file stream input;

   dcl Eof bit(1) init('0'b);

   dcl In char(30);

   on endfile(Work) Eof='1'b;

   open file(Work);
   get file(Work) edit(In)(a(30));
   do while (¬Eof);
    put file(sysprint) skip edit(In)(a);
    get file(Work) edit(In)(a(30));
   end;
   close file(Work);
 end BDAY1;

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)