Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Zig
Javascript
GIMPLE
Ygen
sway
cobol source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
GCC (GCC master)
GCC (cobol+master)
GCC 15.1.0
GCC 15.1.0 (GCC assertions)
GnuCOBOL 1.1
GnuCOBOL 2.2
GnuCOBOL 3.1
GnuCOBOL 3.2
GnuCOBOL 3.2 rc2
Options
Source code
identification division. program-id. tintr. data division. working-storage section. 01 ws-feld1 pic x(10). 01 ws-feld2 pic x(10). 01 ws-feld3 pic x(10). 01 ws-feld4 pic x(10). procedure division. move "Wert1 " to ws-feld1 move "wert1 x" to ws-feld2 * display "<" function upper-case(ws-feld1) ">" display "<" function upper-case(ws-feld2) ">" * display "<" function trim(ws-feld1) ">" display "<" function trim(ws-feld2) ">" * display "<" function upper-case (function trim(ws-feld1)) ">" display "<" function upper-case (function trim (ws-feld2)) ">" * Compare WS-Feld1/WS-Feld2 if ws-feld1 = ws-feld2 then display " felder1-2 identical" else display " felder1-2 not identical" end-if * Compare Functions uppercase/Trim if function upper-case (function trim(ws-feld1)) = function upper-case (function trim(ws-feld2)) then display " felder1-2/function identical" else display " felder1-2/function not identical" end-if * moving result of functions into field move function upper-case (function trim(ws-feld1)) to ws-feld3 move function upper-case (function trim(ws-feld2)) to ws-feld4 * Compare WS-Feld3/WS-Feld4 if ws-feld3 = ws-feld4 then display " felder3-4 identical" else display " felder3-4 not identical" end-if * stop run.
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree