WeixiangYan/CodeTransOcean huggingface dataset:
Task: Input loop



C#: using System;
using System.IO;

class Program
{
    static void Main(string[] args)
    {
        
        

        using (var b = new StreamReader("file.txt"))
        {
            string line;
            while ((line = b.ReadLine()) != null)
                Console.WriteLine(line);
        }
    }
}









Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop

C: #include <stdlib.h>
#include <stdio.h>

char *get_line(FILE* fp)
{
	int len = 0, got = 0, c;
	char *buf = 0;

	while ((c = fgetc(fp)) != EOF) {
		if (got + 1 >= len) {
			len *= 2;
			if (len < 4) len = 4;
			buf = realloc(buf, len);
		}
		buf[got++] = c;
		if (c == '\n') break;
	}
	if (c == EOF && !got) return 0;

	buf[got++] = '\0';
	return buf;
}

int main()
{
	char *s;
	while ((s = get_line(stdin))) {
		printf("%s",s);
		free(s);
	}
	return 0;
}











Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop


C++: #include <istream>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <iterator>


template<class OutIt>
void read_words(std::istream& is, OutIt dest)
{
  std::string word;
  while (is >> word)
  {
    
    *dest = word;
  }
}


template<class OutIt>
void read_lines(std::istream& is, OutIt dest)
{
  std::string line;
  while (std::getline(is, line))
  {
    
    *dest = line;
  }
}

int main()
{
  
  read_words(std::cin, 
             std::ostream_iterator<std::string>(std::cout, " "));

  
  std::vector<std::string> v;
  read_lines(std::cin, std::back_inserter(v));
  
  return 0;
}










Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop




Go: package main

import (
	"bufio"
	"io"
	"log"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	for {
		s, err := in.ReadString('\n')
		if err != nil {
			
			
			if err != io.EOF {
				log.Fatal(err)
			}
			break
		}
		
		
		_ = s
	}
}








Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop





Java: import java.io.InputStream;
import java.util.Scanner;

public class InputLoop {
    public static void main(String args[]) {
        
        InputStream source = System.in;

        

        Scanner in = new Scanner(source);
        while(in.hasNext()){
            String input = in.next(); 

            
            System.out.println(input);
        }
    }
}







Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop







Python: while(True):
      x = input("What is your age? ")
      print(x)





Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop








VB: Public Sub test()
    Dim filesystem As Object, stream As Object, line As String
    Set filesystem = CreateObject("Scripting.FileSystemObject")
    Set stream = filesystem.OpenTextFile("D:\test.txt")
    Do While stream.AtEndOfStream <> True
        line = stream.ReadLine
        Debug.Print line
    Loop
    stream.Close
End Sub




Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop

C: #include <stdlib.h>
#include <stdio.h>

char *get_line(FILE* fp)
{
	int len = 0, got = 0, c;
	char *buf = 0;

	while ((c = fgetc(fp)) != EOF) {
		if (got + 1 >= len) {
			len *= 2;
			if (len < 4) len = 4;
			buf = realloc(buf, len);
		}
		buf[got++] = c;
		if (c == '\n') break;
	}
	if (c == EOF && !got) return 0;

	buf[got++] = '\0';
	return buf;
}

int main()
{
	char *s;
	while ((s = get_line(stdin))) {
		printf("%s",s);
		free(s);
	}
	return 0;
}
Task: Input loop



C#: using System;
using System.IO;

class Program
{
    static void Main(string[] args)
    {
        
        

        using (var b = new StreamReader("file.txt"))
        {
            string line;
            while ((line = b.ReadLine()) != null)
                Console.WriteLine(line);
        }
    }
}
Task: Input loop


C++: #include <istream>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <iterator>


template<class OutIt>
void read_words(std::istream& is, OutIt dest)
{
  std::string word;
  while (is >> word)
  {
    
    *dest = word;
  }
}


template<class OutIt>
void read_lines(std::istream& is, OutIt dest)
{
  std::string line;
  while (std::getline(is, line))
  {
    
    *dest = line;
  }
}

int main()
{
  
  read_words(std::cin, 
             std::ostream_iterator<std::string>(std::cout, " "));

  
  std::vector<std::string> v;
  read_lines(std::cin, std::back_inserter(v));
  
  return 0;
}
Task: Input loop





Java: import java.io.InputStream;
import java.util.Scanner;

public class InputLoop {
    public static void main(String args[]) {
        
        InputStream source = System.in;

        

        Scanner in = new Scanner(source);
        while(in.hasNext()){
            String input = in.next(); 

            
            System.out.println(input);
        }
    }
}
Task: Input loop







Python: while(True):
      x = input("What is your age? ")
      print(x)
Task: Input loop








VB: Public Sub test()
    Dim filesystem As Object, stream As Object, line As String
    Set filesystem = CreateObject("Scripting.FileSystemObject")
    Set stream = filesystem.OpenTextFile("D:\test.txt")
    Do While stream.AtEndOfStream <> True
        line = stream.ReadLine
        Debug.Print line
    Loop
    stream.Close
End Sub
Task: Input loop




Go: package main

import (
	"bufio"
	"io"
	"log"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	for {
		s, err := in.ReadString('\n')
		if err != nil {
			
			
			if err != io.EOF {
				log.Fatal(err)
			}
			break
		}
		
		
		_ = s
	}
}
Task: Input loop



C#: using System;
using System.IO;

class Program
{
    static void Main(string[] args)
    {
        
        

        using (var b = new StreamReader("file.txt"))
        {
            string line;
            while ((line = b.ReadLine()) != null)
                Console.WriteLine(line);
        }
    }
}








Fortran: program BasicInputLoop

  implicit none

  integer, parameter        :: in = 50, &
                               linelen = 1000
  integer                   :: ecode
  character(len=linelen)    :: l

  open(in, file="afile.txt", action="read", status="old", iostat=ecode)
  if ( ecode == 0 ) then
     do
        read(in, fmt="(A)", iostat=ecode) l
        if ( ecode /= 0 ) exit
        write(*,*) trim(l)
     end do
     close(in)
  end if

end program BasicInputLoop
Task: Input loop


C++: #include <istream>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <iterator>


template<class OutIt>
void read_words(std::istream& is, OutIt dest)
{
  std::string word;
  while (is >> word)
  {
    
    *dest = word;
  }
}


template<class OutIt>
void read_lines(std::istream& is, OutIt dest)
{
  std::string line;
  while (std::getline(is, line))
  {
    
    *dest = line;
  }
}

int main()
{
  
  read_words(std::cin, 
             std::ostream_iterator<std::string>(std::cout, " "));

  
  std::vector<std::string> v;
  read_lines(std::cin, std::back_inserter(v));
  
  return 0;
}









Fortran: program BasicInputLoop

  implicit none

  integer, parameter        :: in = 50, &
                               linelen = 1000
  integer                   :: ecode
  character(len=linelen)    :: l

  open(in, file="afile.txt", action="read", status="old", iostat=ecode)
  if ( ecode == 0 ) then
     do
        read(in, fmt="(A)", iostat=ecode) l
        if ( ecode /= 0 ) exit
        write(*,*) trim(l)
     end do
     close(in)
  end if

end program BasicInputLoop
Task: Input loop

C: #include <stdlib.h>
#include <stdio.h>

char *get_line(FILE* fp)
{
	int len = 0, got = 0, c;
	char *buf = 0;

	while ((c = fgetc(fp)) != EOF) {
		if (got + 1 >= len) {
			len *= 2;
			if (len < 4) len = 4;
			buf = realloc(buf, len);
		}
		buf[got++] = c;
		if (c == '\n') break;
	}
	if (c == EOF && !got) return 0;

	buf[got++] = '\0';
	return buf;
}

int main()
{
	char *s;
	while ((s = get_line(stdin))) {
		printf("%s",s);
		free(s);
	}
	return 0;
}










Fortran: program BasicInputLoop

  implicit none

  integer, parameter        :: in = 50, &
                               linelen = 1000
  integer                   :: ecode
  character(len=linelen)    :: l

  open(in, file="afile.txt", action="read", status="old", iostat=ecode)
  if ( ecode == 0 ) then
     do
        read(in, fmt="(A)", iostat=ecode) l
        if ( ecode /= 0 ) exit
        write(*,*) trim(l)
     end do
     close(in)
  end if

end program BasicInputLoop
Task: Input loop





Java: import java.io.InputStream;
import java.util.Scanner;

public class InputLoop {
    public static void main(String args[]) {
        
        InputStream source = System.in;

        

        Scanner in = new Scanner(source);
        while(in.hasNext()){
            String input = in.next(); 

            
            System.out.println(input);
        }
    }
}






Fortran: program BasicInputLoop

  implicit none

  integer, parameter        :: in = 50, &
                               linelen = 1000
  integer                   :: ecode
  character(len=linelen)    :: l

  open(in, file="afile.txt", action="read", status="old", iostat=ecode)
  if ( ecode == 0 ) then
     do
        read(in, fmt="(A)", iostat=ecode) l
        if ( ecode /= 0 ) exit
        write(*,*) trim(l)
     end do
     close(in)
  end if

end program BasicInputLoop
Task: Input loop







Python: while(True):
      x = input("What is your age? ")
      print(x)




Fortran: program BasicInputLoop

  implicit none

  integer, parameter        :: in = 50, &
                               linelen = 1000
  integer                   :: ecode
  character(len=linelen)    :: l

  open(in, file="afile.txt", action="read", status="old", iostat=ecode)
  if ( ecode == 0 ) then
     do
        read(in, fmt="(A)", iostat=ecode) l
        if ( ecode /= 0 ) exit
        write(*,*) trim(l)
     end do
     close(in)
  end if

end program BasicInputLoop
Task: Input loop








VB: Public Sub test()
    Dim filesystem As Object, stream As Object, line As String
    Set filesystem = CreateObject("Scripting.FileSystemObject")
    Set stream = filesystem.OpenTextFile("D:\test.txt")
    Do While stream.AtEndOfStream <> True
        line = stream.ReadLine
        Debug.Print line
    Loop
    stream.Close
End Sub



Fortran: program BasicInputLoop

  implicit none

  integer, parameter        :: in = 50, &
                               linelen = 1000
  integer                   :: ecode
  character(len=linelen)    :: l

  open(in, file="afile.txt", action="read", status="old", iostat=ecode)
  if ( ecode == 0 ) then
     do
        read(in, fmt="(A)", iostat=ecode) l
        if ( ecode /= 0 ) exit
        write(*,*) trim(l)
     end do
     close(in)
  end if

end program BasicInputLoop
Task: Input loop






PHP: $fh = fopen($filename, 'r');
if ($fh) {
    while (!feof($fh)) {
        $line = rtrim(fgets($fh)); # removes trailing newline
        # process $line
    }
    fclose($fh);
}





Fortran: program BasicInputLoop

  implicit none

  integer, parameter        :: in = 50, &
                               linelen = 1000
  integer                   :: ecode
  character(len=linelen)    :: l

  open(in, file="afile.txt", action="read", status="old", iostat=ecode)
  if ( ecode == 0 ) then
     do
        read(in, fmt="(A)", iostat=ecode) l
        if ( ecode /= 0 ) exit
        write(*,*) trim(l)
     end do
     close(in)
  end if

end program BasicInputLoop
Task: Input loop

C: #include <stdlib.h>
#include <stdio.h>

char *get_line(FILE* fp)
{
	int len = 0, got = 0, c;
	char *buf = 0;

	while ((c = fgetc(fp)) != EOF) {
		if (got + 1 >= len) {
			len *= 2;
			if (len < 4) len = 4;
			buf = realloc(buf, len);
		}
		buf[got++] = c;
		if (c == '\n') break;
	}
	if (c == EOF && !got) return 0;

	buf[got++] = '\0';
	return buf;
}

int main()
{
	char *s;
	while ((s = get_line(stdin))) {
		printf("%s",s);
		free(s);
	}
	return 0;
}









COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.
Task: Input loop



C#: using System;
using System.IO;

class Program
{
    static void Main(string[] args)
    {
        
        

        using (var b = new StreamReader("file.txt"))
        {
            string line;
            while ((line = b.ReadLine()) != null)
                Console.WriteLine(line);
        }
    }
}







COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.
Task: Input loop


C++: #include <istream>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <iterator>


template<class OutIt>
void read_words(std::istream& is, OutIt dest)
{
  std::string word;
  while (is >> word)
  {
    
    *dest = word;
  }
}


template<class OutIt>
void read_lines(std::istream& is, OutIt dest)
{
  std::string line;
  while (std::getline(is, line))
  {
    
    *dest = line;
  }
}

int main()
{
  
  read_words(std::cin, 
             std::ostream_iterator<std::string>(std::cout, " "));

  
  std::vector<std::string> v;
  read_lines(std::cin, std::back_inserter(v));
  
  return 0;
}








COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.
Task: Input loop





Java: import java.io.InputStream;
import java.util.Scanner;

public class InputLoop {
    public static void main(String args[]) {
        
        InputStream source = System.in;

        

        Scanner in = new Scanner(source);
        while(in.hasNext()){
            String input = in.next(); 

            
            System.out.println(input);
        }
    }
}





COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.
Task: Input loop







Python: while(True):
      x = input("What is your age? ")
      print(x)



COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.
Task: Input loop








VB: Public Sub test()
    Dim filesystem As Object, stream As Object, line As String
    Set filesystem = CreateObject("Scripting.FileSystemObject")
    Set stream = filesystem.OpenTextFile("D:\test.txt")
    Do While stream.AtEndOfStream <> True
        line = stream.ReadLine
        Debug.Print line
    Loop
    stream.Close
End Sub


COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.
Task: Input loop




Go: package main

import (
	"bufio"
	"io"
	"log"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	for {
		s, err := in.ReadString('\n')
		if err != nil {
			
			
			if err != io.EOF {
				log.Fatal(err)
			}
			break
		}
		
		
		_ = s
	}
}






COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.
Task: Input loop






PHP: $fh = fopen($filename, 'r');
if ($fh) {
    while (!feof($fh)) {
        $line = rtrim(fgets($fh)); # removes trailing newline
        # process $line
    }
    fclose($fh);
}
Task: Input loop






PHP: $fh = fopen($filename, 'r');
if ($fh) {
    while (!feof($fh)) {
        $line = rtrim(fgets($fh)); # removes trailing newline
        # process $line
    }
    fclose($fh);
}






Ada: with Ada.Text_Io; use Ada.Text_Io;

procedure Read_Stream is
   Line : String(1..10);
   Length : Natural;
begin
   while not End_Of_File loop
      Get_Line(Line, Length); 
      Put(Line(1..Length));
      
      
      
      
      if Col(Current_Input) = 1 then
         New_Line;
      end if;
   end loop;
end Read_Stream;
Task: Input loop






PHP: $fh = fopen($filename, 'r');
if ($fh) {
    while (!feof($fh)) {
        $line = rtrim(fgets($fh)); # removes trailing newline
        # process $line
    }
    fclose($fh);
}




COBOL:        IDENTIFICATION DIVISION.
       PROGRAM-ID. input-loop.
       
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT in-stream ASSIGN TO KEYBOARD 
               ORGANIZATION LINE SEQUENTIAL
               FILE STATUS in-stream-status.
               
       DATA DIVISION.
       FILE SECTION.
       FD  in-stream.
       01  stream-line                 PIC X(80).
       
       WORKING-STORAGE SECTION.
       01  in-stream-status            PIC 99.
           88  end-of-stream           VALUE 10.
       
       PROCEDURE DIVISION.
           OPEN INPUT in-stream
           
           PERFORM UNTIL EXIT
               READ in-stream
                   AT END
                       EXIT PERFORM
               END-READ
               DISPLAY stream-line
           END-PERFORM
           
           CLOSE in-stream
           .
       END PROGRAM input-loop.