submit batch job fix

This commit is contained in:
Gregory Gauthier 2026-02-06 16:45:57 +00:00
parent bb6c652463
commit 359120f31b

View File

@ -91,16 +91,25 @@ def submit_jcl(job, mvshost="oldcomputernerd.com"):
print(f"JCL file {subjcl} not found")
return 1
subcmd = f"nc -w 5 {mvshost} {RDRPORT} < {subjcl}"
try:
result = subprocess.run(subcmd, shell=True, check=True, capture_output=True)
# Read the JCL file and send via netcat (same approach as upload_source)
with open(subjcl, 'rb') as f:
result = subprocess.run(
['nc', '-w', '5', mvshost, str(RDRPORT)],
input=f.read(),
check=True,
capture_output=True
)
print(f"Submitted JCL job: {job}")
if result.stdout:
print("JES response:", result.stdout.decode(errors='ignore').strip())
return 0
except subprocess.CalledProcessError as e:
print(f"JCL submission failed: {e}")
print("stderr:", e.stderr.decode(errors='ignore'))
return 1
except FileNotFoundError as e:
print(f"Error reading JCL file: {e}")
return 1
if __name__ == "__main__":