Skip to content

Extract DSN (Dataset Name) from JCL (Job Control Language)

Notifications You must be signed in to change notification settings

jonathangersam/dsn-from-jcl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSN From JCL

Extract DSN Dataset Name from JCL Job Control Language

v1.1.0

Build Status GitHub license

Usage

Want to use in your codebase? Import via 'require'

const dsn = require('dsn-from-jcl')
const sample = '//INFILE DD DSN=TZSP.MY.FILE,DISP=SHR' // lines of valid JCL, separated by newline characters

const result = dsn.extractFromString(sample, 'TZSP')
console.log(result) // expect [ 'TZSP.MY.FILE' ]

Want to run in interactive mode? Run npm start or node script.js.

*** EXTRACT DSN FROM JCL, INTERACTIVE MODE ***
1) your input file path? > ./spec/input.txt
2) your output path?> myoutput.txt
3) 1st DSN qualifier to search for? > TZSP
RESULT:
 [ 'TZSP.SOME.FILE', null, 'TZSP.EXTRA.FILE.HERE' ]

Docs

extractFromString(text, qualifier, opt)

  • Returns an array containing valid DSNs that begin with the given qualifier for each line in the given text.

extractFromFile(filepath, qualifier, opt)

  • Behaves similarly to extractFromString, but reads data from the given file on disk.

Build

No build dependencies.

Test

  1. Install test dependencies via npm install
  2. Run unit test suite via npm test

About

Coded with <3 by Jonathan Lopez

About

Extract DSN (Dataset Name) from JCL (Job Control Language)

Resources

Stars

Watchers

Forks

Packages

No packages published