× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I've been working on a RPG program that will facilitate the maintenance
of users and user profiles for our application. With "God" privileges
on the system, of course, tests under my profile work flawlessly.
However, when testing under a profile that is less than deity, I'm
experiencing some errors that I thought I could overcome in the compile
directives.

In true ILE fashion, I created some CL programs to accomplish the user
profile tasks at hand, and prototyped all of the calls. No problem
there. I also have no issue with the calls that create user profiles
failing if the user does not have *SECADM privileges and I can use the
FIXPWD command to reset user profiles if the user has the perceived
privilege, but certain commands should be available regardless. What is
the harm in retrieving user values if they can't be changed? :-)

So, to my question... What do I need to do to enable users to retrieve
user profile values for display within the program? I've compiled both
the CL and the RPG programs with owner authority. Should I temporarily
change the user's access in the CL program to be able to retrieve the
user profile information for display? If so, what are the appropriate
commands on entry and exit to accomplish the task without permanently
changing authority for the session/user?

CL Source (RPG guys, don't hose me) :-):
DCL &MSGF *CHAR 10
DCL &MSGFLIB *CHAR 10
DCL &ERRORSW *LGL
GETUSER: RTVUSRPRF USRPRF(&USERID) RTNUSRPRF(&RTNUSRPRF) +
SPCAUT(&SPCAUT) MAXSTG(&MAXSTG) +
STGUSED(&STGUSED) PTYLMT(&PTYLMT) +
INLPGM(&INLPGM) INLPGMLIB(&INLPGMLIB) +
JOBD(&JOBD) JOBDLIB(&JOBDLIB) +
GRPPRF(&GRPPRF) OWNER(&OWNER) +
GRPAUT(&GRPAUT) ACGCDE(&ACGCDE) +
MSGQ(&MSGQ) MSGQLIB(&MSGQLIB) OUTQ(&OUTQ) +
OUTQLIB(&OUTQLIB) TEXT(&TEXT) +
PWDCHGDAT(&PWDCHGDAT) USRCLS(&USRCLS) +
ASTLVL(&ASTLVL) SPCENV(&SPCENV) +
CURLIB(&CURLIB) INLMNU(&INLMNU) +
INLMNULIB(&INLMNULIB) LMTCPB(&LMTCPB) +
DLVRY(&DLVRY) SEV(&SEV) PRTDEV(&PRTDEV) +
ATNPGM(&ATNPGM) ATNPGMLIB(&ATNPGMLIB) +
USROPT(&USROPT) DSPSGNINF(&DSPSGNINF) +
PWDEXPITV(&PWDEXPITV) PWDEXP(&PWDEXP) +
STATUS(&STATUS) PRVSIGN(&PRVSIGN) +
NOTVLDSIGN(&NOTVLDSIGN) +
LMTDEVSSN(&LMTDEVSSN) KBDBUF(&KBDBUF) +
LANGID(&LANGID) CNTRYID(&CNTRYID) +
CCSID(&CCSID) SRTSEQ(&SRTSEQ) +
SRTSEQLIB(&SRTSEQLIB) OBJAUD(&OBJAUD) +
AUDLVL(&AUDLVL) GRPAUTTYP(&GRPAUTTYP) +
SUPGRPPRF(&SUPGRPPRF) UID(&UID) GID(&GID) +
SETJOBATR(&SETJOBATR) CHRIDCTL(&CHRIDCTL) +
LCLPWDMGT(&LCLPWDMGT)
/* MONITOR FOR ERROR MESSAGES */
MONMSG MSGID(CPF0000) EXEC(GOTO ERROR)
CHGVAR VAR(&ERRORIND) VALUE('0')
GOTO CMDLBL(ENDPRG)
/* STANDARD ERROR HANDLER */
ERROR:
CHGVAR VAR(&ERRORIND) VALUE('1')
IF COND(&ERRORSW) THEN(SNDPGMMSG MSGID(CPF9999) +
MSGF(QCPFMSG) MSGTYPE(*ESCAPE)) /* +
FUNCTION CHECK MESSAGE */
CHGVAR VAR(&ERRORSW) VALUE('1')
ERROR2: RCVMSG MSGTYPE(*DIAG) MSGDTA(&MSGDTA) MSGID(&MSGID) +
MSGF(&MSGF) MSGFLIB(&MSGFLIB)
IF COND(&MSGID = ' ') THEN(GOTO +
CMDLBL(ERROR3))
SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +
MSGDTA(&MSGDTA) MSGTYPE(*DIAG)
GOTO CMDLBL(ERROR2)
ERROR3: RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) +
MSGF(&MSGF) MSGFLIB(&MSGFLIB)
SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +
MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE)
ERR_RTN: DMPCLPGM
ENDPRG: RETURN
ENDPGM

RPG Prototypes:
// User profile data structures for multi-values
d ds_SPCAUT ds
d val_SPCAUT 10A dim(10) inz('')
d ds_USROPT ds qualified
d val_USROPT 10A dim(24) inz('')
d ds_AUDLVL ds qualified
d val_AUDLVL 10A dim(64) inz('')
d ds_SUPGRPPRF ds qualified
d val_SUPGRPPRF 10A dim(15) inz('')
d ds_SETJOBATR ds qualified
d val_SETJOBATR 10A dim(16) inz('')

d ds_user_prof ds qualified
d USERID 10A inz('')
d RTNUSER 10A inz('')
d PASSWORD 10A inz('*USRPRF')
d SPCAUT likeds(ds_SPCAUT)
d MAXSTG 11p 0 inz(0)
d STGUSED 15p 0 inz(0)
d PTYLMT 1A inz('3')
d INLPGM 10A inz('*NONE')
d INLPGMLIB 10A inz('*LIBL')
d JOBD 10A inz('QDFTJOBD')
d JOBDLIB 10A inz('QGPL')
d GRPPRF 10A inz('mygrp')
d OWNER 10A inz('*USRPRF')
d GRPAUT 10A inz('*NONE')
d ACGCDE 15A inz('*BLANK')
d MSGQ 10A inz('*USRPRF')
d MSGQLIB 10A inz('*LIBL')
d OUTQ 10A inz('*WRKSTN')
d OUTQLIB 10A inz('*LIBL')
d TEXT 50A inz('')
d PWDCHGDAT 6A inz('')
d USRCLS 10A inz('*USER')
d ASTLVL 10A inz('*SYSVAL')
d SPCENV 10A inz('*NONE')
d CURLIB 10A inz('mylib')
d INLMNU 10A inz('*SIGNOFF')
d INLMNULIB 10A inz('*LIBL')
d LMTCPB 10A inz('*YES')
d DLVRY 10A inz('*NOTIFY')
d SEV 2p 0 inz(0)
d PRTDEV 10A inz('*WRKSTN')
d ATNPGM 10A inz('*NONE')
d ATNPGMLIB 10A inz('*LIBL')
d USROPT likeds(ds_USROPT)
d DSPSGNINF 7A inz('*SYSVAL')
d PWDEXPITV 5p 0 inz(0)
d PWDEXP 4A inz('*YES')
d STATUS 10A inz('*ENABLED')
d PRVSIGN 13A inz('')
d NOTVLDSIGN 11p 0 inz(0)
d LMTDEVSSN 7A inz('*YES')
d KBDBUF 10A inz('*SYSVAL')
d LANGID 10A inz('*SYSVAL')
d CNTRYID 10A inz('*SYSVAL')
d CCSID 5p 0 inz(0)
d SRTSEQ 10A inz('*SYSVAL')
d SRTSEQLIB 10A inz('*LIBL')
d OBJAUD 10A inz('')
d AUDLVL likeds(ds_AUDLVL)
d GRPAUTTYP 10A inz('*PRIVATE')
d SUPGRPPRF likeds(ds_SUPGRPPRF)
d UID 10p 0 inz(0)
d GID 10p 0 inz(0)
d SETJOBATR likeds(ds_SETJOBATR)
d CHRIDCTL 10A inz('*SYSVAL')
d LCLPWDMGT 10A inz('*YES')
d ERRORIND N inz('0')

// Retrieve user profile data
d GetUserProfile pr extpgm('mylib/myclpgm')
d v_g_USERID 10A const
d v_g_RTNUSRPRF 10A
d v_g_SPCAUT likeds(ds_SPCAUT)
d v_g_MAXSTG 11p 0
d v_g_STGUSED 15p 0
d v_g_PTYLMT 1A
d v_g_INLPGM 10A
d v_g_INLPGMLIB 10A
d v_g_JOBD 10A
d v_g_JOBDLIB 10A
d v_g_GRPPRF 10A
d v_g_OWNER 10A
d v_g_GRPAUT 10A
d v_g_ACGCDE 15A
d v_g_MSGQ 10A
d v_g_MSGQLIB 10A
d v_g_OUTQ 10A
d v_g_OUTQLIB 10A
d v_g_TEXT 50A
d v_g_PWDCHGDAT 6A
d v_g_USRCLS 10A
d v_g_ASTLVL 10A
d v_g_SPCENV 10A
d v_g_CURLIB 10A
d v_g_INLMNU 10A
d v_g_INLMNULIB 10A
d v_g_LMTCPB 10A
d v_g_DLVRY 10A
d v_g_SEV 2p 0
d v_g_PRTDEV 10A
d v_g_ATNPGM 10A
d v_g_ATNPGMLIB 10A
d v_g_USROPT likeds(ds_USROPT)
d v_g_DSPSGNINF 7A
d v_g_PWDEXPITV 5p 0
d v_g_PWDEXP 4A
d v_g_STATUS 10A
d v_g_PRVSIGN 13A
d v_g_NOTVLDSIGN 11p 0
d v_g_LMTDEVSSN 7A
d v_g_KBDBUF 10A
d v_g_LANGID 10A
d v_g_CNTRYID 10A
d v_g_CCSID 5p 0
d v_g_SRTSEQ 10A
d v_g_SRTSEQLIB 10A
d v_g_OBJAUD 10A
d v_g_AUDLVL likeds(ds_AUDLVL)
d v_g_GRPAUTTYP 10A
d v_g_SUPGRPPRF likeds(ds_SUPGRPPRF)
d v_g_UID 10p 0
d v_g_GID 10p 0
d v_g_SETJOBATR likeds(ds_SETJOBATR)
d v_g_CHRIDCTL 10A
d v_g_LCLPWDMGT 10A
d v_g_ERROR N

RPG Source:
d ds_get_user ds likeds(ds_user_prof)

callp GetUserProfile(ds_get_user.USERID:
ds_get_user.RTNUSER:
ds_get_user.SPCAUT:
ds_get_user.MAXSTG:
ds_get_user.STGUSED:
ds_get_user.PTYLMT:
ds_get_user.INLPGM:
ds_get_user.INLPGMLIB:
ds_get_user.JOBD:
ds_get_user.JOBDLIB:
ds_get_user.GRPPRF:
ds_get_user.OWNER:
ds_get_user.GRPAUT:
ds_get_user.ACGCDE:
ds_get_user.MSGQ:
ds_get_user.MSGQLIB:
ds_get_user.OUTQ:
ds_get_user.OUTQLIB:
ds_get_user.TEXT:
ds_get_user.PWDCHGDAT:
ds_get_user.USRCLS:
ds_get_user.ASTLVL:
ds_get_user.SPCENV:
ds_get_user.CURLIB:
ds_get_user.INLMNU:
ds_get_user.INLMNULIB:
ds_get_user.LMTCPB:
ds_get_user.DLVRY:
ds_get_user.SEV:
ds_get_user.PRTDEV:
ds_get_user.ATNPGM:
ds_get_user.ATNPGMLIB:
ds_get_user.USROPT:
ds_get_user.DSPSGNINF:
ds_get_user.PWDEXPITV:
ds_get_user.PWDEXP:
ds_get_user.STATUS:
ds_get_user.PRVSIGN:
ds_get_user.NOTVLDSIGN:
ds_get_user.LMTDEVSSN:
ds_get_user.KBDBUF:
ds_get_user.LANGID:
ds_get_user.CNTRYID:
ds_get_user.CCSID:
ds_get_user.SRTSEQ:
ds_get_user.SRTSEQLIB:
ds_get_user.OBJAUD:
ds_get_user.AUDLVL:
ds_get_user.GRPAUTTYP:
ds_get_user.SUPGRPPRF:
ds_get_user.UID:
ds_get_user.GID:
ds_get_user.SETJOBATR:
ds_get_user.CHRIDCTL:
ds_get_user.LCLPWDMGT:
ds_get_user.ERRORIND);
Tom Armbruster
Senior Software Developer
Travelocity On Location
tom.armbruster@xxxxxxxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.