This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { execSync } from 'child_process'; | |
import { writeFileSync } from 'fs'; | |
import { readFileSync } from 'fs'; | |
const KEY_FILE = '.scripts/key.txt'; | |
const CMD_FILE = '.scripts/cmds.txt'; | |
const MAX_FAIL = 5; | |
const WAIT_TIME = 1000 * 60 * 5; // 5 minutes (in milliseconds) - milliseconds * seconds * minutes | |
function start() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* REXX */ | |
/* obtain system info from OPS */ | |
sysname = OPSINFO("SYSNAME") | |
opsversion = OPSINFO("VERSION") | |
oslevel = OPSINFO("MVSVERSION") | |
osfnum = "" | |
rc = opsprm("show", "osfmin") | |
do while queued() > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* REXX */ | |
cmd = "curl -k https://jsonplaceholder.typicode.com/posts/1 2>/dev/null" | |
address uss | |
"USSCMD COMMAND('"cmd"') STEM(RESPONSE)" | |
if RESPONSE.0 > 0 then do | |
do i = 1 to RESPONSE.0 | |
say " " RESPONSE.i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import handlebars from "handlebars"; | |
import { existsSync, readFileSync, writeFileSync } from "fs"; | |
import config from "config"; | |
import { basename } from "path"; | |
if (process.argv.length < 3) console.log(`usage \`${basename(process.argv[1])} <template-file>\``),process.exit(1) | |
const templateFile = process.argv[2]; | |
const templateFilePath = `templates/${templateFile}`; | |
const outputFilePath = `out/${templateFile}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//{{jobname}} JOB IZUACCT,'JCLREXX',CLASS=A,MSGCLASS=A | |
/*JOBPARM SYSAFF=* | |
//TSO EXEC PGM=IKJEFT01 | |
//SYSTSPRT DD SYSOUT=* | |
//SYSTSIN DD * | |
{{interpreter}} PROG('{{program}}') - | |
{{arg}} | |
/* | |
//OPS${{subsys}} DD DUMMY | |
{{dd}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
say opsinfo("ipldate") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { zowe } from "./zowe.mjs"; | |
import { basename } from "path"; | |
const prefix = process.argv[2]; | |
if (!prefix) { console.log(`Job prefix is missing, usage is 'node ${basename(process.argv[1])} <job-prefix>'`); process.exit(1); } | |
const resp = zowe(`jobs list jobs --prefix ${prefix}`, {json: true, silent: true}); | |
const jsonResp = JSON.parse(resp); | |
jsonResp.data.forEach(job => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { zowe } from "./zowe.mjs"; | |
const resp = zowe("jobs list jobs --rff jobid jobname status", { silent: true}); | |
const rows = resp.split(/\r?\n/); | |
rows.forEach((rows) => { | |
const cols = rows.split(/\s+/); | |
console.log(`jobid: ${cols[0]} jobname: ${cols[1]} status: ${cols[2]}`); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { zowe } from "./zowe.mjs"; | |
const resp = zowe("jobs list jobs", {json: true, silent: true}); | |
const jsonResp = JSON.parse(resp); | |
jsonResp.data.forEach(job => { | |
console.log(`${job.jobid} ${job.jobname} ${job.status}`); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { execSync } from 'child_process'; | |
export function zowe(cmd, options) { | |
// build command | |
cmd = `zowe ${cmd}`; | |
if (options?.json) cmd += ` --rfj`; | |
// run it | |
try { |
NewerOlder