Skip to content

could not access VSAM dataset with only read permission #7

@tangthth

Description

@tangthth

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions