Program to demonstrate merge verb, COBOL Programming

Assignment Help:

PROGRAM TO DEMONSTRATE MERGE VERB:

The two files for which a record having 2 fields viz. Account Number and Name are already available. Now Merge these two files and create a new file based on the ascending order of the Account Number.

 identification division.

  program- id.

  environment division.

  input-output section.

  file-control.

    select o1- file assign to disk

    organization is line sequential.

    select o2- file assign to disk

    organization is line sequential.

    select s1-file assign to disk

    organization is line sequential.

    select s2-file assign to disk

    organization is line sequential.

    select m- file assign to disk

    organization is line sequential.

    select w- file assign to disk.

  data division.

  file section.

  fd o1- file

    label records are standard

    value of file- id is "o1.dat".

01  o1-rec.

  02 o1-acc-no pic 9(2).

  02 o1-name pic x(4).

fd o2- file

  label records are standard

  value of file- id is "o2.dat".

01  o2-rec.

  02 o2-acc-no pic 9(2).

  02 o2-name pic x(4).

fd s1-file

  label records are standard 

value of file- id is "s1.dat".

01  s1-rec.

  02 s1-acc-no pic 9(2).

  02 s1-name pic x(4).

fd s2-file

  label records are standard

  value of file- id is "s2.dat".

01  s2-rec.

  02 s2-acc-no pic 9(2).

  02 s2-name pic x(4).

fd m- file

  label records are standard

  value of file- id is "m.dat".

01  m-rec.

  02 m-acc-no pic 9(2).

  02 m-name pic x(4).

sd w-file.

01  w-rec.

  02 w-acc-no pic 9(2).

  02 w-name pic x(4).

procedure division.

p-1.

sort w-file on ascending key w-acc-no using o1-file giving s1- file.

                sort w-file on ascending key w-acc-no using o2-file giving s2- file.

     merge w-file on ascending key w-acc-no  using s1-file  s2-file giving m- file.

stop run.


Related Discussions:- Program to demonstrate merge verb

Object-computer - configuration section, Object-Computer - Configuration se...

Object-Computer - Configuration section: The computer name specifies a specific computer on which the object program is to be executed. The MEMORY SIZE is used to show the

Programming Assignment, I need help with a COBOL programming assingment. I ...

I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

Size - picture clause, Size: The number of characters or digits needed...

Size: The number of characters or digits needed to store the data item in the memory in termed as the Size of the data item. All the 4 general characteristics explained can

Reserve clause and organization/access clause, RESERVE clause: This cl...

RESERVE clause: This clause indicates the number of buffers to be used for the file. Integer-1 specifies this number. ORGANIZATION/ACCESS clause: These two clause

Divide verb, DIVIDE VERB: The aim of the DIVIDE verb is to divide one ...

DIVIDE VERB: The aim of the DIVIDE verb is to divide one number by the other and to store the result.  There are few forms of this verb. One of its forms is as shown below:

Structure of a cobol program, Structure of a COBOL Program: Every COBO...

Structure of a COBOL Program: Every COBOL program should have the 4 divisions in the order in which they are specified below: 1. Identification division 2. Environment D

Fd entry for variable-length records, FD Entry for variable-length Records:...

FD Entry for variable-length Records: The RECORDS CONTAINS and BLOCK CONTAINS clause are quite dissimilar in the case of files with variable- length records. The syntax of the

Illustration of multiply verb, Illustration of Multiply verb: (a)  MUL...

Illustration of Multiply verb: (a)  MULTIPLY A BY B. In this situation the value of A & B will be multiplied and the product will be stored in B.  The decimal point locatio

Example of accept statement, Example of Accept statement: For illustra...

Example of Accept statement: For illustration, ACCEPT FLAG-A can be specified to read the value of the FLAG_A from the console. It may be keep in mind that no file definition

Second form of divide verb, Second form of Divide verb: The second for...

Second form of Divide verb: The second form of this verb is as shown below: In this situation the identifier-1 or numeric- literal-1 will be divided by identifier-2 or

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd