100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

MOVE and Arithmetic Statements

Learn how COBOL's MOVE statement reformats data between fields and how ADD, SUBTRACT, MULTIPLY, DIVIDE, and COMPUTE perform arithmetic with proper rounding and overflow handling.

Procedural LogicBeginner10 min readJul 10, 2026
Analogies

Moving Data Between Fields

In COBOL, the MOVE statement copies data from a sending field to one or more receiving fields, converting between PICTURE representations as needed. A numeric MOVE right-justifies and zero-fills or truncates according to the receiving field's PICTURE, while an alphanumeric MOVE left-justifies and space-fills. Understanding PICTURE clauses like PIC 9(5), PIC X(10), and PIC S9(7)V99 is essential because MOVE silently reformats data to match the target, and mismatched sizes cause truncation without raising any runtime error.

🏏

Cricket analogy: Copying a batter's three-digit score of 145 into a scoreboard slot that only has room for two digits truncates it to '45', just as a numeric MOVE drops leading digits when the receiving PICTURE clause is too small, the way Sachin Tendulkar's 200 would clip on an undersized display.

MOVE CORRESPONDING and Group Moves

A group move copies an entire record or group item, including all its subordinate elementary fields, as one alphanumeric operation regardless of the underlying data types of the subordinates. This is different from MOVE CORRESPONDING, which compares the data-names of subordinate fields in the sending and receiving groups and moves only the fields whose names match exactly, skipping any that don't. MOVE CORRESPONDING is commonly used when copying between two records that share many but not all field names, such as an input record and an output record with a similar but not identical layout.

🏏

Cricket analogy: A group move is like copying an entire scorecard sheet as-is from one filing folder to another without checking individual entries, while MOVE CORRESPONDING is like transferring only the columns labeled 'Runs' and 'Wickets' between two differently formatted scorecards used by the BCCI and ICC.

cobol
01  WS-INPUT-RECORD.
    05  WS-EMP-ID          PIC 9(6).
    05  WS-EMP-NAME        PIC X(30).
    05  WS-SALARY          PIC 9(7)V99.

01  WS-OUTPUT-RECORD.
    05  WS-EMP-ID          PIC 9(6).
    05  WS-EMP-NAME        PIC X(30).
    05  WS-DEPT-CODE       PIC X(4).

PROCEDURE DIVISION.
    MOVE WS-INPUT-RECORD TO WS-OUTPUT-RECORD.
    *> Group move copies bytes positionally, so DEPT-CODE
    *> now contains part of SALARY reinterpreted as text.

    MOVE CORRESPONDING WS-INPUT-RECORD TO WS-OUTPUT-RECORD.
    *> Only WS-EMP-ID and WS-EMP-NAME are moved because their
    *> names match; WS-SALARY and WS-DEPT-CODE are left alone.

A plain group MOVE is a byte-for-byte alphanumeric copy that ignores subordinate PICTURE clauses entirely. If the sending and receiving groups are not laid out identically, a group MOVE will silently misalign numeric fields and corrupt data without any compiler warning. Always prefer MOVE CORRESPONDING or explicit elementary-level MOVE statements when record layouts differ.

Arithmetic Verbs: ADD, SUBTRACT, MULTIPLY, and DIVIDE

COBOL provides dedicated arithmetic verbs rather than requiring an expression language for simple operations. ADD 1 TO WS-COUNTER increments a field in place, while ADD WS-A, WS-B GIVING WS-TOTAL sums two fields into a third without altering the operands. SUBTRACT, MULTIPLY, and DIVIDE follow the same GIVING pattern, and DIVIDE additionally supports REMAINDER to capture the modulus of an integer division. Every arithmetic verb can be paired with an ON SIZE ERROR clause, which executes imperative statements if the result would overflow the receiving field's PICTURE, letting the program handle the condition instead of producing corrupted data.

🏏

Cricket analogy: ADD 1 TO WS-OVERS-BOWLED after every over is like a scorer incrementing the over count on a physical scoreboard, while DIVIDE WS-RUNS BY WS-BALLS GIVING WS-STRIKE-RATE mirrors calculating a batter's strike rate, such as Virat Kohli's runs per hundred balls faced.

COMPUTE and ROUNDED

The COMPUTE statement evaluates a full arithmetic expression using standard operator precedence (parentheses, then exponentiation, then multiplication and division, then addition and subtraction) and assigns the result to one or more receiving fields, which is often clearer than chaining several individual arithmetic verbs. Adding the ROUNDED phrase to any arithmetic statement, including COMPUTE, applies standard rounding to the least significant digit instead of truncating it, which matters for financial calculations where truncation would systematically undercount fractional cents. COMPUTE is generally preferred over separate ADD/SUBTRACT/MULTIPLY/DIVIDE statements whenever an expression involves more than one operator, since it reduces the number of intermediate working-storage fields needed.

🏏

Cricket analogy: COMPUTE WS-NRR = (WS-RUNS-FOR / WS-OVERS-FOR) - (WS-RUNS-AGAINST / WS-OVERS-AGAINST) mirrors how net run rate is calculated in an IPL points table, combining multiple divisions and a subtraction in one formula rather than several separate steps.

cobol
IDENTIFICATION DIVISION.
PROGRAM-ID. PAYROLL-CALC.

DATA DIVISION.
WORKING-STORAGE SECTION.
01  WS-HOURS-WORKED     PIC 9(3)V99  VALUE 45.50.
01  WS-HOURLY-RATE      PIC 9(3)V99  VALUE 22.75.
01  WS-OT-HOURS         PIC 9(3)V99.
01  WS-GROSS-PAY        PIC 9(6)V99.

PROCEDURE DIVISION.
    IF WS-HOURS-WORKED > 40
        SUBTRACT 40 FROM WS-HOURS-WORKED GIVING WS-OT-HOURS
        COMPUTE WS-GROSS-PAY ROUNDED =
            (40 * WS-HOURLY-RATE) +
            (WS-OT-HOURS * WS-HOURLY-RATE * 1.5)
            ON SIZE ERROR
                DISPLAY "GROSS PAY OVERFLOW"
        END-COMPUTE
    ELSE
        COMPUTE WS-GROSS-PAY ROUNDED = WS-HOURS-WORKED * WS-HOURLY-RATE
    END-IF
    DISPLAY "GROSS PAY: " WS-GROSS-PAY.
    STOP RUN.

Without ROUNDED, COBOL truncates arithmetic results to fit the receiving field's decimal places, which biases every calculation downward. For any monetary or statistical computation, always add ROUNDED unless you have a specific reason to truncate, and always pair COMPUTE or arithmetic verbs with ON SIZE ERROR when overflow is possible.

  • MOVE reformats data to fit the receiving field's PICTURE clause: numeric moves right-justify and zero/truncate, alphanumeric moves left-justify and space-fill.
  • A plain group MOVE copies bytes positionally regardless of subordinate field names, while MOVE CORRESPONDING only moves subordinate fields whose data-names match.
  • ADD, SUBTRACT, MULTIPLY, and DIVIDE support a GIVING phrase to store results in a separate field without altering the operands.
  • DIVIDE supports a REMAINDER phrase to capture the modulus of an integer division.
  • ON SIZE ERROR lets a program intercept arithmetic overflow instead of silently producing a truncated or corrupted result.
  • COMPUTE evaluates a full expression with standard operator precedence and is preferred over chained arithmetic verbs for multi-operator formulas.
  • ROUNDED applies standard rounding instead of truncation and should be used for any monetary or precision-sensitive calculation.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#COBOLStudyNotes#MOVEAndArithmeticStatements#MOVE#Arithmetic#Statements#Moving#StudyNotes#SkillVeris#ExamPrep

Frequently Asked Questions

21 categories · pick one to explore

Where can I get free study notes for programming and tech subjects?
SkillVeris offers completely free study notes covering programming and tech subjects, with no signup fees or paywalls. The notes are structured by course and topic, written for quick understanding, and enriched with the Learn Through Hobbies analogy method, so you can revise concepts through cricket, music, gaming, cooking and more.
Are SkillVeris study notes good for exam revision?
Yes, the study notes are designed for efficient revision: each topic answers its heading immediately, keeps explanations concise, and links to related glossary terms and cheat sheets. Students preparing for university exams or certification tests use them as quick revision notes because they distil concepts without the padding of full textbooks.
What subjects do the free study notes cover?
The study notes span the platform's main domains, including AI and machine learning, Python and programming, web development, DevOps, cloud, security and databases. Coverage mirrors the 37 live courses, so notes exist for the topics you are actually studying, and new note sets are added as courses launch.
How are SkillVeris study notes different from regular textbooks?
The notes are answer-first, concise and free, whereas textbooks are long and often expensive. Each section explains one concept directly, then reinforces it through selectable hobby analogies like cricket or cooking. Notes also cross-link to the glossary, blog and cheat sheets, letting you jump to related material instantly instead of flipping pages.
Can I use the developer study material without creating an account?
The study notes are free to access, and SkillVeris does not charge anything for its developer study material at any point. Browsing notes is straightforward from the Study Notes section, and if you want progress tracking, certificates and AI Mentor conversations tied to your learning, a free account unlocks those extras.
Do the study notes explain concepts with analogies?
Yes, this is a signature SkillVeris feature. Study notes use the Learn Through Hobbies method, explaining technical concepts through analogies from twelve domains including cricket, music, gaming, photography, travel, movies, fitness, chess, cooking, finance, business and sports. You can switch the analogy domain instantly to whichever hobby makes the concept click.
Are the revision notes suitable for last-minute exam preparation?
Yes, revision notes on SkillVeris work well for last-minute preparation because every section states the answer in its first sentences, so skimming is genuinely effective. Pair them with the relevant cheat sheet for formulas and syntax, and use the glossary for any unfamiliar term you meet while cramming.
Is there free study material for AI and machine learning?
Yes, SkillVeris provides free study notes across its AI and ML catalogue, covering Python for AI, deep learning frameworks like PyTorch and TensorFlow, Hugging Face Transformers, Large Language Models, RAG, AI agents and MLOps. All of it is free, making it a strong resource for Indian students and global learners alike.
Can beginners understand the study notes, or are they for experts?
Beginners can absolutely use them. The notes are written in plain language, define terms as they appear, and lean on hobby analogies to make abstract ideas concrete. Difficulty scales with the underlying course level, so beginner-course notes stay gentle while advanced-course notes go deeper, and the glossary supports you throughout.
How do study notes connect with SkillVeris courses?
Study notes are organised by course and topic, so they map directly to the structured courses and their 24–40-lesson curriculum. Many learners study a lesson first, then use the matching notes for revision before module assessments and the final exam, where 80 percent is required to pass and earn the certificate.
Are there study notes for Python specifically?
Yes, Python is well covered through notes tied to the Python-focused courses, including Python for AI and ML. Topics span fundamentals through applied machine learning usage. You can reinforce the notes with Python practice in Code Lab, which runs code in your browser with no installation required.
Do the study notes include code examples?
Yes, study notes include code examples wherever a concept is best shown in code, alongside explanations, key points and analogies. Reading a snippet in the notes and then reproducing it yourself in Code Lab is an effective loop, since Code Lab lets you run code in the browser across six languages.
How often is new study material added to SkillVeris?
Study material grows alongside the course catalogue. Whenever new courses join the platform's 37 live courses, matching study notes, glossary entries and cheat sheets are added so the resources stay in sync. Existing notes are also refined over time, so it is worth revisiting topics you studied earlier.
Can I use SkillVeris notes to prepare for technical interviews?
Yes, the notes make excellent interview revision because they compress each concept into direct, answer-first explanations, which mirrors how you should answer interview questions. Combine them with the SkillVeris interview questions feature, which includes readiness scoring, to test whether your revision has actually made you interview-ready.
Are the study notes mobile-friendly for studying on the go?
Yes, the study notes are built to load fast and read comfortably on mobile devices, so you can revise during a commute or between classes. Sections are short and answer-first, which suits small screens, and analogy switching works on mobile too, letting you study anywhere without carrying books.
What is the difference between study notes and cheat sheets?
Study notes explain concepts in depth with context, examples and analogies, making them ideal for learning and revision. Cheat sheets are compact quick-reference summaries of syntax, commands and key facts, ideal once you already understand a topic. Most learners study the notes first, then keep the cheat sheet handy while coding.
Do study notes help if I am stuck on a course lesson?
Yes, reading the matching study notes often clarifies a lesson because the same concept is explained from a different angle, frequently with a different analogy. If you are still stuck, ask the AI Mentor, which answers 24/7 at Quick, Detailed or Deep-dive depth until the idea genuinely makes sense.
Is there free study material for DevOps and cloud topics?
Yes, SkillVeris carries free study notes for DevOps and cloud topics as part of its coverage across 37 live courses. The material suits learners following the DevOps Engineer or Cloud Engineer paths, and it links to related glossary terms and cheat sheets so you can revise the whole toolchain in one place.
Can school or college students in India use these notes for projects?
Yes, students across India and worldwide use SkillVeris notes for coursework, projects and exam preparation, and everything is free, which matters for student budgets. The notes explain concepts clearly enough to cite in project reports, and Code Lab lets you prototype the project code directly in your browser.
How should I combine study notes with other SkillVeris resources?
A proven loop: learn from a course lesson, revise with the matching study notes, look up unfamiliar terms in the glossary, keep the cheat sheet open while practising in Code Lab, and quiz yourself with interview questions. The AI Mentor fills any remaining gaps 24/7, at whatever depth you need.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse