RTVCMD.ZIP - Retrieve command source ============================================================= 2008/12/15 Dave McKenzie Zbig Group, Inc. davemck@zbiggroup.com This freeware utility contains the command RTVCMDSRC, which allows you to retrieve source statements from an AS/400 command into a source file. Both IBM-supplied and user-defined commands may be retrieved. A separate command, RTVCMDMSG, is included which retrieves message descriptions from commands, for PROMPT and CHOICE parameters in which prompt text was derived from message descriptions when the command was created. RTVCMDMSG creates source for a CL program containing ADDMSGD commands to reconstruct a message file with the prompt message descriptions. The utility will run on V3R1 and up (including RISC) at all QSECURITY levels up to and including 50. It is in the public domain and source is included. Contents: RTVCMD.ZIP contains the following files: README This file. RTVCMD.LIB AS/400 library named RTVCMD, in save file format. PF528.FDF Description file for 528-byte physical file for RFROMPC. TOSAVF.REX Source for a REXX procedure to copy a physical file to a save file. Installation: To install on an AS/400: (Change the library names, etc., as appropriate.) The simplest way is to use FTP (if you have a TCP/IP connection). A. On the AS/400, create a save file with the CRTSAVF cmd, if you don't have one you can use already. B. On the PC, start FTP and enter your user and password (if asked). C. Enter the following FTP commands: ftp> bin ftp> cd myLib ftp> put rtvcmd.lib mySavf ftp> bye Where mySavf is the name of your save file and myLib is the library it's located in. D. Go to step 4 below. If FTP is not available, you can: 1. Create a physical file with a record length of 528, like this: CRTPF MYLIB/PF528 RCDLEN(528) SIZE(*NOMAX) 2. Get RTVCMD.LIB into the 528-byte physical file. One way: Use the PCS/CA program RFROMPC to copy RTVCMD.LIB to the 528-byte physical. Specify PF528.FDF (provided) as the "Description file." Another way: Copy RTVCMD.LIB to a shared folder; then use a command like: CPYFRMPCD FROMFLR(MYFLR) TOFILE(MYLIB/PF528) FROMDOC(RTVCMD.LIB) TRNTBL(*NONE) 3. Copy the 528-byte physical file to a save file. One way: Use the QUSRTOOL command CPYTOSAVF like this: CPYTOSAVF FROMDBF(MYLIB/PF528) TOSAVF(MYLIB/MYSAVF) Another way: Copy the enclosed REXX program TOSAVF to a QREXSRC file and run it like this: STRREXPRC SRCMBR(TOSAVF) SRCFILE(MYLIB/QREXSRC) PARM('pf528 mylib mysavf mylib') 4. Restore the RTVCMD library from the save file: RSTLIB SAVLIB(RTVCMD) DEV(*SAVF) SAVF(MYLIB/MYSAVF) If you wish, you can restore the objects to another library: RSTLIB SAVLIB(RTVCMD) DEV(*SAVF) SAVF(MYLIB/MYSAVF) RSTLIB(NOTHERLIB) The only library dependency in the objects is the PRDLIB parameter on the RTVCMDSRC and RTVCMDMSG commands. You can change that to your library: CHGCMD CMD(MYLIB/RTVCMDSRC) PRDLIB(NOTHERLIB) Author: Dave McKenzie davemck@zbiggroup.com Zbig Group, Inc. Fairfield, CA