Editing
Primes Software Specification
(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!
== 3. Data Dictionary == <span id="working-storage-fields"></span> === 3.1 Working Storage Fields === {| !width="25%"| Field !width="25%"| PIC !width="25%"| COBOL Type !width="25%"| Description |- | <code>DATASRC</code> | <code>X(64)</code> | Alphanumeric | PostgreSQL connection string |- | <code>DBUSR</code> | <code>X(64)</code> | Alphanumeric | Database login username |- | <code>DBPWD</code> | <code>X(64)</code> | Alphanumeric | Database login password |- | <code>CUR-STEP</code> | <code>X(16)</code> | Alphanumeric | Current processing step label |- | <code>prime-count</code> | <code>9(9)</code> | Numeric | Count of primes (declared; populated by driver) |- | <code>prime_seq</code> | <code>9(9)</code> | Numeric | Prime sequence number (declared; populated by driver) |- | <code>divider</code> | <code>9(9)</code> | Numeric | Trial divider working field |} <span id="group-primes-row-database-fetch-buffer"></span> === 3.2 Group: <code>primes-row</code> β Database Fetch Buffer === {| !width="25%"| Field !width="25%"| PIC !width="25%"| COBOL Type !width="25%"| Description |- | <code>r-ident</code> | <code>9(9) COMP-3</code> | Packed decimal | Row identity key fetched from cursor |- | <code>r-prime</code> | <code>9(9) COMP-3</code> | Packed decimal | Prime value fetched from cursor |} <span id="group-primes-primality-test-working-storage"></span> === 3.3 Group: <code>primes</code> β Primality Test Working Storage === {| !width="33%"| Field !width="33%"| PIC / Value !width="33%"| Description |- | <code>primes-result</code> | <code>9(2)</code> | Status code: <code>1</code>=init ok Β· <code>2</code>=first divider ok Β· <code>3</code>=next divider ok |- | <code>88 init-primes-ok</code> | value <code>1</code> | Condition name: initialisation succeeded |- | <code>88 first-divider-ok</code> | value <code>2</code> | Condition name: first trial divisor retrieved |- | <code>88 next-divider-ok</code> | value <code>3</code> | Condition name: subsequent trial divisor retrieved |- | <code>test-number</code> | <code>9(9)</code> | Candidate number under primality test |- | <code>test-number-sqr</code> | <code>9(9)v9(9)</code> | Square root of <code>test-number</code> β upper bound for divisor loop |- | <code>test-divider</code> | <code>9(9)</code> | Current prime divisor retrieved from DB |- | <code>test-rest</code> | <code>9(9)v9(9)</code> | Remainder of <code>test-number Γ· test-divider</code> |- | <code>old-test-number</code> | <code>9(9)</code> | Previous candidate number |- | <code>old-ident</code> | <code>9(9)</code> | Row identity of the last retrieved divisor |- | <code>new-ident</code> | <code>9(9)</code> | Row identity of the next divisor (<code>old-ident + 1</code>) |} <span id="copybook-references"></span> === 3.4 Copybook References === {| !width="50%"| Copybook !width="50%"| Contents |- | <code>primes-table</code> | COBOL record layout mirroring the <code>primes</code> DB table |- | <code>SQLCA</code> | Standard SQL Communication Area (<code>SQLCODE</code>, <code>SQLERRM</code>, etc.) |- | <code>primes-ui</code> | Data structure for <code>primesui</code> subprogram (messages, program name, methods) |- | <code>primes-dal</code> | DAL linkage interface β method flags and <code>dal-result</code> return code |} <span id="prepared-sql-statements"></span> === 3.5 Prepared SQL Statements === {| !width="33%"| Ref !width="33%"| SQL Text !width="33%"| Used in |- | <code>SQ0001</code> | <code>SELECT * FROM primes</code> | Cursor declaration (s01-cursor) |- | <code>SQ0002</code> | <code>SELECT prime FROM primes WHERE ident = $1</code> | r81-get-next-divider |- | <code>SQ0003</code> | <code>INSERT INTO primes (prime) VALUES ($1)</code> | r83-write-prime |- | <code>SQ0004</code> | <code>INSERT INTO primes (prime) VALUES (2)</code> | r90-generate-primes (seed) |- | <code>SQ0005</code> | <code>START TRANSACTION</code> | s01-cursor |} <span id="database-table-primes.primes"></span> === 3.6 Database Table: <code>primes.primes</code> === {| !width="33%"| Column !width="33%"| Type !width="33%"| Description |- | <code>ident</code> | INTEGER (serial / sequence) | Auto-generated row identity / primary key |- | <code>prime</code> | INTEGER | The prime number value stored in this row |} ----- <span id="flow-diagrams"></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