Editing
Primes
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!
The primes program is purely for demonstration purposes, it would be nonsensical to generate primes and retrieve the dividers from a database. The subprograms are in fact objects, containing methods and data. = Program structure = The program consists of a main program and three subprograms. The main program [[primesmain.cbl]] is invoked by the command 'primesmain report'. The subprograms implementing the objects and methods are: * primesui, providing the user interface as a print file * primesgen, manages the proces of primes generation and reporting, it does the prime determination too. * primes Only the primes program makes use of the PostgreSQL [[primes.sql]] database and so a good demonstration of three tier design. The database dump file is available for download here: [https://wiki.webhuis.nl/images/primes.sql primes.sql ]. == primesmain == The program source code file is available for download here: [https://wiki.webhuis.nl/images/primesmain.cbl primesmain.cbl ]. When executed primesmain puts out the file [[primes.prt]].<br /> The program only needs a cobol compile process, which is as follows: <pre> /usr/bin/cobc -x primesmain.cbl -T primesmain.out </pre> This results in the executable program file '''primesmain''' and the compilation listing [[primesmain.out]]. == primesgen == The primesgen program [[primesgen.cbl]] is the program responsible for all the logic involved in the primes system. The program source code file is available for download here: [https://wiki.webhuis.nl/images/primesgen.cbl primesgen.cbl ]. The program has to be compiled as a module or a subprogram, it cannot be executed directly.<br /> The program only needs a cobol compile process, which is as follows: <pre> /usr/bin/cobc -m primesgen.cbl -T primesgen.out </pre> This results in the program module file '''primesgen.so''' and the compilation listing [[primesgen.out]]. == primesui == The primes program [[primesui.cbl]] is the program responsible for all the user interactions. The program source code file is available for download here: [https://wiki.webhuis.nl/images/primesgen.cbl primesui.cbl ]. The program has to be compiled as a module or a subprogram, it cannot be executed directly.<br /> The program only needs a cobol compile process, which is as follows: <pre> /usr/bin/cobc -m primesui.cbl -T primesui.out </pre> This results in the program module file '''primesui.so''' and the compilation listing [[primesui.out]]. == primes == The primes program [[primes.cbl]] is the program responsible for all the database interactions. The program source code file is available for download here: [https://wiki.webhuis.nl/images/primesgen.cbl primes.cbl ]. The program has to be compiled as a module or a subprogram, it cannot be executed directly.<br /> The program needs a precompile process, which is as follows: <pre> /usr/bin/gixsql primes.cbl primes.cbsql -S -I . -e ".,*.cpy,*.CPY" </pre> This results in the cobol program file '''primes.cbsql''' [[primes.cbsql]].<br /> The next steps is the cobol compilation itself: <pre> /usr/bin/cobc -m primes.cbsql -l:libgixsql.so -T primes.out </pre> This results in the program module file '''primes.so''' and the compilation listing [[primes.out]]. <hr/> Back to: [[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