Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not access VSAM dataset with only read permission #7

Open
tangthth opened this issue Aug 24, 2018 · 1 comment
Open

could not access VSAM dataset with only read permission #7

tangthth opened this issue Aug 24, 2018 · 1 comment

Comments

@tangthth
Copy link

tangthth commented Aug 24, 2018

Issue Description:

For VSAM data sets with only read permission but without write permission:

  • vsam.exist() returns false
  • vsam.openSync() could not open the data set and reports error message "TypeError: Invalid dataset name"

Reproduce Steps:

  1. as USRB, prepare a vsam data set, and permit USRA with only read access
    <=== on z/OS, when USERA edits the data set, it will reports:
    File Manager command in error:
    +++ File Manager DSE 'USRB.NODEJSD.VSAMDS01'
    ssssssssssssssssssss
    No access authority
  2. as USRA, write nodejs script 1 to judge if the vsam data set exists or not, execute script 1
  3. as USRA, write nodejs script 2 to open the vsam data set, execute script 2

Logs:

For Step 2:
/u/usra/myscripts:>node test_vsam.js
/u/usra/workdir/nodejs/nodejs.test.vsam_1.0.0/scripts/test_vsam.j
s:28
vsamObj = vsam.allocSync(dsname, JSON.parse(fs.readFileSync('schema.jso
')))
¬
TypeError: Invalid dataset format
at TypeError (native)
at vsamOpen (/u/usra/workdir/nodejs/nodejs.test.vsam_1.0.0/s
ripts/test_vsam.js:28:17)
at Object. (/u/usra/workdir/nodejs/nodejs.test.vs
m_1.0.0/scripts/test_vsam.js:324:1)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)

For step 3:
/u/usra/myscripts:>node test_vsam.js
/u/usra/workdir/nodejs/nodejs.test.vsam_1.0.0/scripts/test_vsam.j
s:325
vsamObj = vsam.openSync(dsname, JSON.parse(fs.readFileSync('schema.json')))
¬
TypeError: Invalid dataset name
at TypeError (native)
at Object. (/u/usra/workdir/nodejs/nodejs.test.vsa
m_1.0.0/scripts/test_vsam.js:325:16)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)

Reference:

Script 1:

if (vsam.exist(dsname)) {
	vsamObj = vsam.openSync(dsname, JSON.parse(fs.readFileSync('schema.json')))
	console.log("Open the vsam dataset: " + dsname)
}
else {
	vsamObj = vsam.allocSync(dsname, JSON.parse(fs.readFileSync('schema.json')))
	console.log("New vsam dataset allocated: " + dsname)
}

Script 2:

	vsamObj = vsam.openSync(dsname, JSON.parse(fs.readFileSync('schema.json')))
	console.log("Open the vsam dataset: " + dsname)
@mkhouse8
Copy link

I'm curious to know if read-only is possible as well. We have many VSAM files loaded in CICS regions that can not be accessed for I/O, but it is possible to access the file in a read-only mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants