Ü  CRTCMD (Create command)

·         It is used to make commands that can be run on the command line to process any specific request, just like any system defined command.

·         The CRTCMD command may be run interactively or in a batch job.

 

Ü Steps for creating CRTCMD commands

a)  Create a source member of type “cmd” and as a source code write CMD.

 

Columns . . . :    1  80                      Browse                        AMIT/QRPGLESRC

SEU==>                                                                             CMD0001

FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8

*************** Beginning of data ********************************************************

0001.00              CMD        PROMPT('ENTER THE LIBRARY NAMES')

0002.00              PARM       KWD(PARM1) TYPE(*CHAR) LEN(10) MIN(1)  +

0003.00                           PROMPT('Financials old version library')

0004.00              PARM       KWD(PARM2) TYPE(*CHAR) LEN(10) MIN(1)  +

0005.00                           PROMPT('Financials new version library')

0006.00              PARM       KWD(PARM3) TYPE(*CHAR) LEN(10) MIN(1)  +

0007.00                           PROMPT('CS&L old version library')

0008.00              PARM       KWD(PARM4) TYPE(*CHAR) LEN(10) MIN(1)  +

0009.00                           PROMPT('CS&L new version library')

0010.00              PARM       KWD(PARM5) TYPE(*CHAR) LEN(10) MIN(1)  +

0011.00                           PROMPT('Manufacture old ver. library')

0012.00              PARM       KWD(PARM6) TYPE(*CHAR) LEN(10) MIN(1)  +

0013.00                           PROMPT('Manufacture new ver. library')

****************** End of data ***********************************************************

 

 

b)  Save the source member and then use option-14 against the source member to compile it and create a command. Option-14 is equivalent to CRTCMD.

 

                             Work with Members Using PDM                    SYSAI005

                                                                                

 File  . . . . . .   QRPGLESRC                                                 

   Library . . . .     AMITC                Position to  . . . . .             

                                                                                

 Type options, press Enter.                                                    

  2=Edit         3=Copy  4=Delete 5=Display       6=Print     7=Rename         

  8=Display description  9=Save  13=Change text  14=Compile  15=Create module...

                                                                               

 Opt  Member      Type        Text                                             

 14  CMD0001  CMD         COMMAND TO CALL CL PROGRAM QUERYCL >>> USE 14 OPTION AGAINST THE

                                                                 MEMBER CMD0001.  

                                                

                              

                                                                                

                                                                               

                                                                               

                                                                                

                                                                               

                                                                               Bottom

 Parameters or command                                                          

 ===>                                                                          

 F3=Exit          F4=Prompt             F5=Refresh            F6=Create        

 F9=Retrieve      F10=Command entry     F23=More options      F24=More keys    

 

                             Create Command (CRTCMD)                           

                                                                               

 Type choices, press Enter.                                                    

                                                                               

 Command  . . . . . . . . . . . . > QUERYCMD      Name                         

   Library  . . . . . . . . . . . >   AMITC       Name, *CURLIB                

 Program to process command . . . > QUERYCL       Name, *REXX                  

   Library  . . . . . . . . . . . >   AMITC       Name, *LIBL, *CURLIB         

 Source file  . . . . . . . . . . > QRPGLESRC     Name                         

   Library  . . . . . . . . . . . >   AMITC       Name, *LIBL, *CURLIB         

 Source member  . . . . . . . . . > CMD0001    Name, *CMD                   

 Threadsafe . . . . . . . . . . .   *NO           *YES, *NO, *COND             

                                                                                

                                                                               

                                                                               

                                                                                

                                                                               

                                                                               

                                                                                

                                                                               

                                                                         Bottom

 F3=Exit   F4=Prompt   F5=Refresh   F10=Additional parameters   F12=Cancel     

 F13=How to use this display        F24=More keys                              

 

                                      

>>>>>> Command QUERYCMD created in library AMITC.                     

 

 

c)  Here when we run the command CMD0001 from command line it will prompt for the parameters and then will call the program QUERYCL. The parameters can be retrieved by the calling program.

 

                       ENTER THE LIBRARY NAMES (CMD0001)                      

                                                                               

 Type choices, press Enter.                                                    

                                                                                

 Financials old version library   _______________ Character value              

 Financials new version library   _______________ Character value              

 CS&L old version library . . . . _______________ Character value              

 CS&L new version library . . . . _______________ Character value              

 Manufacture old ver. library . . _______________ Character value              

 Manufacture new ver. library . . _______________ Character value              

                                                                               

                                                                               

                                                                                

                                                                               

                                                                               

                                                                                

                                                                               

                                                                               

                                                                                

                                                                               

                                                                         Bottom

 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display   

 F24=More keys                                                                 

                                                                               

 





User Comments:





Copyright © Go4as400.com, 2013-2017. Copyright notice