|
Pete ! What version of the operating system are you on that prompting a command and then going to a blank area and press F1 gets you the error message info (this is GREAT !!) ? Thanks, Chuck (on V4R1...) Pete Hall wrote: > At 19:28 10/07/1998 , you wrote: > >i was working on the cl part of my job and came up with a few > >questions. this is my cl pgm so far based on a layout i have, a few > >changes ought to be necessary i think. > > > >PGM PARM(&OBJ &LIB &OK) > >DCL &OBJ *CHAR 10 > >DCL &LIB *CHAR 10 > >DCL &TYPE *CHAR 6 > >DCL &OK *CHAR 1 'Y' > >CHKOBJ &LIB/&OBJ &TYPE > >MONMSG CPF0000 EXEC(CHGVAR &OK 'N') > >ENDPGM > > > >anyway, my question is how, how does this cl pgm know > >what &OBJ &LIB &TYPE &OK refer to when this cl pgm has to interact > >with display files and rpg pgms, etc... > > You must tell it when you call the program. If you are checking for more than >one type of object, you need to pass the type as a parameter also: > > CALL PGM(MYPGM) PARM('MYOBJ' 'MYLIB' '*FILE' &OK) > or in RPG: > > C CALL 'MYPGM' > C PARM 'MYOBJ' OBJNAM 10 > C PARM 'MYLIB' LIBNAM 10 > C PARM '*FILE' OBJTYP 6 > C PARM 'Y' RTNOK 1 > > You cannot initialize &OK in your CL program, since it is a parameter (exists >outside of the program). > Do not check only for CPF0000 on the MONMSG. There are reasons other than >object non-existence that can cause an escape message to be issued by CHKOBJ. >Prompt the CHKOBJ command, move the cursor to a blank area of the display and >press F1. Roll up, and a list of all of the messages that CHKOBJ can issue >will be displayed. Some of the other messages relate to bad library name and >insufficient authority to see the object. You can also test for specific >authority with CHKOBJ, to make sure that you will be able to >delete/update/rename/etc, and you can have several MONMSG commands after the >CHKOBJ, each testing for different messages, with different actions or branch >targets. Use the CPF0000 as the last one, in order to handle unexpected >errors, and branch to code that will cause the program to die gracefully. > > hth > Pete > > Pete Hall > peteh@inwave.com > http://www.inwave.com/~peteh/ > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.