SoftCode Services

      ****************************************************************                              
      * PROGRAM NAME - SC0000_PR                                     *                              
      *                                                              *                              
      * FUNCTION     - This source is a copybook for the common      *                              
      *                procedures of the softcode functions service  *                              
      *                program                                       *                              
      *                                                              *                              
      * PROGRAMMER   - STEVE CROY   iSoftwerks, Inc.                 *                              
      ****************************************************************                              
                                                                                     
                                                  
     D ShowHelp        PR                                                                          
     D  AppName                      10    CONST                                                    
                                                                                                    
     D HelpText        pr                                                                           
     D   program                     10                                                             
     D   format                      10                                                             
                                                                                                    
     D PROMPTER        PR                                                                           
     D  Program                      10                                                             
     D  Prompt                       10                                                             
     D  PromptDta                   256                                                             
                                                                                                    
     D DisplayMessage  PR                                                                           
     D  InString                    255                                                             
     D  InTitle                      27    options(*nopass)                                         
                                                                                                    
     D FunctionKeys    PR            31                                                             
                                                                                                    
     D MouseEvents     PR            16                                                             
                                                                                                    
     D CheckAuthority  PR                                                                           
     D  CkUsr                        10                                                             
     D  CkGate                       10                                                             
     D  CkCat                         3S 0                                                          
     D  CkPass                        1                                                             
     D  CkLvl                         3                                                             
                                                                                                    
     D UsrClass        PR                                                                           
     D  UsrNam                       10                                                             
     D  UsrGrp                       10                                                             
     D  UsrCls                       10                                                             
     D  UsrOut                       10                                                             
     D  UsrQlb                       10                                                             
     D  UsrRtn                        2                                                             
                                                                                                    
     D DisplayKeys     PR                                                                           
     D   KeysIn                     720                                                             
     D   LinOut1                     60                                                             
     D   LinOut2                     60                                                             
     D   KeyIdx                       3S 0                                                          
                                                                                                    
     D DisplayOptions  PR                                                                           
     D   OptionsIn                  720                                                             
     D   LinOut1                     60                                                             
     D   LinOut2                     60                                                             
     D   OptIdx                       3S 0                                                          
                                                                                                    
     D GetFunction     PR                                                                           
     D  pgmnam                       10                                                             
     D  pnlnam                       10                                                             
     D  keyDS                         1                                                             
     D  keyID                        10                                                             
     D  function                     45                                                             
     D  level                         3                                                             
                                                                                                    
     D GetKeyText      PR                                                                           
     D  pgmnam                       10                                                             
     D  pnlnam                       10                                                             
     D  text                        720                                                             
     D  level                         3                                                             
                                                                                                    
     D GetOption       PR                                                                           
     D  pgmnam                       10                                                             
     D  pnlnam                       10                                                             
     D  optID                        10                                                             
     D  option                       45                                                             
     D  level                         3                                                             
                                                                                                    
     D GetOptText      PR                                                                           
     D  pgmnam                       10                                                             
     D  pnlnam                       10                                                             
     D  text                        720                                                             
     D  level                         3 

     D CheckFuncData   PR             1n                                                            
     D  DataIn                         *   value                                                    
     D  LenIn                        10i 0 value                                                    
                                                                                                    
     D FunctionFound   Pr              N                                                            
     D  p_pgm                        10A   CONST                                                    
     D  p_pnl                        10A   CONST                                                    
     D  p_key                        10A   CONST                                                    
                                                                                                    
     d ClearFuncRec    Pr                                                                           
                                                                                                    
     d UpdFunction     pr              n                                                            
                                                                                                    
     d DltFunction     pr              n                                                            
                                                                                                    
     d AddFunction     pr              n                                                            
                                                                                                    
     d SetFuncCursor   pr              n                                                            
     d   orderBy                    256a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                 256a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d GetNxtFunction  pr              n                                                            
                                                                                                    
     d CloseFunctionCursor...                                                                       
     d                 pr              n                                                            
                                                                                                    
     d GetPgmFunction  pr            98a                                                            
                                                                                                    
     d SetFuncLevel    Pr                                                                           
     d  pLevel                        3a   const                                                    
                                                                                                    
     d SetFuncPgmID    Pr                                                                           
     d  pFpgm                        10a   const                                                    
                                                                                                    
     d SetFuncPnlID    Pr                                                                           
     d  pFpnl                        10a   const                                                    
                                                                                                    
     d SetFuncKeyID    Pr                                                                           
     d  pFkey                        10a   const                                                    
                                                                                                    
     d SetPgmMacro     Pr                                                                           
     d  pMacro                       45A   const                                                    
                                                                                                    
     d SetFuncText     Pr                                                                           
     d  pText                        20A   const                                                    
                                                                                                    
     d SetFuncCall     Pr                                                                           
     d  pCallPgm                     10A   const                                                    
                                                                                                    
     d SetFuncParm     Pr                                                                           
     d  pPlist                       10A   const                                                    
                                                                                                    
     d SetFuncActn     Pr                                                                           
     d  pAction                       1A   const                                                    
                                                                                                              
                                                                                                    
     D GetUserClass    PR                                                                           
     D  User                         10A                                                            
     D  Group                        10A                                                            
     D  Class                        10A                                                            
     D  ErrCode                       7A                                                            
                                                                                                    
     D SetColor        PR             1A                                                            
     D   colorValue                   3    CONST OPTIONS(*OMIT:*NOPASS)                             
     D   colorAttr                    2    CONST OPTIONS(*NOPASS)                                   
     D   fieldPr                      2    CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     D RmvMessage      PR                  extpgm('SC0005CL')                                       
     D  msgpgm                       10                                                             
                                                                                                    
     D RtvMessage      PR                  extpgm('SC0010CL')                                       
     D  msgid                         7                                                             
     D  msgfl                        10                                                             
     D  msgdta                      132                                                             
     D  msgtxt                       80                                                             
                                                                                                    
     D SndMessage      PR                  extpgm('SC0015CL')                                       
     D  msgid                         7                                                             
     D  msgfl                        10                                                             
     D  msgdta                      132                                                             
     D  msgrls                        5                                                             
     D  msgpgm                       10                                                             
                                                                                                    
     D SQLError        PR                                                                           
                                                                                                    
     D ShowRecordLock  PR                  EXTPGM('SC0130RP')                                       
     D  CPFMessage                   80                                                             
     D  CallingPgm                   10                                                             
     D  ExitAllowed                   1                                                             
     D  BypassLock                    1                                                             
     D  FileLocked                    8                                                             
                                                                                                    
     D getNum          PR            30p 9                                                          
     D  string                      100a   const varying                                            
     D  decComma                      2a   const options(*nopass)                                   
     D  currency                      1a   const options(*nopass)                                   
                                                                                       
     D testZoned       PR             1n                                                            
     D   pZoned                        *   value                                                    
     D   len                         10i 0 value                                                    
                                                                                         
     DCommand          PR                                                                           
     D  Command                     256                                                             
     D  Length                       15  5                                                          
                                                                                         
     D DateToday       PR             8S 0                                                          
                                                                                          
     D TimeNow         PR             6S 0                                                          
                                                                                        
     D centerTxt       PR           100a   varying                                                  
     D   instr                      100a   value varying                                            
     D   len                         10i 0 value                                                    
                                                                                        
     D RtvSysName      PR            10I 0                                                          
     D   SysName                      8A                                                            
                                                                                          
     D GetJobAtr       PR             1A                                                            
                                                                                          
     DDelayJob         PR                                                                           
     D  NbrSecs                      15  5                                                          
                                                                                          
     D UpperCase       PR           256a   varying                                                  
     D   inString                   256a   value varying                                            
     D   len                         10i 0 value                                                    
                                                                                          
     D LowerCase       PR           256a   varying                                                  
     D   inString                   256a   value varying                                            
     D   len                         10i 0 value                                                    
     D   pos                         10i 0 options(*nopass)                                         
                                                                                                    
     D DayOfWeek       PR             3S 0                                                          
     D  DateIn                         D   CONST options(*nopass)                                   
                                                                                                    
     D ISOdate         PR             8S 0                                                          
                                                                                                    
     D USAdate         PR             8S 0                                                          
                                                                                                    
     D MDYdate         PR             6S 0                                                          
                                                                                                    
     D YMDdate         PR             6S 0                                                          
                                                                                                    
     D DMYdate         PR             6S 0                                                          
                                                                                                    
     D CYMDdate        PR             7S 0                                                          
                                                                                                    
     D JulianDate      PR             5S 0                                                          
                                                                                                    
     D DayOfYear       PR             3S 0                                                          
                                                                                                    
     D TimeStamped     PR              z                                                            
                                                                                                    
     D CvtToJulian     PR             5S 0                                                          
     D  DateIn                        8S 0 Const options(*nopass)                                   
     D  FormatIn                      5    Const options(*nopass)                                   
                                                                                                    
     D CvtToDate6      PR             6S 0                                                          
     D  FmtOut                        5    Const                                                    
     D  DateIn                        8S 0 Const options(*nopass)                                   
     D  FormatIn                      5    Const options(*nopass)                                   
                                                                                                    
     D CvtToDate8      PR             8S 0                                                          
     D  FmtOut                        5    Const                                                    
     D  DateIn                        8S 0 Const options(*nopass)                                   
     D  FormatIn                      5    Const options(*nopass)                                   
                                                                                                    
     D CvtToDate7      PR             7S 0                                                          
     D  FmtOut                        5    Const                                                    
     D  DateIn                        8S 0 Const options(*nopass)                                   
     D  FormatIn                      5    Const options(*nopass)                                   
                                                                                                    
     D CheckDate       PR              n                                                            
     D  DateValue                     8S 0 Const                                                    
     D  DateFormat                    5    Const options(*nopass)                                   
     D  DateMessage                    n   Const options(*nopass)                                   
                                                                                                    
     D SetDay          PR              D                                                            
     D  DaysIn                        2S 0 Const                                                    
     D  DateIn                         D   OPTIONS(*nopass)                                         
                                                                                                    
     D SetMonth        PR              D                                                            
     D  MnthIn                        2S 0 Const                                                    
     D  DateIn                         D   OPTIONS(*nopass)                                         
                                                                                                    
     D SetYear         PR              D                                                            
     D  YearIn                        4S 0 Const                                                    
     D  DateIn                         D   OPTIONS(*nopass)                                         
                                                                                                    
     D GetQuarter      PR             3S 0                                                          
     D  DateIn                        8S 0 CONST options(*nopass)                                   
                                                                                                    
     D QuarterStarted  PR             8S 0                                                          
     D  DateIn                        8S 0 CONST options(*nopass)                                   
                                                                                                    
     D QuarterEnded    PR             8S 0                                                          
     D  DateIn                        8S 0 CONST options(*nopass)                                   
                                                                                                    
     D DateText        PR            30A                                                            
     D  DateType                      1    CONST                                                    
     D  DateIn                        8S 0 CONST options(*nopass)                                   
     D GateFound       Pr              N                                                            
     D  p_GATE                       10A   CONST                                                    
     D  p_CAT                         3P 0 CONST                                                    
                                                                                                    
     D ClearGateRec    Pr                                                                           
                                                                                                    
     D CheckGateData   PR             1n                                                            
     D  DataIn                         *   value                                                    
     D  LenIn                        10i 0 value                                                    
                                                                                                    
     d UpdateGate      Pr              n                                                            
                                                                                                    
     d DeleteGate      Pr              n                                                            
                                                                                                    
     d InsertGate      Pr              n                                                            
                                                                                                    
     d SetGateCursor   pr              n                                                            
     d   orderBy                     50a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                  50a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d GetNextGate     pr              n                                                            
                                                                                                    
     d CloseGateCursor...                                                                           
     d                 pr              n                                                            
                                                                                                    
     d GetGateData     pr            39a                                                            
                                                                                                    
     d setGateLevel    Pr                                                                           
     d  pLevel                        3a   const                                                    
                                                                                                    
     d setGateName     Pr                                                                           
     d  pGate                        10A   const                                                    
                                                                                                    
     d setGateCat      Pr                                                                           
     d  pCategory                     3p 0 const                                                    
     D FindTabCode     Pr              N                                                            
     D  p_Tab                         5S 0 CONST                                                    
     D  p_Cod                         3s 0 CONST                                                    
                                                                                                    
     D ClearTabCode    Pr                                                                           
                                                                                                    
     D CheckTableEntry...                                                                           
     D                 PR             1n                                                            
     D  DataIn                         *   value                                                    
     D  LenIn                        10i 0 value                                                    
                                                                                                    
     d UpdateTabCode   Pr              n                                                            
                                                                                                    
     d DeleteDetail    Pr              n                                                            
                                                                                                    
     d DeleteTabCode   Pr              n                                                            
                                                                                                    
     d InsertTabCode   Pr              n                                                            
                                                                                                    
     d SetDetailCursor...                                                                           
     d                 pr              n                                                            
     d   orderBy                    256a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                 256a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d NextTabCode     pr              n                                                            
                                                                                                    
     d CloseDetailCursor...                                                                         
     d                 pr              n                                                            
                                                                                                    
     d GetTabData      pr            72a                                                            
                                                                                                    
     D GetTabCode      pr             5s 0                                                          
                                                                                                    
     d GetTabDesc      Pr            30a                                                            
                                                                                                    
     d GetTabAbbr      Pr            10a                                                            
                                                                                                    
     d setCodDesc      Pr                                                                           
     d  pDesc                        30a   const                                                    
                                                                                                    
     d setCodAbbr      Pr                                                                           
     d  pDesc                        10a   const                                                    
                                                                                                    
     d SetTableID      pr                                                                           
     d  pTable                        5s 0 const                                                    
                                                                                                    
     D SetTabCode      Pr                                                                           
     D  pCode                         3s 0 CONST                                                    
                                                                                                    
     d DetailEntries   pr             7s 0                                                          
                                                                                                    
     D CheckOptnData   PR             1n                                                            
     D  DataIn                         *   value                                                    
     D  LenIn                        10i 0 value                                                    
                                                                                                    
     D OptionFound     Pr              N                                                            
     D  p_pgm                        10A   CONST                                                    
     D  p_pnl                        10A   CONST                                                    
     D  p_Opt                        10A   CONST                                                    
                                                                                                    
     d ClearOptnRec    Pr                                                                           
                                                                                                    
     d UpdOption       pr              n                                                            
                                                                                                    
     d DltOption       pr              n                                                            
                                                                                                    
     d AddOption       pr              n                                                            
                                                                                                    
     d SetOptnCursor   pr              n                                                            
     d   orderBy                    256a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                 256a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d GetNxtOption    pr              n                                                            
                                                                                                    
     d CloseOptionCursor...                                                                         
     d                 pr              n                                                            
                                                                                                    
     d GetPgmOption    pr            98a                                                            
                                                                                                    
     d SetOptionLvl    Pr                                                                           
     d  pLevel                        3a   const                                                    
                                                                                                    
     d SetOptnPgmID    Pr                                                                           
     d  pOpgm                        10a   const                                                    
                                                                                                    
     d SetOptnPnlID    Pr                                                                           
     d  pOpnl                        10a   const                                                    
                                                                                                    
     d SetOptionID     Pr                                                                           
     d  pOption                      10a   const                                                    
                                                                                                    
     d SetOptMacro     Pr                                                                           
     d  pMacro                       45A   const                                                    
                                                                                                    
     d SetOptnText     Pr                                                                           
     d  pText                        20A   const                                                    
                                                                                                    
     d SetOptnCall     Pr                                                                           
     d  pCallPgm                     10A   const                                                    
                                                                                                    
     d SetOptnParm     Pr                                                                           
     d  pPlist                       10A   const                                                    
                                                                                                    
     d SetOptnActn     Pr                                                                           
     d  pAction                       1A   const                                                    
                                                                                                    
     D CheckDefHeader...                                                                            
     D                 PR             1n                                                            
     D  DataIn                         *   value                                                    
     D  LenIn                        10i 0 value                                                    
                                                                                                    
     D FindDefHdr      pr              N                                                            
     D  p_DEFN                       10a   CONST                                                    
                                                                                                    
     d ClearDefHdr     pr                                                                           
                                                                                                    
     d UpdateDefHdr    pr              n                                                            
                                                                                                    
     d DeleteDefHdr    pr              n                                                            
                                                                                                    
     d InsertDefHdr    pr              n                                                            
                                                                                                    
     d SetDefineCursor...                                                                           
     d                 pr              n                                                            
     d   orderBy                    256a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                 256a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d NextDefHdr      pr              n                                                            
                                                                                                    
     d CloseDefHeader...                                                                            
     d                 pr              n                                                            
                                                                                                    
     d GetDefinition   pr            89a                                                            
                                                                                                    
     d GetNewTCode     pr                                                                           
                                                                                                    
     d SetDefName      Pr                                                                           
     d  pDEFN                        10a   const                                                    
                                                                                                    
     d SetDefDesc      Pr                                                                           
     d  pDesc                        50a   const                                                    
                                                                                                    
     d SetDefCode      Pr                                                                           
     d  pCode                         5S 0 const                                                    
                                                                                                    
     D GetTableHdr     Pr              N                                                            
     D  p_TAB                         5s 0 CONST                                                    
                                                                                                    
     D UserFound       pr              N                                                            
     D  p_User                       10A   CONST                                                    
                                                                                                    
     d ClearUserRec    Pr                                                                           
     d UpdateUser      pr              n                                                            
                                                                                                    
     d DeleteUser      pr              n                                                            
                                                                                                    
     d InsertUser      pr              n                                                            
                                                                                                    
     d SetUserCursor   pr              n                                                            
     d   orderBy                    256a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                 256a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d GetNextUser     pr              n                                                            
                                                                                                    
     d CloseUserCursor...                                                                           
     d                 pr              n                                                            
                                                                                                    
     d GetUserData     pr            87a                                                            
                                                                                                    
     d setUserName     Pr                                                                           
     d  pUser                        10A   const                                                    
                                                                                                    
     d setUserXdte     Pr                                                                           
     d  pXdate                        8s 0 const                                                    
                                                                                                    
     d setUserEdte     Pr                                                                           
     d  pEdate                        8s 0 const                                                    
                                                                                                    
     d setSubstitute   Pr                                                                           
     d  pUser                        10A   const                                                    
                                                                                                    
     d setUserEmail    Pr                                                                           
     d  pMail                        50A   const                                                    
                                                                                                    
     d ExpireUser      Pr                                                                           
     d  pUser                        10A   const                                                    
                                                                                                    
                                                                                                    
     d ActivateUser    Pr                                                                           
     d  pUser                        10A   const                                                    
                                                                                                    
                                                                                                    
     D CheckUserData   Pr             1n                                                            
     D  I_data                         *   value                                                    
     D  I_len                        10i 0 value                                                    
                                                                                                    
     D CheckUserCtl    PR             1n                                                            
     D  DataIn                         *   value                                                    
     D  LenIn                        10i 0 value                                                    
                                                                                                    
     D UsrCtlFound     Pr              N                                                            
     D  p_User                       10A   CONST                                                    
     D  p_Cat                         3A   CONST                                                    
                                                                                                    
     d ClearUsrCtl     Pr                                                                           
                                                                                                    
     d UpdateUsrCtl    pr              n                                                            
                                                                                                    
     d DeleteUsrCtl    pr              n                                                            
                                                                                                    
     d DltAllUsrCtl    pr              n                                                            
                                                                                                    
     d InsertUsrCtl    pr              n                                                            
                                                                                                    
     d SetUsrCtlCsr    pr              n                                                            
     d   orderBy                    256a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                 256a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d GetNextUsrCtl   pr              n                                                            
                                                                                                    
     d CloseUsrCtlCsr...                                                                            
     d                 pr              n                                                            
                                                                                                    
     d GetUsrCtl       pr            15a                                                            
                                                                                                    
     d SetUserCtl      Pr                                                                           
     d  pUser                        10A   const                                                    
                                                                                                    
     d setUserLevel    Pr                                                                           
     d  pLevel                        3a   const                                                    
                                                                                                    
     d setUserCat      Pr                                                                           
     d  pCategory                     3p 0 const                                                    
                                                                                                    
     D RetrieveObject  PR              N                                                            
     D  p_OBJ                        10a   CONST                                                    
     D  p_TYP                        10a   CONST                                                    
                                                                                                    
     d ClearObject     PR                                                                           
                                                                                                    
     d SetObjectCursor...                                                                           
     d                 PR              n                                                            
     d   orderBy                    256a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                 256a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d NextObject      PR              n                                                            
                                                                                                    
     d CloseObjectCursor...                                                                         
     d                 PR              n                                                            
                                                                                                    
     D GetObjectData   pr           197a                                                            
                                                                                                    
     D InsertObject    pr              n                                                            
                                                                                                    
     D UpdateObject    pr              n                                                            
                                                                                                    
     d DeleteObject    pr              n                                                            
                                                                                                    
     d SetObjCat       pr                                                                           
     d p_Cat                          3s 0                                                          
                                                                                                    
     d GetObjCat       pr             3S 0                                                          
                                                                                                    
     d SetObjSeq       pr                                                                           
     d p_Seq                          7s 0                                                          
                                                                                                    
     d GetObjSeq       pr             7S 0                                                          
                                                                                                    
     d SetObjNam       pr                                                                           
     d p_Nam                         10a                                                            
                                                                                                    
     d GetObjNam       pr            10a                                                            
                                                                                                    
     d SetObjTyp       pr                                                                           
     d p_Typ                         10a                                                            
                                                                                                    
     d GetObjTyp       pr            10a                                                            
                                                                                                    
     d SetObjDsc       pr                                                                           
     d p_Dsc                         50a                                                            
                                                                                                    
     d GetObjDsc       pr            50a                                                            
                                                                                                    
     d SetObjSrc       pr                                                                           
     d p_src                         10a                                                            
                                                                                                    
     d GetObjSrc       pr            10a                                                            
                                                                                                    
     d SetObjMbr       pr                                                                           
     d p_mbr                         10a                                                            
                                                                                                    
     d GetObjMbr       pr            10a                                                            
                                                                                                    
     d SetSrcLib       pr                                                                           
     d p_lib                         10a                                                            
                                                                                                    
     d GetSrcLib       pr            10a                                                            
                                                                                                    
     d CompileObject   pr                                                                           
     d YNFlag                         1    CONST                                                    
                                                                                                    
     d MoveObject      pr                                                                           
     d YNFlag                         1    CONST                                                    
                                                                                                    
     d MoveSource      pr                                                                           
     d YNFlag                         1    CONST                                                    
                                                                                                    
     d AlternateCmd    pr                                                                           
     d YNFlag                         1    CONST                                                    
                                                                                                    
     d SetObjLib       pr                                                                           
     d p_lib                         10a                                                            
                                                                                                    
     d GetObjLib       pr            10a                                                            
                                                                                                    
     D ObjectProcess   pr              n                                                            
                                                                                                    
     D ResetProcess    pr              n                                                            
                                                                                                    
     D ProcException   pr              n                                                            
                                                                                                    
     D ObjectObsolete  pr              n                                                            
                                                                                                    
     D ObjectExpanded  pr              n                                                            
                                                                                                    
     D getJobKey       PR             3A                                                            
                                                                                                    
     D setJobKey       PR                                                                           
                                                                                                    
     D padLoVal        Pr            40a                                                            
     D   stringIN                    40a   CONST                                                    
                                                                                                    
     D padHiVal        Pr            40a                                                            
     D   stringIN                    40a   CONST  
                      
     D helpURLfound    pr              N                                                            
     D  p_PGM                        10A   CONST                                                    
                                                                                                    
     d ClearHelpURL    pr                                                                           
                                                                                                    
     d UpdHelpURL      pr              n                                                            
                                                                                                    
     d DltHelpURL      pr              n                                                            
                                                                                                    
     d AddHelpURL      pr              n                                                            
                                                                                                    
     d SetHelpURLcsr   pr              n                                                            
     d   orderBy                     50a   CONST OPTIONS(*NOPASS)                                   
     d   selectOnly                  50a   CONST OPTIONS(*NOPASS)                                   
                                                                                                    
     d GetNextURL      pr              n                                                            
                                                                                                    
     d CloseHelpURLcsr...                                                                           
     d                 pr              n                                                            
                                                                                                    
     D GetHelpData     pr           110a                                                            
                                                                                                    
     d setHelpDoc      pr                                                                           
                                                                                                    
     d  pDoc                         50a   const                                                    
                                                                                                    
     d setHelpPgm      pr                                                                           
     d  pPGM                         10A   const                                                    
                                                                                                    
     d setHelpURL      pr                                                                           
     d  pURL                         50a   const                                                    
                                                                                                    
     D CheckHelpData   pr             1n                                                            
     D  I_data                         *   value                                                    
     D  I_len                        10i 0 value    

     D getCsrLoc       pr                      
     D   p_Row                        1a       
     D   p_Col                        1a       
     D   rowNbr                       3S 0     
     D   colPos                       3S 0     
                                                   
                                                                                                     

Development Strategy

With the introduction of the Integrated Language Environment (ILE) IBM offered a model of how to build models aimed at providing services from a common interface. Service programs are very much like Java classes. A Java class may be composed of a number of methods, bound together. If a class is imported to an application, the methods of the class are directly available to the application. Service programs may be composed of a single language, such as RPG, or constructed of modules of many different languages, C++, COBOL, CL, etc. The components of the service program are referred to as procedures and resemble methods. Like a class, once a program is bound to the service program, the application will have access to the procedures contained in the service program. System i tools, such as RDi, will allow service programs to be exposed as web services.

SoftCode Application Design

Modular Design Philosopy

The first programs I wrote were on the S/3 Mod 15D. The largest program you could present to the system was 16K, unless you took advantage of the Shared Virtual Area (SVA) which would allow you to max out a program at 48K. Obviously with only 16K to play with, programs were generally limited to a single function, and typically complex processes would have to be built with a job stream of small programs, sequentially staged to execute against a common set of files.

The S/38 had few limits in terms of program size and IBM did encourage monolith code development. I only attempted about 3 applications before I realized the model was all wrong. Yes, loading everything into main memory at once does mean that execution is fast (assuming your monstrous program does not get paged out, which they invariably did). But the trade-off in terms of maintainability simply wasn’t worth marginal performance gains.

I began looking for a better model for programs where functionality could be driven by database entries instead of “hard-coded” instructions. I made a conscious attempted to strip common functions out of programs and externalize as many of those functions as subprograms. From that point forward, all my applications were modular in nature, limited in function and database driven.

I borrowed an idea from Bob Cozzi, Jr. to place program function keys into a database file and have a program react to the instruction on file, rather than react to the function key itself. I was able to externalize functions, separating function definitions from the program. The process was extended to include external program options and designed database files to contain program options and function keys, turning them into macro instructions.

At the time the AS/400 was introduced, the payback to this methodology became clear. Converting from the S/38, where F1 was an exit key to the AS/400, where F3 was the exit key, the programs designed with soft-coded functions did not require any changes, only the database file was updated—F1 entries in the function key database were simply updated to read F3, instead of F1. No programs or displays were changed in order to implement the new system standard of F3 as the exit function.

Shortly after the AS/400 arrived I incorporated a gate-level application security system into the code. This, in effect, made application security an external function, controlled by a database file. I also introduced external program help, by incorporating a generic help processor into the soft-coded function key processor. (The concept of externalized help processes took shape after a COMMON discussion with Carson Soule.)

As the IBM mid-range platform evolved, I began updating what I had come to think of as the soft-coded application model. I began developing a method of separating presentation from data. This was more of an evolutionary step, rather than a revolutionary step. Having created a mechanism for external options, function keys, application security, and help, web or not, the next logical step was to separate the presentation layer from the business rules of the data. With the advent of ILE, this became the suite of SOFTCODE service programs.

    Development Objectives

  • 1) Leverage existing applications
  • 2) Help provide web services
  • 3) Require minimal training of technical personnel

New interactive application models should be designed with ILE in mind. Binding to the SOFTCODE service program to manage function key use and program options leaves a programmer free to create an application program independent of command key assignments, or program options. With the support programs in place, the Soft Coded Function keys (SCF), and Soft Coded Program options (SCP) allow for the development of concise data-centric application programs.

As with any application development effort, keep in mind a few rules. Whether using Soft Code design templates or not, do not write programs that attempt to perform too many functions. Rule of thumb for RPG program source code:

Coding Recommedations

  • a) A program under 650 lines is ideal.
  • a) A program of 700-900 lines is acceptable.
  • b) A program of 1,200 lines is unwieldy.
  • c) A program of 1,500 lines is approaching unmanageable.
  • d) A program of 1,700 lines is unmanageable.
  • e) A program of 2,000 lines could be considered epic.
  • f) A program over 2,000 lines is something used to terrify rookie programmers.