Skip to content

Instantly share code, notes, and snippets.

@dkelosky
Created December 17, 2018 15:31
Show Gist options
  • Save dkelosky/4b58205359c725b2e7f7247f6d66f7dc to your computer and use it in GitHub Desktop.
Save dkelosky/4b58205359c725b2e7f7247f6d66f7dc to your computer and use it in GitHub Desktop.
#! /bin/env node
import * as config from "config";
import { execSync } from "child_process";
interface DataSet {
blockSize: number;
directoryBlocks: number;
recordFormat: string;
recordLength: number;
dataSetType: string;
size: string;
}
interface DataSets {
[key: string]: DataSet;
}
const hlq: string = config.get<string>('profile.hlq');
const dataSets: DataSets = config.get<DataSets>('dataSets');
Object.keys(dataSets).forEach((key) => {
console.log(key)
console.log(dataSets[key])
const cmd = `zowe files create pds ` +
`"${hlq}.${key}" ` +
`--bs ${dataSets[key].blockSize} ` +
`--db ${dataSets[key].directoryBlocks} ` +
`--rf ${dataSets[key].recordFormat} ` +
`--rl ${dataSets[key].recordLength} ` +
`--dt ${dataSets[key].recordLength} ` +
`--sz ${dataSets[key].size}`;
console.log(cmd)
const resp = execSync(cmd).toString();
console.log(resp.toString())
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment