Reverse String in COBOL

Published on 24 April 2026 (Updated: 24 April 2026)

Welcome to the Reverse String in COBOL page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

identification division.
program-id. reverse-string.

data division.
working-storage section.
01  arg-count           pic 9(4) comp.
01  input-string        pic x(500).

procedure division.
main.
    accept arg-count from argument-number
    if arg-count = 0
        stop run
    end-if

    accept input-string from argument-value
    
    if input-string = spaces
        stop run
    end-if

    display function reverse(input-string)
    
    goback.

Reverse String in COBOL was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.