× 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.



All,

In my client's shop (a JDE World Software implementation), they have recently 
locked down *everything* because of an impending IT audit.  

We currently have an 830 on V5R1M0 with development and production running in 
the same partition.  The long-term plan is to create a development partition 
where the programmers *will* have command line capabilities in JDE, but this is 
not going to happen soon.  

The developer's hands have basically been tied behind their backs, since they 
have taken the ability to run iSeries commands while in the JDE environment.  
They changed the iSeries profile that the developers use for JDE to be 
LMTCPB(*YES), and took away the command line on the JDE menu.  We each have 
another iSeries profile that *does* have command-entry capability, but it can 
only be used to create and compile programs through ACMS (Aldon Change 
Management System), and cannot be used to login to JDE for testing.  

In the meantime, I still need to be able to debug programs in the JDE 
environment using STRDBG and STRISDB, as well as some other commands.  

I know that I can write CL programs that prompt these as well as other 
commands, and have them owned by and adopt the authority of a user like QPGMR 
that is authorized to run commands and put these programs as options on a JDE 
menu.  I think this could be too limiting for the developers.

What I have in mind is creating a request-message handling program that I can 
put as a hidden selection or a menu option on a JDE menu.  We could then give 
selected users the ability to run this menu option, which would present what 
appears to be a command line so they can run allowed iSeries commands.  

I would have to add the code to determine which commands are being entered and 
whether or not they are allowed through this program, and I would also add the 
code to this program to use the SNDJRNE command to send an entry to a journal 
that I have created to keep a log of the commands that were executed by this 
program.

In the past, I have seen examples of request-message handling programs that 
could be used to simulate an AS/400 command line, but I have been searching on 
Google and Midrange.com all day and I haven't found anything substantial that I 
can use for my purposes.  

The problem is that I need to be able to *prompt* the command in the 
request-message handling program.

Here is a very simple program that I found and modified, but it won't allow you 
to prompt the command.  It expects you to have filled out the command parms 
properly, then it calls QCMDEXC to execute it.  If you enter a command and 
press F4, it just executes the command that you supplied without any prompting.

            PGM                                                             
            DCL        VAR(&MSGKEY) TYPE(*CHAR) LEN(4)                      
            DCL        VAR(&CMD) TYPE(*CHAR) LEN(2000)                      
            DCL        VAR(&CMDLEN) TYPE(*DEC) LEN(15 5) VALUE(2000)        
                                                                            
            DCL        VAR(&ERRORSW) TYPE(*LGL) /* Std err */               
            DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7) /* Std err */         
            DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(100) /* Std err */      
            DCL        VAR(&MSGF) TYPE(*CHAR) LEN(10) /* Std err */         
            DCL        VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) /* Std err */      
                                                                            
            MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(STDERR1)) /* +       
                         Std err */                                         
                                                                            
            RCVMSG     PGMQ(*EXT) MSGTYPE(*RQS) RMV(*NO) +                  
                         KEYVAR(&MSGKEY) MSG(&CMD)                          
                                                                            
            MONMSG     MSGID(CPF2415) EXEC(DO)                              
               SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('The +        
                            user cancelled!') TOPGMQ(*EXT)                  
               GOTO       CMDLBL(STEP99)                                    
            ENDDO                                                           
                                                                            
            CALL       PGM(QCMDEXC) PARM(&CMD &CMDLEN)                      
                                                                            
                       /* Standard error handling routine */                
                                                                            
STDERR1:    IF         COND(&ERRORSW) THEN(SNDPGMMSG MSGID(CPF9999) +       
                         MSGF(QCPFMSG) MSGTYPE(*ESCAPE)) /* Func +          
                         chk */                                             
                                                                            
            CHGVAR     VAR(&ERRORSW) VALUE('1') /* Set to fail ir +         
                         error occurs */                                    
                                                                            
STDERR2:    RCVMSG     MSGTYPE(*DIAG) MSGDTA(&MSGDTA) MSGID(&MSGID) +  
                         MSGF(&MSGF) MSGFLIB(&MSGFLIB)                 
                                                                       
            IF         COND(&MSGID *EQ '       ') THEN(GOTO +          
                         CMDLBL(STDERR3))                              
                                                                       
            SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +            
                         MSGDTA(&MSGDTA) MSGTYPE(*DIAG)                
                                                                       
            GOTO       STDERR2 /* Loop back for addl diagnostics */    
                                                                       
STDERR3:    RCVMSG     MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) +  
                         MSGF(&MSGF) MSGFLIB(&MSGFLIB)                 
                                                                       
            IF         COND(&MSGID *NE ' ') THEN(DO)                   
               SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +         
                            MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE)           
            ENDDO                                                      
                                                                       
STEP99:     ENDPGM    
    

Any thoughts or examples you wish to share?

Thanks in advance,

Steve Landess
Austin, Texas
(512) 423-0935


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.