The Integrated Language Environment (ILE) has opened up application development on the iSeries to new models. ILE models can take advantage of modules, service programs, and activation groupds.

Service programs are one way to help develop reusable code and provide standards-compliance. But putting common functions in a service program, and binding applications to the service program, application programs become more consistent. Date calculations are a prime example of code routines that need to be consisent and re-usable. If dates are calculated in two separate programs, sooner or later the rules in one of the applications will vary from the rules in another calculation. (Multiply that by the number of developers on staff.)

Putting common date calculations in a service program means that those calculations are not necessary in any other program. Simply bind to the service program and make a funciton call from the bound program. This way all programs get the result of the same calculation.

Binder Language

STRPGMEXP PGMLVL(*CURRENT)
SIGNATURE(X'7DA910DAEFD0F8A1C38431F47C9A457F')
/****************************************************************/   
/*   *SRVPGM      SWDATRRI     CROYS        02/19/09  10:36:21  */   
/****************************************************************/   
  EXPORT SYMBOL("CENTERTXT")   
  EXPORT SYMBOL("CHECKDATE")   
  EXPORT SYMBOL("COMMAND")     
  EXPORT SYMBOL("CVTTODATE6")  
  EXPORT SYMBOL("CVTTODATE7")    
  EXPORT SYMBOL("CVTTODATE8")   
  EXPORT SYMBOL("CVTTOJULIAN")   
  EXPORT SYMBOL("CYMDDATE")            
  EXPORT SYMBOL("DATETEXT")   
  EXPORT SYMBOL("DATETODAY")   
  EXPORT SYMBOL("DAYOFWEEK")     
  EXPORT SYMBOL("DAYOFYEAR")    
  EXPORT SYMBOL("DELAYJOB")  
  EXPORT SYMBOL("DMYDATE")    
  EXPORT SYMBOL("GETJOBATR")   
  EXPORT SYMBOL("GETNUM")        
  EXPORT SYMBOL("GETQUARTER")    
  EXPORT SYMBOL("ISODATE")       
  EXPORT SYMBOL("JULIANDATE")    
  EXPORT SYMBOL("LOWERCASE")     
  EXPORT SYMBOL("MDYDATE")       
  EXPORT SYMBOL("QUARTERENDED")  
  EXPORT SYMBOL("QUARTERSTARTED")
  EXPORT SYMBOL("RTVSYSNAME")    
  EXPORT SYMBOL("SETDAY")        
  EXPORT SYMBOL("SETMONTH")      
  EXPORT SYMBOL("SETYEAR")       
  EXPORT SYMBOL("TESTZONED")     
  EXPORT SYMBOL("TIMENOW")       
  EXPORT SYMBOL("TIMESTAMPED")   
  EXPORT SYMBOL("UPPERCASE")     
  EXPORT SYMBOL("USADATE")       
  EXPORT SYMBOL("YMDDATE")       
ENDPGMEXP   

CRTRPGMOD MODULE(MYLIB/SWDATRRI) 
   SRCFILE(MYLIB/QRPGLESRC) DBGVIEW(*SOURCE)

CRTSRVPGM SRVPGM(MYLIB/SWDATRRI) 
   MODULE(SWDATRRI SWUTILRI) EXPORT(*ALL) 
   SRCFILE(MYLIB/QSRVSRC) 
   TEXT('Common date routine service program') 
   ACTGRP(QILE) 

RTVBNDSRC SRVPGM(MYLIB/SWDATRRI) SRCFILE(MYLIB/QSRVSRC)
	  
	

Contents