Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts including news, tips, and advice to help you do your job more efficiently and effectively. Stay informed on the hottest topics and biggest challenges faced by IT professionals working with iSeries products and services.
As an example:
D/Copy CustInfoDS
D Rc S 10I 0
...
C Eval Rc = GetCustomerInfo(CustNum:CustInfoDs)
C If Rc < 0
C Eval ErrData = %Editc(CustNum:'Z')
C Eval Rc = SndMyMsg("INVCUSTNUM":ErrData)
C Iter
C Else
C Eval Rc = CalcEOMAmounts(CustNum:CustInfoDs)
C If Rc < 0
C Eval ErrData = %Editc(CustNum:'Z')
C Eval Rc = SndMyMsg("CALCEOM":ErrData)
C Iter
C Else
C Eval Rc = UpdCustomerInfo(CustNum:CustInfoDs)
C If Rc < 0
C Eval ErrData = %Editc(CustNum:'Z')
C Eval Rc = SndMyMsg("CUSTUPD":ErrData)
C Iter
C Endif
C Endif
C Endif
This would assume that standard modules for retrieval, calculation and updating of customer information would return a -1 for failure and a standard error routine to send the message to the user or joblog for batch processes. In COBOL, this would likely be hundreds of lines of code for file definition, retrieval and error message handling. The simplification of coding and maintenance should be apparent. Separate business logic from physical data logic and user interfaces allows the routines to be quickly adapted to different applications and environments.
================================== MORE INFORMATION ON THIS TOPIC ==================================
The Best Web Links: tips, tutorials and more.
Ask your programming questions--or help out your peers by answering them--in our live discussion forums.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.
This was first published in December 2003