Editing
Data dictionary
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!
<span id="data-dictionary"></span> = Data Dictionary = '''Project:''' pgcobol — Prime Numbers Application<br /> '''Version:''' 1.0 (reverse-engineered)<br /> '''Date:''' 2026-03-17 ----- <span id="conventions"></span> == 1. Conventions == {| ! Column ! Meaning |- | Name | COBOL data-name as written in source |- | Level | 01 / 03 / 05 / 07 hierarchy level |- | Picture | COBOL PICTURE clause |- | Usage | DISPLAY (default) / COMP-3 / COMP-5 |- | Source | Copybook or program where defined |- | Description | Semantic meaning and valid values |} Condition-names (88-level) are listed under the field they qualify. ----- <span id="copybook-primes-session.cpy"></span> == 2. Copybook: primes-session.cpy == '''Control block for the session (main → business-logic) tier.''' {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>primes-session</code> | 01 | — | — | Root of session control block; passed as linkage to primesgen |- | <code>methods</code> | 03 | X(32) | DISPLAY | Operation verb set by primesmain before calling primesgen |- | — <code>report-primes</code> | 88 | — | — | VALUE “report” — run the report path |- | — <code>generate-primes</code> | 88 | — | — | VALUE “generate” — run the sieve path |- | — <code>start-primes</code> | 88 | — | — | VALUE “start” — (reserved, not used in current flow) |- | — <code>stop-primes</code> | 88 | — | — | VALUE “stop” — (reserved, not used in current flow) |- | — <code>invalid-method</code> | 88 | — | — | VALUE “bad” — sentinel for bad dispatch |- | <code>session-result</code> | 03 | 9(2) | DISPLAY | Result code written back by primesgen; initial value ZERO |- | — <code>session-method-ok</code> | 88 | — | — | VALUE 0 — operation succeeded |- | — <code>session-method-nok</code> | 88 | — | — | VALUE 1 — operation failed |- | — <code>session-method-eof</code> | 88 | — | — | VALUE 9 — cursor exhausted (end of data) |} ----- <span id="copybook-primes-dal.cpy"></span> == 3. Copybook: primes-dal.cpy == '''Control block for the DAL (business-logic → data-access) tier.''' {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>primes-dal</code> | 01 | — | — | Root of DAL control block; passed as linkage to primes |- | <code>dal-methods</code> | 03 | X(32) | DISPLAY | Operation verb set by caller |- | — <code>next-prime</code> | 88 | — | — | VALUE “next-prime” — fetch next row from cursor |- | — <code>next-divider</code> | 88 | — | — | VALUE “next-divider” — select divider by ident |- | — <code>write-prime</code> | 88 | — | — | VALUE “write” — insert prime into table |- | — <code>db-cursor</code> | 88 | — | — | VALUE “cursor” — start transaction and open cursor |- | — <code>db-connect</code> | 88 | — | — | VALUE “connect” — connect to PostgreSQL |- | — <code>db-disconnect</code> | 88 | — | — | VALUE “disconnect” — disconnect from PostgreSQL |- | — <code>invalid-method</code> | 88 | — | — | VALUE “bad” — sentinel for bad dispatch |- | <code>primes-data</code> | 03 | — | — | One-row data payload |- | <code>primes-sequence</code> | 05 | 9(9) | DISPLAY | Sequence / ident of the current prime row |- | <code>prime-number</code> | 05 | 9(9) | DISPLAY | Value of the current prime |- | <code>dal-result</code> | 03 | 9(2) | DISPLAY | Result code written back by primes; initial value ZERO |- | — <code>dal-method-ok</code> | 88 | — | — | VALUE 0 — operation succeeded |- | — <code>dal-method-nok</code> | 88 | — | — | VALUE 1 — operation failed |- | — <code>dal-method-eof</code> | 88 | — | — | VALUE 99 — cursor exhausted |} ----- <span id="copybook-primes-ui.cpy"></span> == 4. Copybook: primes-ui.cpy == '''Control block for the UI tier; included by all four programs.''' {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>primes-ui</code> | 01 | — | — | Root of UI control block; passed as linkage to primesui |- | <code>ui-methods</code> | 03 | X(32) | DISPLAY | Operation verb set by caller |- | — <code>write-ui</code> | 88 | — | — | VALUE “write” — add one prime row to print buffer |- | — <code>message-ui</code> | 88 | — | — | VALUE “log-message” — display console message |- | — <code>start-ui</code> | 88 | — | — | VALUE “start” — open print file |- | — <code>stop-ui</code> | 88 | — | — | VALUE “stop” — flush and close print file |- | <code>process-message</code> | 03 | — | — | Structured console log record |- | <code>program-name</code> | 05 | X(20) | DISPLAY | Name of the calling program (for log messages) |- | <code>program-line</code> | 05 | — | — | Group: paragraph name + message text |- | <code>program-paragraph</code> | 07 | X(20) | DISPLAY | Name of the calling paragraph |- | <code>program-message</code> | 07 | X(92) | DISPLAY | Human-readable status or error message |- | <code>u-primes</code> | 03 | — | — | One prime row for the print writer |- | <code>u-sequence</code> | 05 | 9(9) | DISPLAY | Prime sequence number (ident) to print |- | <code>u-number</code> | 05 | 9(9) | DISPLAY | Prime value to print |- | <code>ui-method-result</code> | 03 | 9(2) | DISPLAY | Result code from primesui; initial value ZERO |- | — <code>ui-method-ok</code> | 88 | — | — | VALUE 0 — operation succeeded |- | — <code>ui-method-nok</code> | 88 | — | — | VALUE 1 — operation failed |} ----- <span id="copybook-primes-table.cpy"></span> == 5. Copybook: primes-table.cpy == '''SQL host variable — character (DISPLAY) format.''' {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>primes-table</code> | 01 | — | — | Host variable group for SQL bind/into |- | <code>ident</code> | 03 | S9(9) | DISPLAY | Row identity (sequence number), signed |- | <code>prime</code> | 03 | S9(9) | DISPLAY | Prime value, signed |} ----- <span id="copybook-primes_table.cpy"></span> == 6. Copybook: primes_table.cpy == '''SQL host variable — packed-decimal (COMP-3) format. Alternate version of primes-table.cpy.''' {| ! Name ! Level ! Picture ! Usage ! Description |- | <code>primes_table</code> | 01 | — | — | Host variable group for SQL bind/into |- | <code>ident</code> | 03 | S9(9) | COMP-3 | Row identity, packed decimal |- | <code>prime</code> | 03 | S9(9) | COMP-3 | Prime value, packed decimal |} ----- <span id="copybook-sqlca.cpy"></span> == 7. Copybook: SQLCA.cpy == '''GixSQL SQL Communications Area — standard across all embedded-SQL programs.''' {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>SQLCA</code> | 01 | — | — | SQL communications area |- | <code>SQLCAID</code> | 05 | X(8) | DISPLAY | SQLCA identifier string |- | <code>SQLCABC</code> | 05 | S9(9) | COMP-5 | Byte length of SQLCA |- | <code>SQLCODE</code> | 05 | S9(9) | COMP-5 | SQL return code: 0 = success, negative = error, +100 = not found |- | <code>SQLERRM</code> | 05 | — | — | Error message group |- | <code>SQLERRML</code> | 49 | S9(4) | COMP-5 | Length of error message text |- | <code>SQLERRMC</code> | 49 | X(70) | DISPLAY | Error message text |- | <code>SQLERRP</code> | 05 | X(8) | DISPLAY | Error program (not used) |- | <code>SQLERRD</code> | 05 | S9(9) OCCURS 6 | COMP-5 | Diagnostic codes; SQLERRD(3) = rows processed |- | <code>SQLWARN</code> | 05 | — | — | Warning flags group (not used) |- | <code>SQLWARN0</code>–<code>SQLWARN7</code> | 10 | X(1) | DISPLAY | Individual warning flags |- | <code>SQLSTATE</code> | 05 | X(5) | DISPLAY | ANSI SQL state code |} ----- <span id="program-primesmain-working-storage"></span> == 8. Program: primesmain — Working Storage == {| !width="16%"| Name !width="16%"| Level !width="16%"| Picture !width="16%"| Usage !width="16%"| Source !width="16%"| Description |- | <code>filler</code> | 01 | X(32) VALUE “Start WS primesmain” | DISPLAY | primesmain.cbl | Debug marker to locate WS in memory dump |- | <code>commandline-args</code> | 01 | X(32) | DISPLAY | primesmain.cbl | Command-line argument accepted from OS |- | — <code>execute-generate</code> | 88 | — | — | primesmain.cbl | VALUE “generate” |- | — <code>execute-report</code> | 88 | — | — | primesmain.cbl | VALUE “report” |- | <code>primes-session</code> | 01 | (group) | — | COPY | See §2 |- | <code>primes-ui</code> | 01 | (group) | — | COPY | See §4 |} ----- <span id="program-primesgen-working-storage"></span> == 9. Program: primesgen — Working Storage == {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>filler</code> | 01 | X(32) VALUE “Start WS primesgen” | DISPLAY | Debug WS marker |- | <code>file-buffer</code> | 01 | X(132) | DISPLAY | FD record area for fprinter (declared but file not opened in primesgen) |- | <code>printer</code> | 01 | — | — | Print control group (unused in primesgen; print handled by primesui) |- | <code>print-buffer</code> | 03 | X(132) | DISPLAY | Line buffer |- | <code>line-number</code> | 03 | 99 VALUE 99 | DISPLAY | Current line counter |- | <code>page-number</code> | 03 | 9(4) VALUE ZERO | DISPLAY | Current page counter |- | <code>test-quot</code> | 01 | 9(9) | DISPLAY | Quotient from DIVIDE in sieve loop |- | <code>primes</code> | 01 | — | — | Local sieve control group (mirrors primes-dal structure) |- | <code>gen-methods</code> | 03 | X(32) | DISPLAY | Method verb for internal DAL calls |- | — <code>query-process</code> | 88 | — | — | VALUE “query” |- | — <code>start-process</code> | 88 | — | — | VALUE “start” |- | — <code>next-divider</code> | 88 | — | — | VALUE “get” |- | — <code>write-prime</code> | 88 | — | — | VALUE “put” |- | — <code>stop-process</code> | 88 | — | — | VALUE “stop” |- | <code>primes-result</code> | 03 | 9(2) VALUE ZERO | DISPLAY | Result of sieve DAL call |- | — <code>init-primes-ok</code> | 88 | — | — | VALUE 1 |- | — <code>first-divider-ok</code> | 88 | — | — | VALUE 2 |- | — <code>next-divider-ok</code> | 88 | — | — | VALUE 3 |- | <code>test-number</code> | 03 | 9(9) | DISPLAY | Current candidate being tested for primality |- | <code>test-number-sqr</code> | 03 | 9(9)V9(9) | DISPLAY | Square root of test-number (decimal) |- | <code>test-divider</code> | 03 | 9(9) | DISPLAY | Current trial divisor fetched from DB |- | <code>test-rest</code> | 03 | 9(9)V9(9) | DISPLAY | Remainder from DIVIDE |- | <code>old-test-number</code> | 03 | 9(9) | DISPLAY | Previous test-number (diagnostic / unused) |- | <code>old-ident</code> | 03 | 9(9) | DISPLAY | ident of the last divider fetched; incremented before next fetch |- | <code>new-ident</code> | 03 | 9(9) | DISPLAY | old-ident + 1; used as key in SELECT to get next divider |- | <code>primes-ui</code> | 01 | (group) | — | COPY — see §4 |- | <code>primes-dal</code> | 01 | (group) | — | COPY — see §3 |} '''Linkage section:''' {| ! Name ! Source ! Description |- | <code>primes-session</code> | COPY primes-session | Passed in by primesmain |} ----- <span id="program-primes-dal-working-storage"></span> == 10. Program: primes (DAL) — Working Storage == {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>filler</code> | 01 | X(32) VALUE “Start WS primes” | DISPLAY | Debug WS marker |- | <code>DATASRC</code> | 01 | X(64) VALUE “pgsql://localhost:5432/primes&default_schema=primes” | DISPLAY | GixSQL connection string |- | <code>DBUSR</code> | 01 | X(64) VALUE “primes_user” | DISPLAY | Database user name |- | <code>DBPWD</code> | 01 | X(64) VALUE “pr1mes_user” | DISPLAY | Database password (plain-text) |- | <code>CUR-STEP</code> | 01 | X(16) | DISPLAY | Diagnostic: current SQL step (“CONNECT” / “DISCONNECT”) |- | <code>primes-row</code> | 01 | — | — | FETCH target for cursor |- | <code>r-ident</code> | 03 | 9(9) | COMP-3 | Fetched ident value |- | <code>r-prime</code> | 03 | 9(9) | COMP-3 | Fetched prime value |- | <code>prime-count</code> | 01 | 9(9) | DISPLAY | (Unused in current flow) |- | <code>prime_seq</code> | 01 | 9(9) | DISPLAY | (Unused in current flow) |- | <code>divider</code> | 01 | 9(9) | DISPLAY | (Unused in current flow) |- | <code>primes</code> | 01 | — | — | Local copy of sieve control (mirrors primes-dal; used for internal paragraphs) |- | <code>SQLCA</code> | 01 | — | — | COPY SQLCA — see §7 |- | <code>primes-table</code> | 01 | — | — | EXEC SQL INCLUDE primes-table — see §5 |- | <code>primes-ui</code> | 01 | — | — | COPY primes-ui — see §4 |} '''Linkage section:''' {| ! Name ! Source ! Description |- | <code>primes-dal</code> | COPY primes-dal | Passed in by primesgen |} ----- <span id="program-primesui-working-storage"></span> == 11. Program: primesui — Working Storage == {| !width="20%"| Name !width="20%"| Level !width="20%"| Picture !width="20%"| Usage !width="20%"| Description |- | <code>filler</code> | 01 | X(32) VALUE “start ws primesui” | DISPLAY | Debug WS marker |- | <code>primes-table</code> | 01 | — | — | 6-column print accumulator (OCCURS 6) |- | <code>primes-cel</code> | 03 | OCCURS 6 INDEXED primes-idx | — | One cell per prime entry on a print line |- | <code>t-ident</code> | 05 | Z(9) | DISPLAY | Sequence number, zero-suppressed |- | filler | 05 | X(2) | DISPLAY | Column separator spaces |- | <code>t-prime</code> | 05 | Z(9) | DISPLAY | Prime value, zero-suppressed |- | filler | 05 | X(2) | DISPLAY | Column separator spaces |- | <code>table-header</code> | 01 | — | — | Heading row (OCCURS 6) — “Sequence Prime” × 6 |- | <code>printer</code> | 01 | — | — | Print control group |- | <code>print-buffer</code> | 03 | X(132) | DISPLAY | Current line being built |- | <code>primes-prt-status</code> | 03 | X(2) | DISPLAY | File-status code for fprinter |- | <code>page-number</code> | 03 | 9(4) VALUE 1 | DISPLAY | Current page number |- | <code>print-new-page</code> | 03 | 9 VALUE 1 | DISPLAY | Flag: 1 = new page needed |- | — <code>new-page</code> | 88 | — | — | VALUE 1 |- | <code>primes-heading</code> | 01 | X(118) VALUE “primes overview” | DISPLAY | Page heading text |- | <code>primes-footing</code> | 01 | — | — | Page footing group |- | filler | 03 | X(118) VALUE SPACE | DISPLAY | Left padding |- | filler | 03 | X(6) VALUE “page:” | DISPLAY | Label |- | <code>f-page-number</code> | 03 | Z(3)9 VALUE 1 | DISPLAY | Formatted page number |- | <code>primes-line</code> | 01 | — | — | (Declared but not used in current flow) |- | <code>primes-total</code> | 01 | — | — | (Declared but not used in current flow) |- | <code>primes-count</code> | 03 | 9(8) | DISPLAY | (Declared but not used in current flow) |} '''Linkage section:''' {| ! Name ! Source ! Description |- | <code>primes-ui</code> | COPY primes-ui | Passed in by all callers |} ----- <span id="database-objects"></span> == 12. Database Objects == {| !width="20%"| Object !width="20%"| Type !width="20%"| Schema !width="20%"| Owner !width="20%"| Definition |- | <code>primes</code> | Schema | — | primes_user | Container schema |- | <code>asc_ident</code> | Sequence | primes | primes_user | INTEGER, START 1, INCREMENT 1 |- | <code>primes</code> | Table | primes | primes_user | See below |- | <code>primescursor</code> | Cursor | runtime | — | DECLARE … CURSOR FOR SELECT * FROM primes |} <span id="table-primes.primes"></span> === Table: primes.primes === {| !width="20%"| Column !width="20%"| Type !width="20%"| Nullable !width="20%"| Default !width="20%"| Description |- | <code>ident</code> | INTEGER | YES | nextval(‘primes.asc_ident’) | Auto-assigned insertion sequence |- | <code>prime</code> | INTEGER | YES | — | Prime number value |} <hr/> Terug naar: [[Primes_programs_specifications]] | [[Cobol and PostgreSQL]]
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