Editing
Data-Dictionary
(section)
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!
== 1. Control Blocks β Copybooks == <span id="primes-session"></span> === 1.1 primes-session === <blockquote>'''Source file:''' <code>primes-session.cpy</code><br /> '''Included by:''' <code>primesmain.cbl</code> (WORKING-STORAGE) Β· <code>primesgen.cbl</code> (LINKAGE SECTION)<br /> '''Purpose:''' Session-tier control block. primesmain sets <code>methods</code>; primesgen reads it and sets <code>session-result</code>. </blockquote> {| !width="16%"| Level !width="16%"| Name !width="16%"| PIC !width="16%"| Usage !width="16%"| Initial !width="16%"| Description |- | 01 | <code>primes-session</code> | β | β | β | Root of session control block |- | 03 | <code>methods</code> | <code>X(32)</code> | DISPLAY | β | Method dispatch verb β set by primesmain before calling primesgen |- | 88 | <code>report-primes</code> | β | β | <code>"report"</code> | Run the cursor report path |- | 88 | <code>generate-primes</code> | β | β | <code>"generate"</code> | Run the sieve generation path |- | 88 | <code>start-primes</code> | β | β | <code>"start"</code> | Reserved β not used in current flow |- | 88 | <code>stop-primes</code> | β | β | <code>"stop"</code> | Reserved β not used in current flow |- | 88 | <code>invalid-method</code> | β | β | <code>"bad"</code> | Sentinel for unrecognised verb |- | 03 | <code>session-result</code> | <code>9(2)</code> | DISPLAY | 0 | Outcome code written by primesgen |- | 88 | <code>session-method-ok</code> | β | β | 0 | Operation succeeded |- | 88 | <code>session-method-nok</code> | β | β | 1 | Operation failed |- | 88 | <code>session-method-eof</code> | β | β | 9 | End of data (cursor exhausted) |} <blockquote>β οΈ <code>session-method-eof</code> (value 9) is never explicitly set in the current code. Fetch failure sets <code>session-result = 1</code> (nok), not 9. See [[Technical-Specification#7-known-technical-issues|Technical Specification β Defect T7]]. </blockquote> ----- <span id="primes-dal"></span> === 1.2 primes-dal === <blockquote>'''Source file:''' <code>primes-dal.cpy</code><br /> '''Included by:''' <code>primesgen.cbl</code> (WORKING-STORAGE, caller) Β· <code>primes.cbl</code> (LINKAGE SECTION, callee)<br /> '''Purpose:''' DAL-tier control block. primesgen sets <code>dal-methods</code> and reads back <code>dal-result</code> and <code>primes-data</code>. </blockquote> {| !width="16%"| Level !width="16%"| Name !width="16%"| PIC !width="16%"| Usage !width="16%"| Initial !width="16%"| Description |- | 01 | <code>primes-dal</code> | β | β | β | Root of DAL control block |- | 03 | <code>dal-methods</code> | <code>X(32)</code> | DISPLAY | β | Method dispatch verb |- | 88 | <code>next-prime</code> | β | β | <code>"next-prime"</code> | Fetch next row from open cursor |- | 88 | <code>next-divider</code> | β | β | <code>"next-divider"</code> | SELECT a prime by ident for use as trial divisor |- | 88 | <code>write-prime</code> | β | β | <code>"write"</code> | INSERT a confirmed prime into the table |- | 88 | <code>db-cursor</code> | β | β | <code>"cursor"</code> | START TRANSACTION and OPEN primescursor |- | 88 | <code>db-connect</code> | β | β | <code>"connect"</code> | Establish the PostgreSQL connection |- | 88 | <code>db-disconnect</code> | β | β | <code>"disconnect"</code> | Release the connection |- | 88 | <code>invalid-method</code> | β | β | <code>"bad"</code> | Sentinel for unrecognised verb |- | 03 | <code>primes-data</code> | β | β | β | Single-row data payload (one prime) |- | 05 | <code>primes-sequence</code> | <code>9(9)</code> | DISPLAY | β | Row identity (<code>ident</code>) of the fetched prime |- | 05 | <code>prime-number</code> | <code>9(9)</code> | DISPLAY | β | The prime value itself |- | 03 | <code>dal-result</code> | <code>9(2)</code> | DISPLAY | 0 | Outcome code written by primes |- | 88 | <code>dal-method-ok</code> | β | β | 0 | Operation succeeded |- | 88 | <code>dal-method-nok</code> | β | β | 1 | Operation failed |- | 88 | <code>dal-method-eof</code> | β | β | 99 | Cursor exhausted (no more rows) |} ----- <span id="primes-ui"></span> === 1.3 primes-ui === <blockquote>'''Source file:''' <code>primes-ui.cpy</code><br /> '''Included by:''' all four programs<br /> '''Purpose:''' UI-tier control block. Any program sets <code>ui-methods</code> and <code>process-message</code> / <code>u-primes</code>, then calls primesui; primesui sets <code>ui-method-result</code>. </blockquote> {| !width="16%"| Level !width="16%"| Name !width="16%"| PIC !width="16%"| Usage !width="16%"| Initial !width="16%"| Description |- | 01 | <code>primes-ui</code> | β | β | β | Root of UI control block |- | 03 | <code>ui-methods</code> | <code>X(32)</code> | DISPLAY | β | Method dispatch verb |- | 88 | <code>write-ui</code> | β | β | <code>"write"</code> | Add one prime row to the print buffer |- | 88 | <code>message-ui</code> | β | β | <code>"log-message"</code> | Write <code>process-message</code> to the console |- | 88 | <code>start-ui</code> | β | β | <code>"start"</code> | Open <code>primes.prt</code> |- | 88 | <code>stop-ui</code> | β | β | <code>"stop"</code> | Flush print buffer and close file |- | 03 | <code>process-message</code> | β | β | β | Structured 132-char console log record |- | 05 | <code>program-name</code> | <code>X(20)</code> | DISPLAY | β | Name of the calling program |- | 05 | <code>program-line</code> | β | β | β | Location within the calling program |- | 07 | <code>program-paragraph</code> | <code>X(20)</code> | DISPLAY | β | Name of the calling paragraph |- | 07 | <code>program-message</code> | <code>X(92)</code> | DISPLAY | β | Human-readable status or error text |- | 03 | <code>u-primes</code> | β | β | β | One prime row for the print writer |- | 05 | <code>u-sequence</code> | <code>9(9)</code> | DISPLAY | β | Sequence number (ident) to write to print buffer |- | 05 | <code>u-number</code> | <code>9(9)</code> | DISPLAY | β | Prime value to write to print buffer |- | 03 | <code>ui-method-result</code> | <code>9(2)</code> | DISPLAY | 0 | Outcome code written by primesui |- | 88 | <code>ui-method-ok</code> | β | β | 0 | Operation succeeded |- | 88 | <code>ui-method-nok</code> | β | β | 1 | Operation failed |} '''Console message layout''' (132 characters, left-to-right): <pre>ββββββββββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β program-name (20) β program-paragraph(20)β program-message (92) β ββββββββββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ</pre> ----- <span id="primes-table-sql-host-variable-character"></span> === 1.4 primes-table β SQL Host Variable (character) === <blockquote>'''Source file:''' <code>primes-table.cpy</code><br /> '''Included by:''' <code>primes.cbl</code> via <code>EXEC SQL INCLUDE primes-table END-EXEC</code><br /> '''Purpose:''' Host variable layout for GixSQL to bind the <code>primes.primes</code> table columns. </blockquote> {| !width="20%"| Level !width="20%"| Name !width="20%"| PIC !width="20%"| Usage !width="20%"| Description |- | 01 | <code>primes-table</code> | β | β | Host variable group (character format) |- | 03 | <code>ident</code> | <code>S9(9)</code> | DISPLAY | Maps to <code>primes.ident</code>; signed for SQL compatibility |- | 03 | <code>prime</code> | <code>S9(9)</code> | DISPLAY | Maps to <code>primes.prime</code>; signed for SQL compatibility |} ----- <span id="primes_table-sql-host-variable-packed"></span> === 1.5 primes_table β SQL Host Variable (packed) === <blockquote>'''Source file:''' <code>primes_table.cpy</code><br /> '''Included by:''' <code>primes.cbl</code> (alternative layout)<br /> '''Purpose:''' COMP-3 variant of <code>primes-table</code>. The underscore in both the filename and root name is a deviation from the projectβs hyphen convention. </blockquote> {| ! Level ! Name ! PIC ! Usage ! Description |- | 01 | <code>primes_table</code> | β | β | Host variable group (COMP-3 format) |- | 03 | <code>ident</code> | <code>S9(9)</code> | COMP-3 | Row identity β packed decimal |- | 03 | <code>prime</code> | <code>S9(9)</code> | COMP-3 | Prime value β packed decimal |} <blockquote>β οΈ Two nearly identical copybooks exist. <code>primes-table.cpy</code> (hyphens, DISPLAY) is used by the cursor FETCH target (<code>primes-row</code>). The canonical version should be designated and the other retired. See [[Technical-Specification#7-known-technical-issues|Technical Specification β Defect T6]]. </blockquote> ----- <span id="sqlca-sql-communications-area"></span> === 1.6 SQLCA β SQL Communications Area === <blockquote>'''Source file:''' <code>SQLCA.cpy</code><br /> '''Included by:''' <code>primes.cbl</code> via <code>EXEC SQL INCLUDE SQLCA END-EXEC</code><br /> '''Purpose:''' Standard GixSQL communications area. Updated after every SQL statement. </blockquote> {| !width="20%"| Level !width="20%"| Name !width="20%"| PIC !width="20%"| Usage !width="20%"| Description |- | 01 | <code>SQLCA</code> | β | β | SQL communications area |- | 05 | <code>SQLCAID</code> | <code>X(8)</code> | DISPLAY | SQLCA identifier string |- | 05 | <code>SQLCABC</code> | <code>S9(9)</code> | COMP-5 | Byte length of SQLCA structure |- | 05 | <code>SQLCODE</code> | <code>S9(9)</code> | COMP-5 | '''SQL return code:''' 0=success Β· negative=error Β· +100=not found |- | 05 | <code>SQLERRM</code> | β | β | Error message group |- | 49 | <code>SQLERRML</code> | <code>S9(4)</code> | COMP-5 | Length of error message text |- | 49 | <code>SQLERRMC</code> | <code>X(70)</code> | DISPLAY | Error message text from the database engine |- | 05 | <code>SQLERRP</code> | <code>X(8)</code> | DISPLAY | Error procedure name (not used in this application) |- | 05 | <code>SQLERRD</code> | <code>S9(9)</code> OCCURS 6 | COMP-5 | Diagnostic array; <code>SQLERRD(3)</code> = number of rows processed |- | 05 | <code>SQLWARN</code> | β | β | Warning flags group (not used in this application) |- | 05 | <code>SQLSTATE</code> | <code>X(5)</code> | DISPLAY | ISO/ANSI SQL state code (5-char string) |} '''SQLCODE reference (PostgreSQL / GixSQL):''' {| ! Value ! Meaning |- | 0 | Statement succeeded |- | +100 | No rows found (SELECT returned empty, cursor exhausted) |- | negative | Database error β see <code>SQLERRMC</code> for description |} ----- <span id="working-storage-variables"></span>
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