Code Transformation

RPG Code transformation…

0001.00  *****************************************************************
0002.00  * THIS PROGRAM WILL MAINTAIN THE DEPARTMENT MASTER FILE.
0003.00  *****************************************************************
0004.00 FDEPTDSP   CF   E             WORKSTN SFILE(SFLSUB01:RRN)
0005.00 FDEPTMAST  UF A E           K DISK
0006.00  *****************************************************************
0007.00 DRRN              S              4  0 INZ
0008.00  *****************************************************************
0009.00 C                   DoU       *InKC = *ON
0010.00  *
0011.00  * Clear the Department subfile.
0012.00 C                   ExSr      $CLEAR
0013.00  * Build the Department subfile.
0014.00 C                   ExSr      $BUILD
0015.00  *
0016.00  * Display the records in the Department Master File.
0017.00 C                   Write     SFLKEY01
0018.00 C                   ExFmt     SFLCTL01
0019.00  *
0020.00  * Does user request to Exit(F3)?
0021.00 C                   If        *InKC = *On
0022.00 C                   Leave
0023.00 C                   EndIf
0024.00  *
0025.00  * Does user request to add Department(F6)?
0026.00 C                   IF        *InKF = *On
0027.00 C                   ExSr      $ADD
0028.00 C                   Else
0029.00  * Does user request to change or delete an entry?
0030.00 C                   Eval      RRN = 1
0031.00 C                   DoU       *In99 = *On
0032.00 C                   ReadC     SFLSUB01                               99
0033.00 C                   If        *In99 = *Off and
0034.00 C                             DSOPT <> *Blank
0035.00 C                   ExSr      $MODIF
0036.00 C                   EndIf
0037.00 C                   EndDo
0038.00 C                   EndIf
0039.00  *
0040.00 C                   EndDo
0041.00  *
0042.00 C                   Eval      *InLR = *On

 

Java


/**
 * DEPTPGMProgram
 * @author eBI Synetics Group, Inc.
 */
public class DEPTPGMProgram extends RPGProgram {

public static final String NAME = "DEPTPGM";

private ProgramDisplayFile deptdsp;
private ProgramDataFile deptmast;

/**
 * DEPTPGMProgram constructor
 */
public DEPTPGMProgram() {
	super();
}
…
/**
 * Process detail (*DETC)
 */
protected void processDetail() {
  do {
   _CLEAR();
   _BUILD();
    WRITE(getSFLKEY01Format());
    EXFMT(getSFLCTL01Format());
    if (isIndicatorOn("KC")) {
	break;
    }
    if (isIndicatorOn("KF")) {
     _ADD();
    } else {
	setRRN(ONE);
      do {
	   READC(getSFLSUB01Format(), getIndicatorField("99"));
	   if (isIndicatorOff("99") && !getDSOPTField().isBLANK()) {
      _MODIF();
	   }
      } while (!(isIndicatorOn("99")));
    }
  }
  while (!(isIndicatorOn("KC")));
  setIndicatorOn("LR");
}

 

Archives

All entries, chronologically...