Professional Documents
Culture Documents
March 2014
Abstract
§ Many IBM i developers have not stepped out of their PDM comfort zone.
They may code well in RPGIV, use ILE correctly, and build amazing
applications. IBM, however, have moved on, delivering modern integrated
development tools, enhancements to our core languages, and much more
capability in our IBM i operating system and database. The IBM i
community is beginning to take advantage of all these new capabilities,
although it requires research and learning.
§ While there is no quick fix to get us all up to speed, this session is
intended to touch on a wide swath of relevant topics while increasing the
confidence level of the IBM i developer. If you are wondering where to
start, this event will show you how. It covers a range of available tools,
languages, technologies, and more, that are available on IBM i. Attendees
will learn how to access the resources needed to get started with each.
2
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
§ http://ibmsystemsmag.blogs.com/you_and_i/
§ It’s announce day again, so it’s time for a blog about the
latest capabilities we’re announcing related to IBM i.
§ Once again, there are a number of different areas being
enhanced.
§ I can’t even touch on all of them, but here are highlights in
four key areas.
– DB2
– Ruby
– ARE
– RPG
§ It’s announce day again, so it’s time for a blog about the
latest capabilities we’re announcing related to IBM i.
§ Once again, there are a number of different areas being
enhanced.
§ I can’t even touch on all of them, but here are highlights in
four key areas.
– DB2
– Ruby
– ARE – Application Runtime Expert
– RPG
Wait! What?
Ruby
§ Those of you who have been interested in having IBM i adopt
the Ruby programming language more closely will be
interested to hear about PowerRuby (Check out Tim Rowe’s
blog.)
Modern-i-zation
§ http://iprodeveloper.com/blog/modern-i-zation
Wait! What?
Free-Form RPG
§ The most exciting new feature in TR7 for the application
development crowd is a major change to the RPG language.
In previous releases, we've been focused on making RPG "a
modern business language.”
§ This statement has been a driving force behind many of the
new updates and advancements we've made to RPG.
§ But inTR7, we've taken this to a whole new level.
§ NO!
§ Ruby!
§ In addition, we've written an IBM i DB2 "gem" that gives you
native IBM i database access from Ruby leveraging the
normal Ruby methodologies.
§ We've also been updating the XML service support to ensure
that it works when you're accessing your native IBM i artifacts
(programs, data areas, data queues, system values, and
many more).
§ The Ruby and Rails support will be available for Beta by the
end of October.
§ Follow the PowerRuby.com home page for details…
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
Rails
Resources
§ http://www.powerruby.com
§ http://rubyonrails.org
§ https://www.ruby-lang.org
Ruby – in summary
§ Now:
– running on IBM i
– connected to IBM i DB2
dcl-ds employeeDS;
firstName char(16) Inz('James');
lastname char(30) Inz('Joyce');
salary packed(7:2) Inz(12500);
end-ds;
§ http://ibmsystemsmag.blogs.com/isight
§ http://ibmsystemsmag.blogs.com/idevelop
§ http://ibmsystemsmag.blogs.com/idevelop/2013/10/as-you-
may-have-already-heard-there-was-a-major-technology-
refresh-tr-announcement-yesterday-check-out-fellow-blogger-
st.html
Other Resources
§ IBM i 7.1
Programming
IBM Rational Development Studio for i
ILE RPG Reference
– http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/books/
sc092508a.pdf
§ IBM software
§ Third party tools
Wait! What?
§ Documentation
– http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzamm/rzamm.pdf
Navigator for i
Navigator for i
Navigator for i
Navigator for i
Navigator for i
Navigator for i
§ Zend PHP
PHP
PHP code
<!DOCTYPE html>
<meta charset="utf-8">
<title>PHP Test</title>
<?php
echo 'Hello World';
?>
Wait! What?
<!DOCTYPE html>
<meta charset="utf-8">
<title>PHP Test</title>
<?php
echo 'Hello World';
?>
§ HTML
– Markup Language
§ CSS
– Style Sheets
§ Javascript
– Client side scripting
HTML
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
CSS
body {
background-color:#d0e4fe;
}
h1 {
color:orange;
text-align:center;
}
p {
font-family:"Times New Roman";
font-size:20px;
}
CSS
body {
background-color:#d0e4fe;
}
h1 {
color:orange;
text-align:center;
}
p {
font-family:"Times New Roman";
font-size:20px;
}
Javascript
<!DOCTYPE html>
<html>
<body>
<h1>My First JavaScript</h1>
<p id="demo">This is a paragraph.</p>
<button type="button" onclick="displayDate()">
Display Date
</button>
</body>
</html>
Javascript
<!DOCTYPE html>
<html>
<head>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>
...
</body>
<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>
<?php
$txt1="Learn PHP";
$txt2="W3Schools.com";
$cars=array("Volvo","BMW","Toyota");
echo $txt1;
echo "<br>";
echo "Study PHP at $txt2";
echo "My car is a {$cars[0]}";
?>
HTML Table
<?php
$rows = 10; // define number of rows
$cols = 4;// define number of columns
echo "<table border='1'>";
for($tr=1;$tr<=$rows;$tr++){
echo "<tr>";
for($td=1;$td<=$cols;$td++){
echo "<td>row: ".$tr." column: ".$td."</td>";
}
echo "</tr>";
}
echo "</table>";
?>
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
Wait! What?
§ PHP
for($td=1;$td<=$cols;$td++){
echo "<td>row: ".$tr." column: ".$td."</td>";
}
§ Javascript
for(td=1;td<=cols;td++){
document.write("<td>row: "+tr+" column: "+td+"</td>”);
}
Wait! What?
§ PHP
for($td=1;$td<=$cols;$td++){
echo "<td>row: ".$tr." column: ".$td."</td>";
}
§ RPG
td = 1;
DOW td < cols;
htmlfield = "<td>row: “+tr+" column: ”+td+"</td>”;
write outfmt;
count += 1;
ENDDO;
That’s better!
§ PHP
for($td=1;$td<=$cols;$td++){
echo "<td>row: ".$tr." column: ".$td."</td>";
}
§ RPG
FOR td = 1 by 1 to cols;
htmlfield = "<td>row: “+tr+" column: ”+td+"</td>”;
write outfmt;
ENDFOR;
CGI on IBM i
§ One example
– http://www-03.ibm.com/systems/i/software/http/examples/samplerpg/
rpg_demo.html
– HTML page
– RPG program
• Using BNDSRVPGM(qhttpsvr/qzhbcgi)
– HTTP Server
• Configured to support CGI
http://server:port/rpgcgi.html
http://server:port/rpgcgi.html
79
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
http://server:port/rpgcgi.html
80
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
DBREAK C '<br>'
*******************************************************
**** Send BufOut to standard output.
*******************************************************
C CALLB APISTDOUT
C PARM BUFOUT
C PARM BUFOUTLN
C PARM QUSEC
**CTDATA HTML
CONTENT-TYPE: TEXT/HTML
<html>
<head>
<TITLE>Sample IBM i RPG program executed by HTTP server
as a CGI</title>
</HEAD>
<body>
<H1>SAMPLE IBM i RPG PROGRAM.</H1>
<br><br>
http://server:port/rpgcgi.html
85
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
§ Web Services
– *PGM
– *SRVPGM
Navigator for i
89
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
90
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
91
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
92
© 2014 Trevor Perry
"What Can i do?" An IBM i Developer's Introduction to Everything!
§ Web Services
– *PGM
– *SRVPGM
§ PCML
Javascript + JQuery
function FreezeGridHeader() {
Javascript + JQuery
// Remove the existing scroll from the table
tableParent.removeStyleProperty('-ms-overflow-y');
}
}
}
}
§ Javascript rules!
§ Javascript rules!
But, seriously…