Agent Skillsbenchflow-ai/skillsbench › ebcdic-overpunch-decoding

ebcdic-overpunch-decoding

GitHub

解析EBCDIC过冲(分区十进制)符号约定,将主机组带字母后缀的数字字段解码为有符号数值。涵盖正负字符映射表及COBOL解码逻辑,特别警示勿遗漏负号字符导致金额符号错误。

tasks-extra/cobol-gl-batch-reconcile/environment/skills/ebcdic-overpunch-decoding/SKILL.md benchflow-ai/skillsbench

Trigger Scenarios

读取包含EBCDIC过冲格式的主机磁带或数据文件 需要将末尾带特定字母(如D, M, J-R等)的数字字符串转换为标准有符号数值

Install

npx skills add benchflow-ai/skillsbench --skill ebcdic-overpunch-decoding -g -y
More Options

Non-standard path

npx skills add https://github.com/benchflow-ai/skillsbench/tree/main/tasks-extra/cobol-gl-batch-reconcile/environment/skills/ebcdic-overpunch-decoding -g -y

Use without installing

npx skills use benchflow-ai/skillsbench@ebcdic-overpunch-decoding

指定 Agent (Claude Code)

npx skills add benchflow-ai/skillsbench --skill ebcdic-overpunch-decoding -a claude-code -g -y

安装 repo 全部 skill

npx skills add benchflow-ai/skillsbench --all -g -y

预览 repo 内 skill

npx skills add benchflow-ai/skillsbench --list

SKILL.md

Frontmatter
{
    "name": "ebcdic-overpunch-decoding",
    "description": "Reference for the EBCDIC \"overpunch\" \/ zoned-decimal sign convention where the units position of a numeric field is replaced with a letter that encodes both a digit and a sign. Useful when reading mainframe-style fixed-length tapes whose amount fields appear as digits followed by a letter (e.g. \"0000000000123D\" or \"0000000000045M\")."
}

EBCDIC overpunch (zoned decimal sign)

On classic mainframe tapes, signed numeric amounts are stored as N-1 digits followed by a single byte where the high-order bits carry the sign and the low-order bits carry the final decimal digit. When the file is converted to ASCII / printable form, the last byte is rendered as a letter (or a brace).

Sign and digit table

Char Sign Last digit Char Sign Last digit
{ + 0 } 0
A + 1 J 1
B + 2 K 2
C + 3 L 3
D + 4 M 4
E + 5 N 5
F + 6 O 6
G + 7 P 7
H + 8 Q 8
I + 9 R 9

Positive zero is {; negative zero is }. Both decode to magnitude 0 — keep the sign attached so downstream arithmetic doesn't drop a debit's polarity.

A common defect

The positive half of the table ({, AI) is the visible-looking case and is often handled first. The negative half (}, JR) looks like ordinary letters and is easy to forget. If only the positive letters are decoded, debits and credits both come through as positive — the totals look plausible but signs are wrong on every negative row.

Decoding pattern (placeholder names)

Split the field into the leading digits and the overpunch byte, look up the sign + units digit from the table above, recombine, then build the signed working-storage value. The shape below uses generic identifiers — substitute your own field names:

       *> placeholders: digits-buf holds the recombined unsigned digits,
       *> op-char is the overpunch byte, sgn / lo-digit are scratch.
       split raw-amount into (leading-digits, op-char)
       EVALUATE op-char
           WHEN "{"  sgn := "+"  lo-digit := 0   *> positive zero
           WHEN "A" THRU "I"  sgn := "+"  lo-digit := 1..9
           WHEN "}"  sgn := "-"  lo-digit := 0   *> negative zero
           WHEN "J" THRU "R"  sgn := "-"  lo-digit := 1..9
       END-EVALUATE
       digits-buf := leading-digits with lo-digit appended
       signed-value := (sgn = "-")  ?  -digits-buf  :  +digits-buf

The decisive point is that the EVALUATE must cover both halves of the table — the negative letters } and JR as well as the positive {/AI. The exact PIC clauses and MOVE targets depend on your own record layout; what matters is that no overpunch character falls through undecoded.

Some shops use COBOL's SIGN IS TRAILING SEPARATE / SIGN IS TRAILING clauses with native EBCDIC zoned data, but on ASCII-converted tapes the characters above are literally what you read — explicit lookup is the clearest decode.

Verification tip

Pick one positive and one negative row from the tape, decode by hand using the table, and reconcile against an expected total. If only the positive side works you will see plausible magnitudes but inverted aggregate signs.

References

  • IBM Enterprise COBOL Language Reference — "Zoned decimal" / "USAGE DISPLAY" with SIGN IS … clauses.
  • IBM Knowledge Center: "Signed zoned decimal numbers" (overpunch table for positive { A B C D E F G H I and negative } J K L M N O P Q R).

Version History

  • 9a1f4dd Current 2026-07-24 16:36

Same Skill Collection

.agents/skills/skill-creator/SKILL.md
.agents/skills/skillsbench/SKILL.md
.agents/skills/task-creator/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gl-posting-codes/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gnucobol-mainframe-batch/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/attention-variants-from-papers/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pdf/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pubchem-database/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/rdkit/SKILL.md
tasks-extra/gh-repo-analytics/environment/skills/gh-cli/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/fragmentation-aware-packing/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/multi-resource-allocation-validation/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/online-resource-scheduling/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/mhc-algorithm/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/nanogpt-training/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/nda-clause-taxonomy/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/xlsx-parsing/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-count-in-video/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-video-understanding/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gpt-multimodal/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/video-frame-extraction/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/audiobook/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/elevenlabs-tts/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/gtts/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/openai-tts/SKILL.md
tasks-extra/scheduling-email-assistant/environment/skills/gmail-skill/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/automatic-speech-recognition/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/multimodal-fusion/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/speaker-clustering/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/voice-activity-detection/SKILL.md
tasks-extra/taxonomy-tree-merge/environment/skills/hierarchical-taxonomy-clustering/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/ffmpeg-video-editing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/filler-word-processing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/whisper-transcription/SKILL.md
tasks-extra/video-tutorial-indexer/environment/skills/speech-to-text/SKILL.md
tasks/3d-scan-calc/environment/skills/mesh-analysis/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/ada-plan-view-accessibility/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/architectural-dxf-extraction/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/geometric-layout-repair/SKILL.md
tasks/adaptive-cruise-control/environment/skills/csv-processing/SKILL.md
tasks/adaptive-cruise-control/environment/skills/pid-controller/SKILL.md
tasks/adaptive-cruise-control/environment/skills/simulation-metrics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/vehicle-dynamics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/yaml-config/SKILL.md
tasks/azure-bgp-oscillation-route-leak/environment/skills/azure-bgp/SKILL.md
tasks/bike-rebalance/environment/skills/geospatial-routing-data/SKILL.md

Metadata

Files
0
Version
9a1f4dd
Hash
c280003f
Indexed
2026-07-24 16:36

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-09 00:40
浙ICP备14020137号-1 $방문자$