Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for crtsqlcppi and additional compile options #202

Merged
Merged
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
* Mon Mar 6 2023 Edmund Reinhardt <[email protected]> - 2.4.10
- Support CRTSQLCPPI and additional parameters for CMOD
- Support CVTCCSID and TGTCCSID for CCSID support of C and CPP
- Default record length for CRTFRMSTMF is now defaults 32000 except for MNU and PNLGRP
whose record length is automatically set to max of 268. Can be overridden via
parameter to CRTFRMSTMF or RCDLEN variable.
- CRTCMD PGM are now explicitly qualified to the specified OBJLIB
* Thu Feb 9 2023 Edmund Reinhardt <[email protected]> - 2.4.9
- Event file names for source compiled directly into programs was broken,
causing errors not to be shown in tooling such as Merlin
Expand Down
2 changes: 2 additions & 0 deletions src/makei/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"RPGLE": "MODULE",
"CLLE": "MODULE",
"SQLC": "MODULE",
"SQLCPP": "MODULE",
"SQLRPGLE": "MODULE",
"MODULE": "PGM",
"CBL": "PGM",
Expand Down Expand Up @@ -104,6 +105,7 @@
"RPGLE": "MODULE",
"CLLE": "MODULE",
"SQLC": "MODULE",
"SQLCPP": "MODULE",
"SQLRPGLE": "MODULE",
"MODULE": "PGM",
"CBL": "PGM",
Expand Down
19 changes: 15 additions & 4 deletions src/makei/crtfrmstmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ class CrtFrmStmf():
obj: str
lib: str
cmd: str
rcdlen: int
parameters: Optional[str]
env_settings: Dict[str, str]
ccsid_c: str
joblog_path: Optional[str]
back_up_obj_list: List[Tuple[str, str, str]] # List of (obj, lib, obj_type) tuples
obj_type: str

def __init__(self, srcstmf: str, obj: str, lib: str, cmd: str, tgt_ccsid: Optional[str] = None,
def __init__(self, srcstmf: str, obj: str, lib: str, cmd: str, rcdlen: int, tgt_ccsid: Optional[str] = None,
parameters: Optional[str] = None, env_settings: Optional[Dict[str, str]] = None,
joblog_path: Optional[str] = None, tmp_lib="QTEMP", tmp_src="QSOURCE") -> None:
# pylint: disable=too-many-arguments
Expand All @@ -55,6 +56,7 @@ def __init__(self, srcstmf: str, obj: str, lib: str, cmd: str, tgt_ccsid: Option
self.obj = obj
self.lib = lib
self.cmd = cmd
self.rcdlen = rcdlen
self.parameters = parameters
self.env_settings = env_settings if env_settings is not None else {}
self.joblog_path = joblog_path
Expand Down Expand Up @@ -94,7 +96,7 @@ def run(self):
self.job.run_cl(f'DLTF FILE({self.tmp_lib}/{self.tmp_src})', True)
# Create the temp source file
self.job.run_cl(
f'CRTSRCPF FILE({self.tmp_lib}/{self.tmp_src}) RCDLEN(198) MBR({self.obj}) CCSID({self.ccsid_c})')
f'CRTSRCPF FILE({self.tmp_lib}/{self.tmp_src}) RCDLEN({self.rcdlen}) MBR({self.obj}) CCSID({self.ccsid_c})')
# Copy the source stream file to the temp source file
self.job.run_cl(
f'CPYFRMSTMF FROMSTMF("{self.srcstmf}") '
Expand Down Expand Up @@ -262,6 +264,15 @@ def cli():

)

parser.add_argument(
"-r",
'--rcdlen',
help='Specifies the record length for the temporary source physical file.',
metavar='<rcdlen>',
default=32000

)

parser.add_argument(
"-p",
'--parameters',
Expand Down Expand Up @@ -294,8 +305,8 @@ def cli():
env_settings["IBMiEnvCmd"] = os.environ["IBMiEnvCmd"]

handle = CrtFrmStmf(srcstmf_absolute_path, args.object.strip(),
args.library.strip(), args.command.strip(), args.ccsid, args.parameters, env_settings,
args.save_joblog)
args.library.strip(), args.command.strip(), args.rcdlen, args.ccsid, args.parameters,
env_settings, args.save_joblog)

print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
success = handle.run()
Expand Down
Loading