ibm midrange - Parameter OBJ is cut off in call to GRTOBJAUT from CL program -


i have made cl program simplify changing owner, usrprf , permissions object. utilizes grtobjaut among others changes. here's parameter definitions:

         pgm        parm(&libobj &type &owner &usrprfown &user1 &auth1 +                       &user2 &auth2 &user3 &auth3)          ...          dcl        var(&libobj) type(*char) len(21)          dcl        var(&type) type(*char) len(10)          dcl        var(&user1) type(*char) len(10)          dcl        var(&auth1) type(*char) len(10)          ... 

this how call grtobjaut:

         grtobjaut  obj(&libobj) objtype(*all) user(&user1) +                          aut(&auth1) 

however, first 10 characters of &libobj passed grtobjaut. have verified in debugger passing instance mylib/test1234 results in grtobjaut obj('mylib/test'), despite &libobj containing full string. according documentation should proper syntax grtobjaut command, allowing more 10 characters long paths. not case? there difference between interactive grtobjaut , cl grtobjaut? how make work?

the program compiled v6.1 , run in v7.1 capable environment.

edit: same problem applies chgobjown.

you can't pass both library , object name in single parameter. grtobjaut obj() parameter has 2 parts, not one. define 1 part, , declare it's 21 characters long. isn't. it's 2 parts, , each part ten characters long.

in general, should change cl in way:

 pgm        parm(&lib &obj &type &owner &usrprfown &user1 &auth1 +               &user2 &auth2 &user3 &auth3)  ...  dcl        var(&lib) type(*char) len(10)  dcl        var(&obj) type(*char) len(10) 

the library , object names passed in separate 10-character names. grtobjaut command this:

 grtobjaut  obj(&lib/&obj) objtype(*all) user(&user1) +                  aut(&auth1) 

note obj() parameter specifies 2 parts separately.

you can leave 21-character cl parm in place if wish. however, if do, have add code cl parse parm value , extract library , object names before passing them grtobjaut. simpler pass them cl separately.

once have them separated, you'll need sure &lib isn't blank when grtobjaut receives it. if comes cl blank value, you'll need assign special value such '*libl', '*curlib' or whatever appropriate grtobjaut can process it.

there alternatives, should learn requirement before trying trying things 'tricks'.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -