Editing
COBOL Std 12 Common Defect Patterns Lessons from pgcobol
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 12. Common Defect Patterns (Lessons from pgcobol) == The following defects were observed in the pgcobol reference project and are documented here as anti-patterns to avoid: {| class="wikitable" style="width:100%" ! ID !! Severity !! Description and Prevention |- | D-01 || High || Generate loop commented out in main program β generation mode silently does nothing. Never leave PERFORM stubs commented out without removing the WHEN branch that invokes them. |- | D-02 || Medium || Seed prime (2) never inserted β first-run leaves DB in invalid state for the sieve. Document and test first-run initialisation as a separate mandatory step. |- | D-03 || Medium || Connection alias mismatch (<code>primes</code> vs <code>primesdb</code>) causes runtime SQL error. Enforce a single alias constant in WORKING-STORAGE referenced everywhere. |- | D-04 || Medium || Hard-coded credentials in WORKING-STORAGE. Use environment variables (see [[#10. Configuration and Credentials|Β§10]]). |- | D-05 || Medium || COMMIT statement commented out after INSERT β relies on implicit auto-commit. Always include explicit COMMIT/ROLLBACK (see [[#6.4 Transaction Management|Β§6.4]]). |- | D-06 || Low || Two near-identical copybooks with different naming conventions (hyphens vs underscores). One copybook, one naming rule. |- | D-07 || Low || Report loop condition (<code>session-method-eof = 9</code>) never set on EOF; loop exits on error code 1 instead. Separate EOF (result=2) from error (result=1) per [[#7.1 Return-Code Standard|Β§7.1]]. |} ---- ---- ''[[Cobol programming standards|β Back to index]]''
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information