Cobol Tutorial

 
 
 

Basic Programming

Relative file - insertion,deletion,updation, print Divides one or more operands by another IF-ELSE Clause Group wise stock summary Attendence Report of Employees SORTING Operation Add 2 or more operands and stores result Describe Functionality of table by using File Fahrenheit into temperature - C = (5/9) * (f - 32) Use of Control Break clause Print employee detail Draws an ellipse or a circle Binary search using files Generating date and time Generate arithmetic operation - evaluate clause

General Programs

Evaluate gender from user and print Display input number is prime or not Display on printer message entered by user Displays message entered by user on printer Merging two files in a single file Read data from input file and move to output file Print account report Use of Sign clause Create attendence sheet Displays on printer - divide operation quotient Binary search on student name, print roll number job appl checking candidate is eligible or not Display the pattern of square School management system

Mathematical Program

Print bill report Purchase and rebate amount payslip Example of string and unstring Describe Functionality of two dimension table Insert, delete, update, view in index file Student details using relative file Converting integer to its number of words Use of move clause for numeric values Use multiple array Inventory transactions Sort records of file Displays alphanumeric char on screen graphic mode Multiplication table Generate sales register

Sorting Programs

Store content in file,record of field - other file Calculate Total percentage Classfor each student Edit character Display pattern of numbers in reverse pattern User input data and stores it in to the file Input record into file using extend mode Draw a line Use of Tables with INPUT clause Check student is pass or fail i/p result from user Calculate monthly sales amount -sequential access Sescribes how to use Sort technique Declares data to the compiler Generating julian date

Clause

Describe Functionality of Relative File Print addition of two nos and sum is third or not Use of perform verbs Bank Report depending upon user choice Create result statement for given semester Search name from file display roll no of student Evaluates arithmetic expression - stores result Use of evaluate clause Describe use of IF CONDITION and PRINT Calculate Total percentage Class for each student Displays alphanumeric character in graphics mode Reads in states until end of data Read student details from file - read operation Merge 2 files with students records Print presence report based on provided data Use of Inspect clause Check entered date is valid birth date or not Draws rectangle filled with one color Search perticular record Find age from accepted date from user Check if a number is a fibonacci or not

File Programs

Check two same condition name is allow or not Arithmetic operations add,sub,div and mul Display on Console a message entered by user Display message entered by user on console Generate student mark sheet using file r/w op Student detail management using indexed file Print mark sheet of a student with grades Use of Redefine clause Create marksheet of student Use of leading and trailing Sequential search Class condition Sum of series 1 + 1/4 + 1/9 Using sign test for numeric value

Search Programs

Enter value is alphabetic,numeric,alphanumeric Find yearly depreciation Unstring word Find smallest quotation for given item Write records reside in i/p file- show on screen Create the index file Draw polygon Use of EVALUATE clause Count number of char Date manipulation Bubble sort DOS standard o/p device Add two numbers Generate sales report item wise

String Programs

Includes external source file in current file Gross salary, deduction, net salary of employee Count character for no of times in input string Display triangle of numbers FILE Read Operation
 
 
       Identification Division.
       Program-Id. JEE-Exam.

       Environment Division.
       Input-Output Section.
       File-Control.
           Select Bio-File Assign To Disk
           Organization Is Line Sequential.
           Select Marks-File Assign To Disk
           Organization Is Line Sequential.
           Select Out-File Assign To Disk
           Organization Is Line Sequential.

       Data Division.
       File Section.
       FD Bio-File
           Label Records Are Standard
           Value Of File-Id Is File-Bio.
       01 Bio-Rec.
          02 RegNo   Pic 9(7).
          02 State-C Pic 99.
          02 Name    Pic a(15).
          02 Address Pic x(20).

       FD Marks-File
           Label Records Are Standard
           Value Of File-Id Is File-Marks.
       01 Marks-Rec.
          02 RegNo   Pic 9(7).
          02 Maths   Pic 999.
          02 Phy     Pic 999.
          02 Chem    Pic 999.
          02 Eng     Pic 999.

       FD Out-File
           Label Records Are Standard
           Value Of File-Id Is File-Out.
       01 Out-Rec.
          02 RegNo   Pic z(7).
          02 Filler  Pic xxx.
          02 State-C Pic z9.
          02 Filler  Pic xxx.
          02 Name    Pic a(15).
          02 Address Pic x(20).
          02 Maths   Pic zzz.
          02 Filler  Pic xxx.
          02 Phy     Pic zzz.
          02 Filler  Pic xxx.
          02 Chem    Pic zzz.
          02 Filler  Pic xxx.
          02 Eng     Pic zzz.
          02 Filler  Pic xxx.
          02 Total   Pic zzz.
          02 Filler  Pic xx.
       Working-Storage Section.
       01 H1 Pic x(80) Value \"  Reg.   State   Candidate     Candidate  
      -    \"            Marks Obtained    Total\".
       01 H2 Pic x(80) Value \" Number  Code      Name         Address
      -    \"        Maths Phy. Chem. Eng. Marks\".
       01 Line-Rec Pic x(80) Value All \"Ü\".
       01 Space-Rec Pic x(80) Value All Spaces.

       77 File-Bio   Pic x(12).
       77 File-Marks Pic x(12).
       77 File-Out   Pic x(12).
       77 EOF1       Pic x Value \"N\".
       77 EOF2       Pic x Value \"N\".

       Procedure Division.
       Main-Para.                          
           Perform Open-Para.
           Perform Heading-Para.
           Perform Read-Bio-Para.
           Perform Read-Marks-Para.
           Perform Process-Para Until EOF1 = \"Y\" Or EOF2 = \"Y\".
           Perform End-Para.
           Stop Run.

       Open-Para.
           Display(8, 15) \"Enter the Bio-Data File Name :\".
           Accept(8, 50) File-Bio With Prompt.
           Display(10, 15) \"Enter the Marks File Name   :\".
           Accept(10, 50) File-Marks With Prompt.
           Display(12, 15) \"Enter the Ouput File Name   :\".
           Accept(12, 50) File-Out With Prompt.
           Open Input Bio-File Marks-File
                Output Out-File.

       Heading-Para.
           Write Out-Rec From Line-Rec.
           Write Out-Rec From Space-Rec.
           Write Out-Rec From H1.
           Write Out-Rec From H2.
           Write Out-Rec From Space-Rec.
           Write Out-Rec From Line-Rec.
           Write Out-Rec from Space-Rec.
           Move Spaces To Out-Rec.

       Read-Bio-Para.
           Read Bio-File At End Move \"Y\" To EOF1.

       Read-Marks-Para.
           Read Marks-File At End Move \"Y\" To EOF2.

       Process-Para.
           If (RegNo Of Bio-Rec = RegNo Of Marks-Rec)
              Perform Total-Para
              Perform Move-Write-Para
              Perform Read-Bio-Para
              Perform Read-Marks-Para.

       Total-Para.
           Compute Total = Maths Of Marks-Rec + Phy Of Marks-Rec
           + Chem Of Marks-Rec + Eng Of Marks-Rec.

       Move-Write-Para.
           Move Corr Bio-Rec To Out-Rec.
           Move Corr Marks-Rec To Out-Rec.
           Write Out-Rec.


       End-Para.
           Write Out-Rec From Space-Rec.
           Write Out-Rec From Line-Rec.
           Close Bio-File Marks-File Out-File.

 
 
Didn't find what you were looking for? Find more on PROGRAM TO MERGE 2 FILES WITH STUDENTS RECORDS