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



No, not new at all....  This is exactly why IBM created *CMD objects
in the 
first place....  A command object is simply a means of accepting a
command 
string, formatting parameter data, and invoking a program.  

 

Hi Eric,
             Your suggestion sounds to be new. Can you give more
details 
on this?  How can you make use of *CMD object to over come this
parameter 
issue.
 
Commands have been on the AS400/System 38 from day one. Every time that
you type a command on the command line, you are using a command. IBM
uses nothing special in their commands. They define them just like we
do. 
 
The question was asked why commands weren't used much. I think people
just don't want to take the time but I would agree it is a good way to
avoid issues when submitting commands. 
 
Commands simply allow you to define parameters and how they are to be
used. The one surprising thing to me is that other systems have never
duplicated the AS/400 command language. There is nothing like anywhere
else. 
 
Here is a simple command definition. The instructions in the top are for
use by my Make tool Compile and shows how to create the object. PGM
XV0008 is the command processor that received the parameters from the
command processor. That would be your program that you are submitting. 
 
/*    *_> CNLLSTSPLF SRCFILE(@2/@1) SRCMBR(@3)                  */   
/*    *_> DLTCMD CMD(@5/@4)                                     */  
/*    *_> CRTCMD CMD(@5/@4) SRCFILE(@2/@1) SRCMBR(@3) +         */  
/*    *_>       PGM(XV0008    )                                 */  
 
             CMD        PROMPT('Cancel last spool file.')

 

/* Qualified Source File name
*/  
 

             PARM       KWD(SRCFILE) TYPE(SRCFILE) MIN(1) +

                          PROMPT('Source file')

 

 SRCFILE:    QUAL       TYPE(*NAME) EXPR(*YES)

             QUAL       TYPE(*NAME) LEN(10) EXPR(*YES) +

                          PROMPT('Library')

 

/* Source member name.
*/  
 

             PARM       KWD(SRCMBR) TYPE(*NAME) MIN(1) EXPR(*YES) +

                          PROMPT('Source member') 
 
The command prompted looks like this. 
 
                      Cancel last spool file. (CNLLSTSPLF)     
                                                               
 Type choices, press Enter.                                    
                                                               
 Source file  . . . . . . . . . .  ____________   Name         
   Library  . . . . . . . . . . .    ___________  Name         
 Source member  . . . . . . . . .  ____________   Name         
 
You always have CMD. 
 
The rest is just PARMS. Type PARM and prompt. In your case, you don't
need much. Just the parms themselves but this example includes a
qualified name. 
 
Here is more complicated one. If you go to www.think400.dk/downloads and
download my Make tool, you will find the source for these commands and
other that you could just modify. 
 
             CMD        PROMPT('Create object using EXCSRCCMD.')

 

/* Object name */

 

             PARM       KWD(OBJ) TYPE(QUAL3) PROMPT('Object')

 

 QUAL3:      QUAL       TYPE(*NAME) LEN(10) EXPR(*YES)

             QUAL       TYPE(*NAME) LEN(10) RSTD(*NO) DFT(*LIBL) +

                          SPCVAL((*LIBL)) EXPR(*YES) PROMPT('Library')

 

/* Qualified Source File name */

 

             PARM       KWD(SRCFILE) TYPE(QUAL1) PROMPT('Source file')  
 
 QUAL1:      QUAL       TYPE(*NAME) LEN(10) SPCVAL((*RPGLE +

                           QRPGLESRC) (*SQLRPGLE QRPGLESRC) (*RPG +

                           QRPGSRC) (*CLP QCLSRC) (*DSPF QDDSSRC) +

                           (*PRTF QDDSSRC) (*PF QDDSSRC) (*LF +

                           QDDSSRC) (*CMD QCMDSRC) (*DDS QDDSSRC) +

                           (*CMNF QDDSSRC) (*BSCF QDDSSRC) (*MXDF +

                           QDDSSRC) (*BAS QBASSRC) (*FMT QFMTSRC) +

                           (*PLI QPLISRC) (*TBL QTBLSRC) (*UDS +

                           QUDSSRC) (*CBL QCBLSRC) (*RPT QRPGSRC) +

                           (*IMG QIMGSRC) (*TXT QTXTSRC) (*CL +

                           QCLSRC)) EXPR(*YES)

             QUAL       TYPE(*NAME) LEN(10) RSTD(*NO) DFT(*LIBL) +

                          SPCVAL((*LIBL)) EXPR(*YES) PROMPT('Library')

 

/* Source member name */

 

             PARM       KWD(SRCMBR) TYPE(*NAME) MIN(1) EXPR(*YES) +

                          PROMPT('Source member')

 

/* Job Description. */

 

             PARM       KWD(JOBD) TYPE(QUAL2) PROMPT('Job +

                          description')

 

/* Optimize program *YES/*NO */

 

             PARM       KWD(OPTIMOPM) TYPE(*CHAR) LEN(4) RSTD(*YES) +

                          DFT(*NO) VALUES(*YES *NO) +

                          PROMPT('Optimize program(OPM)')

 

/* Optimize program(ILE)   *NONE, *BASIC, *FULL  */

 

             PARM       KWD(OPTIMILE) TYPE(*CHAR) LEN(6) RSTD(*YES) +

                          DFT(*NONE) VALUES(*NONE *BASIC *FULL) +

                          PROMPT('Optimize program(ILE)')

 

/* Debug view for ILE modules  */                                      
                                                                       
             PARM       KWD(DEBUGVIEW) TYPE(*CHAR) LEN(7) RSTD(*YES) + 
                          DFT(*ALL) VALUES(*ALL *STMT *SOURCE *LIST +  
                          *COPY *NONE) PROMPT('ILE Debug Level')       
                                                                       
/* Where running *Workstation or *GUI environment */                   
                                                                       
             PARM       KWD(ENV) TYPE(*CHAR) LEN(1) RSTD(*YES) +       
                          DFT(*WORKSTATION) SPCVAL((*WORKSTATION W) +  
                          (*GUI G)) PROMPT('Environment')              
/* Run batch? */                                                       
                                                                       
             PARM       KWD(BATCH) TYPE(*CHAR) LEN(1) RSTD(*YES) +     
                          DFT(*YES) SPCVAL((*YES Y) (*NO N)) +         
                          PROMPT('Run Batch')                          
                                                                       
/* Message queue to send compile messages to. */

 

             PARM       KWD(MSGQ) TYPE(QUAL4) DFT(*USER) +

                          SNGVAL((*USER)) PROMPT('Send messages to')

 

 QUAL2:      QUAL       TYPE(*NAME) LEN(10) EXPR(*YES)

             QUAL       TYPE(*NAME) LEN(10) RSTD(*NO) DFT(*LIBL) +

                          SPCVAL((*LIBL)) EXPR(*YES) PROMPT('Library')

 

 QUAL4:      QUAL       TYPE(*NAME) LEN(10) EXPR(*YES)

             QUAL       TYPE(*NAME) LEN(10) RSTD(*NO) DFT(*LIBL) +

                          SPCVAL((*LIBL)) EXPR(*YES) PROMPT('Library')

 

/* If environment is GUI, cannot run in batch. Must be *NO. */

 

             DEP        CTL(&ENV *EQ 'G') PARM((&BATCH *EQ 'Y')) +

                          NBRTRUE(*NE 1) MSGID(UXV0010)

 
This is command prompted.
 
                    Create object using EXCSRCCMD. (COMPILE)

 

 Type choices, press Enter.

 

 Object . . . . . . . . . . . . .   ____________  Name

   Library  . . . . . . . . . . .     *LIBL______ Name, *LIBL

 Source file  . . . . . . . . . .   ___________   Name, *RPGLE, *SQLLE,
*RPG.
   Library  . . . . . . . . . . .     *LIBL_____- Name, *LIBL

 Source member  . . . . . . . . .   ___________  Name

 Job description  . . . . . . . .   ___________   Name

   Library  . . . . . . . . . . .     *LIBL____   Name, *LIBL

 Optimize program(OPM)  . . . . .   *NO           *YES, *NO

 Optimize program(ILE)  . . . . .   *NONE         *NONE, *BASIC, *FULL

 ILE Debug Level  . . . . . . . .   *ALL          *ALL, *STMT,
*SOURCE...    
 Environment  . . . . . . . . . .   *WORKSTATION  *WORKSTATION, *GUI

 Run Batch  . . . . . . . . . . .   *YES          *YES, *NO

 Send messages to . . . . . . . .   *USER         Name, *USER

   Library  . . . . . . . . . . .                 Name, *LIBL

                                

 


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.