Using Perl on an AS/400 / iSeries Presented by David Mount – Owner of Texas400 Computer Consulting See www.texas400.com for more on Perl on thewww.texas400.com.

Slides:



Advertisements
Similar presentations
PowerPoint presentation of first 25 pages of instructional manual Edith Fabiyi Essentials of Internet Access.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Server-Side vs. Client-Side Scripting Languages
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Layer 7- Application Layer
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Internet…issues Managing the Internet
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
INTERNET DATABASE. Internet and E-commerce Internet – a worldwide collection of interconnected computer network Internet – a worldwide collection of interconnected.
1 Static Web Pages Websites on Servers (The Big Picture) –Apache Tomcat can support static web pages –Primarily intended to support servlets and JSP –Some.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Lesson 19 Internet Basics.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
WebReport/400 TCP/IP Configuration Presented by Kisco Information Systems.
Chapter 6: Hostile Code Guide to Computer Network Security.
Web Design Terms and Concepts Ms. Scales. Q. What is a Server? A. A server is a computer that stores information many people can access. It runs special.
Installing Ricoh Driver. Items you need to know IP address of Printer Options that are installed And Paper Sizes To get all this information you can print.
Hands-On Microsoft Windows Server 2008 Chapter 8 Managing Windows Server 2008 Network Services.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
ITIS 1210 Introduction to Web-Based Information Systems Chapter 24 How Websites Work with Databases How Websites Work with Databases.
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
Chapter 1: Introduction to Web
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Chapter 10 Intro to Routing & Switching.  Upon completion of this chapter, you should be able to:  Explain how the functions of the application layer,
FTP (File Transfer Protocol) & Telnet
Chapter 8 The Internet: A Resource for All of Us.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Application Layer Functionality and Protocols.
Tutorial: Web Publishing. Web Publishing Tutorial IS for Management2 Web Publishing Web pages are stored on a Web server: a computer with a unique Web.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
HTML Hyper Text Markup Language A simple introduction.
MySQL and PHP Internet and WWW. Computer Basics A Single Computer.
Hour 7 The Application Layer 1. What Is the Application Layer? The Application layer is the top layer in TCP/IP's protocol suite Some of the components.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 Welcome to CSC 301 Web Programming Charles Frank.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
MC365 Application Servers, Servlets, and Java Server Pages (JSP’s): Tomcat.
Computational Boot Camp HTML Mike Schaffer. 8/23/2002 (MES) HTML What is HTML? HTML stands for HyperText Markup Language HTML is the language for publishing.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Form Processing Week Four. Form Processing Concepts The principal tool used to process Web forms stored on UNIX servers is a CGI (Common Gateway Interface)
17 Establishing Dial-up Connection to the Internet Using Windows 9x 1.Install and configure the modem 2.Configure Dial-Up Adapter 3.Configure Dial-Up Networking.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
Integrity Check As You Well Know, It Is A Violation Of Academic Integrity To Fake The Results On Any.
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.
2nd year Computer Science & Engineer
Distributed Control and Measurement via the Internet
CoreFTP.
Configuring Internet-related services
CoreFTP.
Applications Layer Functionality & Protocols
Web Application Development Using PHP
Presentation transcript:

Using Perl on an AS/400 / iSeries Presented by David Mount – Owner of Texas400 Computer Consulting See for more on Perl on thewww.texas400.com iSeries / AS400

Reasons to Pay Attention You may actually want to provide the public or your users with internet access to some of your data – PERL is an easy and FREE way to do this PERL is a great way to learn about CGI programming as well at HTML and HTTP server Someday, you may have the chance to port a PERL application to your iSeries

Typical Computer User’s Understanding of AS/400 / iSeries What’s an AS/400? What’s an iSeries? Old architecture that uses green screens Programs written in RPG Runs applications written 10 to 15 years ago Doesn’t belong in the same sentence as “internet” Upload data via PC Support or Client Access Really different from world of PC’s and internet Isolated from rest of world

We have the opportunity to educate the IT public about AS400 / iSeries Internet Accessible – Free Telnet products ( Uploads and Downloads over internet with FTP Internet remote printing to IP addressable printers SMTP Server – Send s HTTP Server – web hosting Various CGI programming capabilities

Career questions to keep you awake at night What programming language should I be learning? What computer platform will be in use in 5 to 10 years? What can I learn today that will still be valuable in 5 to 10 years?

Answer to these questions is: The Internet

TCP-IP issues are the same regardless of the platform Once you configure FTP Server on AS/400, you already know how to do it on Windows The FTP client on OS/400 is operationally very similar to the FTP on windows and Linux Getting the SMTP server working involves learning about DNS, mail forwarding, third party relay

Roadmap of next 25 slides Write a “Welcome to my page” static HTML page Use PERL to output “Hello World” to browser Write an HTML form to accept PERMIT# Write a PERL program to process the CGI data, lookup the permit inspections and write to browser Use a link to look up specific info about an inspection Read a non-keyed file and write it to the browser

Non platform specific things to know for web site programming HTML formatting – Static HTML – Forms with fields – Links with Query Strings How to FTP HTML to web server Web server configuration Default folder, CGI-BIN directory

Http Server Directives for Static HTML So that a browser going to my AS/400 will be served the HTML in “index.html” in the “html” folder (get there with WRKLNK), use these two directives: Pass /* /html/* Welcome index.html There is nothing magic about the HTML folder. I created it from the WRKLNK screen

To make a “Welcome” page Use a PC to create a document named “index.html” with the following: Welcome to my home page Use FTP to put that document in the HTML folder Specifically, connect to with remote directory of /html Use a browser to go to and you should see the Welcome page

Download and Install PERL PERL (Practical Extraction and Report Language) An interpretted language (don’t compile) Written in C as a quick and dirty language Used by Unix administrators for years Probably the most common CGI programming language to download the free library

PERL Resources Vast supplies of sample code on the internet Many Perl and CGI / PERL books “Writing CGI Applications with PERL” by Kevin Meltzer and Brent Michalski

PERL Executable Code I used WRKLNK and MD PERL commands to create a directory named PERL I FTP my PERL documents to the PERL directory

Hello World Program Use notepad to create a document named Hello.PL #!/usr/bin/perl use CGI qw/:standard/; print header; print ' '; print 'Hello World'; print ' '; FTP document to AS/400

Configure HTTP Server for CGI Enable GET Enable HEAD Enable POST EXEC /cgi-bin/* /QSYS.LIB/T40CGI.LIB/*.PGM %EBCDIC%

CL Program Compile a CL program named HELLO CALL PGM(PERLDIST/PERL) + PARM('/PERL/HELLO.PL') Program must be where you told the HTTP server that CGI-BIN programs are. In my case, the library T40CGI Make sure QTMHHTTP and QTMHHTP1 have authority to everything

Program execution time! When browser goes to /cgi-bin/hello The HTTP server maps anything coming to “cgi-bin” to T40CGI library So, HTTP server tries to run the program HELLO from T40CGI library

What is CGI? Common Gateway Interface A defined standard for executing programs with parameters Conceptually similar to a DDS display file Invoke a CGI program with either a link from a web page or a submit button on a form Data arrives as a string of field names and values: gtpermit.pgm?PERMT=1234&USR=David

Different ways to process CGI RPG ILE program using IBM supplied API’s (see Brad Stones’s eRPG book) IBM’s Easy400 tool (see www-922.ibm.com) 3 rd Party Products like ProGen WebSmart PERL

CGI form with submit button --- named GTPERMIT.HTML Permit#

Program Execution Time! When submit button is clicked: String “ /cgi-bin/gtpermit?PERMT=1234” Goes to IP address The HTTP server maps anything coming to “cgi-bin” to T40CGI library So, HTTP server tries to run the program GTPERMIT with the query string of ?PERMT=1234 We need a program named GTPERMIT to read this value and respond

Use SQL to read AS/400 database Need to read value from CGI form and then… Build the SQL string: SELECT * FROM T40CGI/INS WHERE INSPMT = ‘1234’ and then… Show the data

Put new Perl program on AS400 FTP this Perl program named “gtpermt” to the AS/400 Create a CL to run it Make sure the database and the CL program are usable by QTMHTTP and QTMMHTP1 Click on the submit button

Add a link to see details of inspection Add this line as the last column of table: print q( <a href=showdetl?PERMT= $data->{INSPMT}&TYP=$data->{INSTYP} >Details \n); Builds a string like: Details

Perl Program named showdetl.pl Get parms from query string Build the SQL string: SELECT * FROM T40CGI/INS WHERE INSPMT = ‘1234’ AND INSTYP = ‘DW’ and then… Show the data

Put new program on AS/400 FTP this Perl program named “showdetl” to the AS/400 Create a CL to run it Make sure the CL program is usable by QTMHTTP and QTMMHTP1

At Your Next Company Meeting Can users use the internet to get on the iSeries? Can people upload and download data from the AS400 over the internet? Can our computer host web pages? Can we process CGI input? Can we run PERL?

Duh!!!! It’s an AS/400!