Created
December 17, 2018 15:31
-
-
Save dkelosky/4b58205359c725b2e7f7247f6d66f7dc to your computer and use it in GitHub Desktop.
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
#! /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