Informix 4GL and EGL: IBM Software Group / DB2 Information Management
Informix 4GL and EGL: IBM Software Group / DB2 Information Management
Informix 4GL and EGL: IBM Software Group / DB2 Information Management
Disclosure Information
Agenda
EGL
EGL .....
Lots of similarities.
– Basic statements and looping constructs are similar.
– SQL statements are similar to 4GL (prepare, execute,
open, get (fetch), close and for each).
– Text user interface similar (with a more general
programming model) to I4GL with extended capabilities.
– Reporting framework provides for a wider set of output
formats (PDF, Text, XML, CSV, HTML).
– A highly interactive and visual debugging environment
based on the Eclipse framework.
funcName(param1,param2);
prepare stmtid from "select fname,lname prepare stmtid from "select fname,lname
from customer where customer_num=10" from customer where customer_num=10";
END // LIBRARY
Records
Different types…
– Basic Records
– SQL Records
– Serial Records
– Indexed Records
– MQ Records.
Record type identifies the I/O that can be done
Same statements are used for different Record types
No I/O with Basic records.
Records
get next get next record get next record get next record get next message
get previous n/a get previous record get previous record n/a
Record definition
Record CustomerRecord type SQLRecord {tableNames=("customer") }
customer_num int {column=customer_num};
fname char(15) {column = fname};
lname char(15) {column = lname};
company char(20) {column = company};
address1 char(20) {column = address1};
address2 char(20) {column = address2};
city char(15) {column = city};
state char(2) {column = state};
zipcode char(5) {column = zipcode};
phone char(18) {column = phone};
end
A default SQL statement is generated for every SQLRecord
The SQL column information can be extracted using the IDE.
if(sqlcode = 100)
exit while;
end
end
onException
End
get myCustomerArray;
Create a serialRecord.
Record FileRecord type serialRecord {filename="customer"}
customer_num num(10);
fname char(15);
lname char(15);
End
Create a Resource Association.
Write your code.
myfilerecord FileRecord;
myfilerecord.customer_num = 100;
myfilerecord.fname = “John”;
myfilerecord.lname = “Doe”;
add myfilerecord;
Easy MQ handling.
– Create Record definitions.
Record myMQRecord type MQRecord { queueName = "mqRA" }
fname char(10);
lname char(10);
End
– Create a Resource Association between the queueName attribute and the MQ system.
– Write your code.
mqr myMQRecord;
mqr.fname="Venkatesh";
mqr.lname="Gopal";
add mqr;
get mqr;
– Take full advantage using a package called “MQReusableParts”, a part of your
standard distribution.
*Internal Study
Invokes EGL
Response
JSP
(View) EGL
Conversion Assumptions
Conversion Artifacts
Configuration file
– XML file generated from interaction with conversion wizard
– contains required conversion project information
Manifest file
– XML file generated during conversion of shared libraries
– contains declaration and usage information about each of the functions
(C and I4GL) used in the shared library
– used to resolve function declarations in dependent I4GL shared libraries
– required for subsequent I4GL source code conversions
Log file
– contains warnings and errors
– status of each source file
– summary of conversion
Database metadata
– conversion creates EGL packages for each database used in the
project
– schema metadata will become a separate EGL project which can
be referenced by other EGL projects
Shared libraries
– conversion generates Manifest file and makefile
I4GL source files
– .4gl files
– .per (form) files
– message files
Pre-Conversion Tasks
Identify & locate all the components of the 4GL
application to be converted
– (.4gl, .per, message files, shared libraries)
Identify connection information for each database used
Start Informix database instances
Mount/copy source code to EGL development machine,
if required
Determine destination directory for converted EGL
source code & conversion artifacts
Identify “Client” locale – used to convert message files
Conversion tool…
Conversion tool….
Post-Conversion Tasks
Conversion Limitations
form.per BL BL
BL C functions
main.4gl BL
c_code.so
inventory.4gl
catalog.4gl
Text
IDS
Reports
C functions
Text
Reports c_code.so
SchemaLib.egl
BL BL
BL
main.egl BL
form.egl inventory.egl
catalog.egl
Webinventory.egl
Use your I4GL
Business
Logic with
Message
Queues
HTML
DB2 IDS Output
XML
Output
PDF
Output
C functions
Text
c_code.so
SchemaLib.egl Reports
BL BL
BL
main.egl BL
inventory.egl
catalog.egl
EGL Releases…
EGL information
EGL site
http://www-128.ibm.com/developerworks/rational/products/egl/
EGL downloads
http://www-106.ibm.com/developerworks/rational/library/egldoc.html
http://www.ibm.com/software/data/informix