Editing
Gixc.py
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!
Put the script in PATH, e.g. /usr/local/bin. <pre> #!/usr/bin/env python3 #''' #Simple Python script for the gixsql gnucobol compilation workflow. #The script accepts program names in the style: # "program_name"."cbl" or "program_name"."cob" #The program_name has not dots in it. # #The programs gixsql and cobc can also be executed manually, if specific parameters are required. #''' import sys import re from subprocess import Popen, PIPE if len(sys.argv) == 1: print ('Enter program name with suffix .cbl or .cob') sys.exit(1) program_name = sys.argv[1] program_list = program_name.split('.') if len(program_list) == 2: if program_list[1] in ['cbl','cob']: pass else: print('Program name has to be one word, a comma and a suffix ".cbl" or ".cob".') sys.exit(3) else: print('Program name has to be one word, a comma and a suffix ".cbl" or ".cob".') sys.exit(2) program = program_list[0] command = '/usr/bin/gixsql {} {}.cbsql -S -I. -e ".,*.cpy,*.CPY"'.format(program_name, program) print(command) try: process = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) stdout, stderr = process.communicate() except Exception: print("Error in gix precompile") sys.exit(4) command = '/usr/bin/cobc -x {0}.cbsql -l:libgixsql.so -T {0}.out'.format(program) print(command) try: process = Popen(command, shell=True, stdout=PIPE, stderr=PIPE) stdout, stderr = process.communicate() except Exception: print("Error in cobc compile") sys.exit(5) </pre> <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