identification division.

       program-id.    lab6bproj.

    

       environment division.

       input-output section.

       file-control.

           select movie-data1 assign to

               "/usr/class/cis314/wi04/moviein1.dat"

               organization is line sequential.

           select movie-data2 assign to   

               "/usr/class/cis314/wi04/moviein2.dat"

               organization is line sequential.

           select movie-data3 assign to

               "/usr/class/cis314/wi04/moviein3.dat"

               organization is line sequential.

           select movie-data4 assign to  

               "/usr/class/cis314/wi04/moviein4.dat"

               organization is line sequential.

              

           select sortwork assign to "sortwork.dat".

          

           select sorted1 assign to "sorted1.dat"

               organization is line sequential.

              

        

       data division.

      *

       file section.

       fd  movie-data1.

       01  movie-record1             pic x(47).

       fd  movie-data2.

       01  movie-record2             pic x(47).

       fd  movie-data3.

       01  movie-record3             pic x(47).

       fd  movie-data4.

       01  movie-record4             pic x(47).

 

       sd sortwork.

       01  sortrecwork.

           05                        pic x(30).

           05  movie-rating          pic x(5).

           05                        pic x(12).

 

       fd sorted1.

       01 sortedrec1                 pic x(47).

     

       procedure division.

       100-main.

           sort sortwork

              on ascending key movie-rating

              using movie-data1 movie-data2 movie-data3 movie-data4

              giving sorted1.

 

           stop run.