가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Prepare Interview

모의 시험

홈페이지로 설정

이 페이지 북마크

이메일 주소 구독
Technical Tutorial Guide

COBOL 튜토리얼

Learn the core ideas in COBOL 튜토리얼, review the guide below, and continue into related tutorials and practice resources when you are ready.

technology track Basic Language
related tutorials 15
practice path available

Tutorial walkthrough

Use this guide as your primary reading resource, then continue with the supporting links to deepen your preparation.

Live tutorial
COBOL, or Common Business-Oriented Language, is one of the oldest high-level programming languages, designed primarily for business, finance, and administrative systems. It was developed in the late 1950s and early 1960s by a committee of researchers from private industry, universities, and government organizations. COBOL was created to be easily readable and understandable by non-programmers, with syntax that resembles natural language, particularly English. This feature made it popular for writing business applications, especially those dealing with large amounts of data processing and transaction-oriented tasks. Despite being considered somewhat outdated compared to more modern programming languages, COBOL still plays a crucial role in many legacy systems, particularly in industries like finance, insurance, and government, where stability and reliability are paramount. These systems often handle massive volumes of data and transactions, and rewriting them in newer languages would be costly and risky. Installation

COBOL Installation and Setup Tutorial

1. What is COBOL?

COBOL stands for Common Business-Oriented Language. It is a high-level programming language primarily used for business, finance, and administrative systems.

2. Why COBOL?

COBOL is often used for its readability and understandability, especially for non-programmers. It is commonly found in legacy systems, particularly in industries such as finance and government.

3. Installation Steps

  1. Download COBOL compiler from the vendor's website.
  2. Run the installer and follow the on-screen instructions.
  3. Set up environment variables if necessary.

4. Setting Up COBOL Environment

To set up the COBOL environment, you need to configure the compiler and ensure that the necessary libraries are accessible.

      
SET COBOL_HOME=C:\path\to\cobol
SET PATH=%PATH%;%COBOL_HOME%\bin
      
    

5. Compiling and Running a COBOL Program

Once the environment is set up, you can compile and run COBOL programs using the command-line interface.

      
cobc -x -o program.exe program.cbl
./program.exe
      
    
Introduction

Introduction to COBOL

1. What is COBOL?

COBOL, which stands for Common Business-Oriented Language, is a high-level programming language primarily used for business, finance, and administrative systems.

2. Features of COBOL

COBOL was designed to be easily readable and understandable by non-programmers, with syntax that resembles natural language, particularly English.

3. Why COBOL?

COBOL is commonly found in legacy systems, especially in industries such as finance, insurance, and government, where stability and reliability are crucial.

4. Example of COBOL Code

Below is a simple example of a COBOL program:

      
IDENTIFICATION DIVISION.
PROGRAM-ID. HelloWorld.
PROCEDURE DIVISION.
DISPLAY 'Hello, World!'.
STOP RUN.
      
    
Syntax and Structure

COBOL Syntax and Structure

1. What is the syntax of COBOL?

COBOL syntax is designed to be readable and resembles natural language, particularly English. Statements are written in a structured format with specific divisions and sections.

2. Structure of COBOL Program

A COBOL program consists of various divisions, sections, paragraphs, and sentences. The main divisions are:

  • Identification Division
  • Environment Division
  • Data Division
  • Procedure Division

3. Example of COBOL Code

Below is an example of a simple COBOL program:

      
IDENTIFICATION DIVISION.
PROGRAM-ID. HelloWorld.
PROCEDURE DIVISION.
DISPLAY 'Hello, World!'.
STOP RUN.
      
    
Data Types

COBOL Data Types

1. What are the data types in COBOL?

COBOL supports various data types for representing different kinds of information. Some common data types include:

  • Numeric: INTEGER, FLOAT, PACKED-DECIMAL
  • Alphanumeric: STRING, CHAR
  • Boolean: BOOLEAN
  • Date and Time: DATE, TIME

2. Example of Data Declarations in COBOL

Below is an example of data declarations in COBOL:

      
DATA DIVISION.
WORKING-STORAGE SECTION.
01 EMPLOYEE-ID PIC X(5).
01 EMPLOYEE-NAME PIC X(30).
01 EMPLOYEE-SALARY PIC 9(7)V99.
01 IS-EMPLOYEE-ACTIVE PIC X.
01 EMPLOYEE-HIRE-DATE PIC 9(6).
      
    
File Handling

COBOL File Handling

1. What is file handling in COBOL?

File handling in COBOL involves reading from and writing to external files. COBOL provides various file organization modes and access modes to handle different types of files.

2. File Organizations and Access Modes

COBOL supports different file organizations such as sequential, indexed, and relative, and access modes such as sequential, random, and dynamic.

3. Example of File Handling in COBOL

Below is an example of file handling in COBOL:

      
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT EMPLOYEE-FILE ASSIGN TO 'employee.dat'
       ORGANIZATION IS SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD EMPLOYEE-FILE.
01 EMPLOYEE-RECORD.
  05 EMPLOYEE-ID PIC X(5).
  05 EMPLOYEE-NAME PIC X(30).
  05 EMPLOYEE-SALARY PIC 9(7)V99.

PROCEDURE DIVISION.
OPEN INPUT EMPLOYEE-FILE.
READ EMPLOYEE-FILE INTO EMPLOYEE-RECORD.
DISPLAY 'Employee ID: ' EMPLOYEE-ID.
DISPLAY 'Employee Name: ' EMPLOYEE-NAME.
DISPLAY 'Employee Salary: ' EMPLOYEE-SALARY.
CLOSE EMPLOYEE-FILE.
      
    
Conditional Statements

COBOL Conditional Statements

1. What are conditional statements in COBOL?

Conditional statements in COBOL allow you to execute different sets of instructions based on certain conditions. COBOL supports various conditional statements such as IF, ELSE, and EVALUATE.

2. Example of IF Statement in COBOL

Below is an example of an IF statement in COBOL:

      
IF EMPLOYEE-SALARY > 50000
    DISPLAY 'High Salary'
ELSE
    DISPLAY 'Low Salary'
END-IF.
      
    

3. Example of EVALUATE Statement in COBOL

Below is an example of an EVALUATE statement in COBOL:

      
EVALUATE EMPLOYEE-DEPARTMENT
    WHEN 'IT'
DISPLAY 'Information Technology'
    WHEN 'HR'
DISPLAY 'Human Resources'
    WHEN 'SALES'
DISPLAY 'Sales'
    WHEN OTHER
DISPLAY 'Other Department'
END-EVALUATE.
      
    
Loops

COBOL Loops

1. What are loops in COBOL?

Loops in COBOL allow you to execute a set of instructions repeatedly until a certain condition is met. COBOL supports various types of loops such as PERFORM, PERFORM UNTIL, and PERFORM VARYING.

2. Example of PERFORM Loop in COBOL

Below is an example of a PERFORM loop in COBOL:

      
PERFORM 10-TIMES
    DISPLAY 'Hello, World!'
END-PERFORM.

10-TIMES.
DISPLAY 'Loop iteration'.
      
    

3. Example of PERFORM UNTIL Loop in COBOL

Below is an example of a PERFORM UNTIL loop in COBOL:

      
PERFORM UNTIL EMPLOYEE-COUNT = 10
    ADD 1 TO EMPLOYEE-COUNT
    DISPLAY 'Employee Count: ' EMPLOYEE-COUNT
END-PERFORM.
      
    
Subroutines and Functions

COBOL Subroutines and Functions

1. What are subroutines and functions in COBOL?

Subroutines and functions in COBOL allow you to modularize your code by grouping related instructions into separate sections that can be called from other parts of the program. This promotes code reusability and maintainability.

2. Example of Subroutine in COBOL

Below is an example of a subroutine in COBOL:

      
IDENTIFICATION DIVISION.
PROGRAM-ID. MainProgram.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUM1 PIC 9(3) VALUE 100.
01 NUM2 PIC 9(3) VALUE 200.
01 RESULT PIC 9(4).

PROCEDURE DIVISION.
CALL 'AddNumbers' USING NUM1, NUM2, RESULT.
DISPLAY 'Result: ' RESULT.
STOP RUN.

IDENTIFICATION DIVISION.
PROGRAM-ID. AddNumbers.

DATA DIVISION.
LINKAGE SECTION.
01 A PIC 9(3).
01 B PIC 9(3).
01 C PIC 9(4).

PROCEDURE DIVISION USING A B C.
COMPUTE C = A + B.
EXIT PROGRAM.
      
    
Arrays

COBOL Arrays

1. What are arrays in COBOL?

Arrays in COBOL allow you to store multiple values of the same data type under a single name. They provide a way to efficiently manage and manipulate collections of data elements.

2. Example of Array Declaration in COBOL

Below is an example of an array declaration in COBOL:

      
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUMBERS OCCURS 5 TIMES PIC 9(3) VALUE ZERO.
01 NAMES OCCURS 3 TIMES PIC X(20).
      
    

3. Example of Array Usage in COBOL

Below is an example of how to use an array in COBOL:

      
MOVE 100 TO NUMBERS(1).
MOVE 200 TO NUMBERS(2).
MOVE 'John' TO NAMES(1).
MOVE 'Doe' TO NAMES(2).
      
    
String Handling

COBOL String Handling

1. What is string handling in COBOL?

String handling in COBOL involves manipulating character strings, such as concatenation, comparison, and extraction of substrings. COBOL provides various string manipulation functions and operators to perform these tasks.

2. Example of String Manipulation in COBOL

Below is an example of string manipulation in COBOL:

      
MOVE 'Hello' TO STRING1.
MOVE 'World' TO STRING2.
STRING STRING1 ' ' STRING2 DELIMITED BY SIZE INTO RESULT.
DISPLAY 'Concatenated String: ' RESULT.
      
    
Sorting and Searching

COBOL Sorting and Searching

1. What is sorting and searching in COBOL?

Sorting and searching in COBOL involve arranging data in a specified order and finding particular elements within a dataset. COBOL provides built-in functions and procedures for performing sorting and searching operations efficiently.

2. Example of Sorting in COBOL

Below is an example of sorting an array in COBOL:

      
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUMBERS OCCURS 5 TIMES PIC 9(3) VALUE ZERO.

PROCEDURE DIVISION.
MOVE 100 TO NUMBERS(1).
MOVE 80 TO NUMBERS(2).
MOVE 120 TO NUMBERS(3).
MOVE 90 TO NUMBERS(4).
MOVE 110 TO NUMBERS(5).

PERFORM VARYING I FROM 1 BY 1 UNTIL I > 4
    PERFORM VARYING J FROM I + 1 BY 1 UNTIL J > 5
IF NUMBERS(I) > NUMBERS(J)
    MOVE NUMBERS(I) TO TEMP
    MOVE NUMBERS(J) TO NUMBERS(I)
    MOVE TEMP TO NUMBERS(J)
END-IF
    END-PERFORM
END-PERFORM.
      
    

3. Example of Searching in COBOL

Below is an example of searching for an element in an array in COBOL:

      
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUMBERS OCCURS 5 TIMES PIC 9(3) VALUE ZERO.
01 SEARCH-NUMBER PIC 9(3) VALUE 120.
01 FOUND PIC X VALUE 'N'.

PROCEDURE DIVISION.
MOVE 100 TO NUMBERS(1).
MOVE 80 TO NUMBERS(2).
MOVE 120 TO NUMBERS(3).
MOVE 90 TO NUMBERS(4).
MOVE 110 TO NUMBERS(5).

PERFORM VARYING I FROM 1 BY 1 UNTIL I > 5
    IF NUMBERS(I) = SEARCH-NUMBER
MOVE 'Y' TO FOUND
EXIT PERFORM
    END-IF
END-PERFORM.

IF FOUND = 'Y'
    DISPLAY 'Number found.'
ELSE
    DISPLAY 'Number not found.'
END-IF.
      
    
Error Handling

COBOL Error Handling

1. How does error handling work in COBOL?

COBOL provides various mechanisms for error handling, including error codes, exception handling, and error reporting. Programmers can use these features to detect and handle errors gracefully during program execution.

2. Example of Error Handling in COBOL

Below is an example of error handling in COBOL:

      
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT EMPLOYEE-FILE ASSIGN TO 'employee.dat'
       ORGANIZATION IS SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD EMPLOYEE-FILE.
01 EMPLOYEE-RECORD.
  05 EMPLOYEE-ID PIC X(5).
  05 EMPLOYEE-NAME PIC X(30).
  05 EMPLOYEE-SALARY PIC 9(7)V99.

PROCEDURE DIVISION.
TRY.
    OPEN INPUT EMPLOYEE-FILE.
    READ EMPLOYEE-FILE INTO EMPLOYEE-RECORD
AT END
    DISPLAY 'No more records.'
    END-READ.
CATCH file-status-error
    DISPLAY 'Error reading file: ' FILE-STATUS.
END-TRY.
      
    
Debugging Techniques

COBOL Debugging Techniques

1. What are debugging techniques in COBOL?

Debugging techniques in COBOL involve identifying and fixing errors or bugs in the program. Some common debugging techniques include using display statements for tracing, using debugging tools provided by COBOL compilers, and analyzing program logic and data flow.

2. Example of Debugging Technique in COBOL

Below is an example of using display statements for tracing in COBOL:

      
IDENTIFICATION DIVISION.
PROGRAM-ID. DebugExample.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUM1 PIC 9(3) VALUE 100.
01 NUM2 PIC 9(3) VALUE 200.
01 RESULT PIC 9(4).

PROCEDURE DIVISION.
DISPLAY 'Debugging started...'.
COMPUTE RESULT = NUM1 + NUM2.
DISPLAY 'Result: ' RESULT.
DISPLAY 'Debugging ended.'.
STOP RUN.
      
    

All tutorial subjects

Browse the full learning library and switch to another topic whenever you need it.

R Language 튜토리얼 Basic Language
technology track
C# 튜토리얼 Basic Language
technology track Trending
DIGITAL Command Language(DCL) 튜토리얼 Basic Language
technology track
Swift 튜토리얼 Basic Language
technology track
Fortran 튜토리얼 Basic Language
technology track
COBOL 튜토리얼 Basic Language
Live tutorial
Dlang 튜토리얼 Basic Language
technology track
Golang 튜토리얼 Basic Language
technology track Trending
MATLAB 튜토리얼 Basic Language
technology track
.NET Core 튜토리얼 Basic Language
technology track Trending
CobolScript 튜토리얼 Basic Language
technology track
Scala 튜토리얼 Basic Language
technology track
Python 튜토리얼 Basic Language
technology track Trending
C++ 튜토리얼 Basic Language
technology track Trending
Rust 튜토리얼 Basic Language
technology track
C Language 튜토리얼 Basic Language
technology track Trending
Snowflake 튜토리얼 Cloud
technology track
PostgreSQL 튜토리얼 Database
technology track Trending
MySQL 튜토리얼 Database
technology track Trending
Redis 튜토리얼 Database
technology track Trending
MongoDB 튜토리얼 Database
technology track Trending
Microsoft Power BI 튜토리얼 Database
technology track
System Programming 튜토리얼 Engineering
technology track
Electrical Technology 튜토리얼 Engineering
technology track
Spring Boot 튜토리얼 Java
technology track Trending
Core Java OOPs 튜토리얼 Java
technology track Trending
Java 튜토리얼 Java
technology track Trending
Organization (Company) 튜토리얼 More
technology track
Discrete Mathematics 튜토리얼 More
technology track
JavaScript(JS) 튜토리얼 Scripting Language
technology track Trending
AngularJS 튜토리얼 Web Development
technology track
Vue JS 튜토리얼 Web Development
technology track
ReactJS 튜토리얼 Web Development
technology track Trending
CodeIgnitor 튜토리얼 Web Development
technology track
Ruby on Rails 튜토리얼 Web Development
technology track
PHP 튜토리얼 Web Development
technology track Trending
Node.js 튜토리얼 Web Development
technology track Trending
Flask 튜토리얼 Web Development
technology track
Next JS 튜토리얼 Web Development
technology track
Laravel 튜토리얼 Web Development
technology track
Express JS 튜토리얼 Web Development
technology track
Copyright © 2026, WithoutBook.