Escolar Documentos
Profissional Documentos
Cultura Documentos
Presented by: Jim Low Arturo Duarte, Jr. Wednesday, September 25, 2002
9/24/2007
Countrywide Home Loans, 2002-2003, All rights reserved
9/24/2007
Faster Coding
Easy to start and end Free Form
Calculation section start with: /Free (column 7) Calculation section end with: /End-Free (column 7)
Easier to Understand
Reading a file
ReadE(EN) filekey filename; Compared to: C FileKey ReadE(EN) C Read(EN)
filename filename
Calling a subprocedure
Procname(P1 : P2 : P3 : : Pn); Compared to: CALL ProcName PLIST CALLP ProcName(P1 : P2 : . . . : Pn) EVAL RtnValue = ProcName(P1 : P2 : : Pn)
9/24/2007 5
Better way:
MM = %SubDt(SomeDate:*Month);
Even better:
If %SubDt(SomeDate:*Month) = ReportMonth;
Date Conversion:
newDateFormat = %char( %date( oldDateFormat: *YMD): *MDY) ;
%Occur (Set occurrence of a multiple occurrence data structure) %SHTDN (determining if the operator has requested shutdown) %CHAR (Input Value to character conversion includes
numeric, date, time, timestamp, graphic, and UCS-2)
9/24/2007
Bit Operations
BITON; BITOFF; TESTB
9/24/2007
What we Discovered
An overall 10% improvement in programming speed (based on measurement of time to create new Display File
programs for CHL-CHL Refi Application)
Clarity in programming A strong need for Best Practices (better yet: Standards) Think about what is needed first (i.e. define needed
variables then develop solution)
9/24/2007
9/24/2007
10
Information Sources
IBM RPG/LE V5R1/V5R2 manuals iSeries News Contact with other experts (both in house and
external).
9/24/2007
11
9/24/2007
12
9/24/2007
13
9/24/2007
14
BitWise BIFs (%BITAND; %BITOR; %BITXOR; etc.) Complex Data Structures (DIM use at the DS line level;
DIM on each sub-field; and DIMs within each sub-field)
Conclusion: Free-Form
Is Quicker Is Easier to Understand Helps enforcement of good programming practices Takes advantage of current coding technology Supports business vision and strategic initiatives.
9/24/2007 * 17
9/24/2007
18
9/24/2007
19
9/24/2007
20
9/24/2007
21
Examples of FreeForm/CODE400
9/24/2007
22