
Piano |
Hi Bruce
Thank you for your response.
For an update, I read thru the IBM documentation. I then registered PROGRAM DEVINIT2 which I found off the interne as a sample program. It is registered under QIBM_QTG_DEVINIT.
Unfortunately, this program is of type C, and I do not know how to debug (or even if I can debug) this program.
Bottom line is that it is not preventing me as a user to TELENT in, and, I want to use myself as a “TEST” user, to see just exactly how this program works.
Alternatively, I would welcome any CLLE or CLP program samples that do the same thing. I need to be able to block out user profiles, based on user id’s that I have stored into a file which I set up file maintenance for. I am pretty sure that I can set up the DEBUB on a CLLE, or CLP program that is out there !
I hope I am making sense, and I do apprecaite all your feedback. You have no idea how much time you save me “going down a dirt road” becuase I was reading the wrong documentation.
Thank you, and I will anxiously await anyones response.
Sincerely
Nick

Mcl |
Nick..
Google is your friend. I found what looks like a good article by searching for “AS/400 exit programs”. Article was on (can I say this here?) the ITJungle website. There is a CL example and some explanation.. No guarantees, but it might help.
Cheers
Mike

Bvining |
Hi, Nick
You can debug C programs in the same manner that you debug CL or RPG programs. Compile the program using the DBGVIEW parameter as you would with other languages. Debugging is a bit more fun though (for any language) as the exit program is running in a Telnet job, not yours…
To try and help, here’s a quick and dirty CL program that checks explicitly for a user profile of TEST and, if found, closes the Telnet session.
Pgm Parm(&Usr_Info &Dev_Info &Conn_Info +
&Env_Opts &Len_Env &Alw_Conn &Alw_Auto)
Dcl Var(&Usr_Info) Type(*Char) Len(44)
Dcl Var(&UsrPrf) Type(*Char) Stg(*Defined) +
Len(10) DefVar(&Usr_Info 5)
Dcl Var(&Dev_Info) Type(*Char) Len(28)
Dcl Var(&Conn_Info) Type(*Char) Len(76)
Dcl Var(&Env_Opts) Type(*Char) Len(1)
Dcl Var(&Len_Env) Type(*Int)
Dcl Var(&Alw_Conn) Type(*Char) Len(1)
Dcl Var(&Alw_Auto) Type(*Char) Len(1)
If Cond(&UsrPrf = 'TEST') Then(Do)
ChgVar Var(&Alw_Conn) Value('0')
ChgVar Var(&Alw_Auto) Value('0')
EndDo
Else Cmd(Do)
ChgVar Var(&Alw_Conn) Value('1')
ChgVar Var(&Alw_Auto) Value('0')
EndDo
EndPgm
It appears to work with rather limited testing
You’ll want to obviously supplement the user profile checking and, if you’re really going to store the profile names in a database, might be interested in a product I’m nearing completion on — CL support for files such as database keyed (and obviously arrival sequence) read/write/update/delete, display files, printer files, etc). I haven’t done the command online help, but some very nice functionality
Bruce Vining
http://www.brucevining.com/

Bvining |
PS - I used the V5R4 CL *Defined storage capability to define &Usr_Info as a structure. If you’re on an earlier release you would simply substring out the &UsrPrf value from the &Usr_Info parameter.
Bruce