Refactoring RPG - Part 1
By Stephen West
Figure 1. REFACTOR.cmd Command Source Code
/********************************************************************/
/* Refactor RPG Source (REFACTOR) command */
/* CPP is CSC8801 */
/********************************************************************/
REFACTOR: CMD PROMPT('Refactor RPG Source Command')
PARM FROMSRC FromQual +
MIN(1) +
PROMPT('From file')
PARM FROMMBR *name 10 +
MIN(1) +
PROMPT('From member')
PARM TOSRC ToQual +
MIN(1) +
PROMPT('To file')
PARM TOMBR *name 10 +
MIN(1) +
PROMPT('To member')
PARM CLRFSTFIVE *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Clear the first 5 positions')
PARM CLRFRMTYP *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Clear form type on comments')
PARM SETDATE *date +
DFT(*SAME) RSTD(*YES) +
SPCVAL((*SAME 0400101)(*CURRENT 0400102)(*ZEROS 0400103)) +
PROMPT('Set date')
PARM MIXOPCOD *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Mixed case opcodes')
PARM LOWBLTINS *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Lo case %built-ins')
PARM LOWFIGCON *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Lo case figurative constants')
PARM CVTCMT2BLK *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Convert plain comment to blank')
PARM UPDCONDS *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Update conditionals')
PARM RMVHILITES *char 4 +
DFT(*YES) SPCVAL((*YES)(*NO)) RSTD(*YES) +
PROMPT('Remove hilites')
FromQual: +
QUAL *name 10 MIN(1)
QUAL *name 10 +
DFT((*LIBL)) SPCVAL((*LIBL)(*CURLIB)) +
PROMPT('Library')
ToQual: +
QUAL *name 10 MIN(1)
QUAL *name 10 +
DFT((*LIBL)) SPCVAL((*LIBL)(*CURLIB)) +
PROMPT('Library')
|