cobol-calculadora

Creates COBOL calculator programs with GnuCOBOL compilation and arithmetic operations.

6|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/emilianoeloi/cowboy --skill cobol-calculadora-emilianoeloi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cobol-calculadora
Source: https://github.com/emilianoeloi/cowboy/tree/main/.github/skills/cobol-calculadora
Command: npx skills add https://github.com/emilianoeloi/cowboy --skill cobol-calculadora-emilianoeloi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing COBOL programs requires knowledge of strict column formatting, division structure, and PIC clauses that most developers never learned. This Skill provides complete templates and patterns for building working calculator programs in COBOL without prior COBOL experience. ## Core Features & Use Cases - Complete Calculator Template: Provides a full CALCULADORA.cbl program with IDENTIFICATION, ENVIRONMENT, DATA, and PROCEDURE divisions, including input handling and formatted output. - Arithmetic Operation Patterns: Covers ADD, SUBTRACT, MULTIPLY, DIVIDE, and COMPUTE syntax, plus safe division with zero-check error handling. - GnuCOBOL Build Commands: Includes compile, execute, debug, and syntax-check commands using cobc. - Use Case: You want to demonstrate GitHub Copilot Agent Mode by having it generate a COBOL calculator with sum, subtraction, multiplication, division, logarithm, and simple interest operations, then compile and run it with GnuCOBOL. ## Quick Start Ask the AI to create a COBOL calculator program that performs basic arithmetic operations and compile it with GnuCOBOL.

Frequently Asked Questions about cobol-calculadora

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a calculator program in COBOL?▼

Define the four COBOL divisions, declare numeric variables in WORKING-STORAGE with PIC clauses, and use ADD, SUBTRACT, MULTIPLY, or DIVIDE in the PROCEDURE DIVISION. Compile with cobc -x -o calculadora src/CALCULADORA.cbl and run the executable.

How to compile and run COBOL programs with GnuCOBOL?▼

Install GnuCOBOL via brew or apt-get, then run cobc -x -o output source.cbl to create an executable. Use cobc -fsyntax-only to check syntax without compiling, or add -debug for development builds.

How do I handle division by zero in COBOL?▼

Check the divisor with an IF statement before executing DIVIDE, since division by zero causes an abend in COBOL. Display an error message and stop the program when the divisor equals zero.

What are PIC clauses in COBOL and how do they work?▼

PIC clauses define variable formats: PIC 9(5) holds five digits, S9(5) allows signed values, and 9(5)V99 stores decimals with an implicit point. Use Z(5)9 for display to suppress leading zeros.

Why does COBOL code fail when columns are misaligned?▼

COBOL is position-sensitive: divisions and paragraph names belong in Area A while statements go in Area B. Misplaced code causes compile errors, so maintain strict column alignment and end every sentence with a period.