+ All Categories
Home > Documents > D:Venturae-rpg Section 3 - MC Press...

D:Venturae-rpg Section 3 - MC Press...

Date post: 08-Nov-2018
Category:
Upload: dinhque
View: 218 times
Download: 0 times
Share this document with a friend
16
APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG Applica- tions for a Connected World contains all of the source code presented in this book as examples. The CD-ROM also contains a readme.txt file that further describes the contents and directions to upload the source to your AS/400. To use this code on an AS/400 you will need a PC with file transfer capability at- tached to your AS/400. Products such as IBM’s PC Support, Client Access or even FTP are recommended. The source included in this book is meant to serve as example only and not as a working example application. You may find that it does not perform exactly the same on your machine as described in the text. However, you may find the code helpful when used as a base for your own applications. The code on the CD-ROM is organized in folders by chapter as follows: HTML The HTML Folder contains the HTML source code for examples given in this book. 363
Transcript
Page 1: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

APPENDIX

The CD-ROM that you receive with e-RPG(v2): e-Volving RPG Applica-tions for a Connected World contains all of the source code presented in

this book as examples. The CD-ROM also contains a readme.txt file that furtherdescribes the contents and directions to upload the source to your AS/400.

To use this code on an AS/400 you will need a PC with file transfer capability at-tached to your AS/400. Products such as IBM’s PC Support, Client Access oreven FTP are recommended.

The source included in this book is meant to serve as example only and not as aworking example application. You may find that it does not perform exactly thesame on your machine as described in the text. However, you may find the codehelpful when used as a base for your own applications.

The code on the CD-ROM is organized in folders by chapter as follows:

HTMLThe HTML Folder contains the HTML source code for examples given in thisbook.

363

Page 2: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

QDDSSRCThe QDDSSRC Folder contains physical and/or logical file descriptions for ex-amples given in this book.

QRPGLESRCThe QRPGLESRC folder contains the RPG source for programs used as exam-ples in this book.

QMODSRCThe QMODSRC folder contains RPG module source for modules and/or serviceprograms used as examples in this book.

QSRVSRCThe QSRVSRC folder contains /COPY prototype source and/or binder languagesource used as examples in this book.

IMAGESThe IMAGES folder contains any necessary images used in examples in thisbook.

All source members are named with the same name as the members used as ex-amples in this book.

The code should be properly aligned after being uploaded.

364

APPENDIX

Page 3: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

INDEX

Aabsolute pixel size in frames, 21AccessLog directive in, 69-70, 69AccessLogArchive directive in, 73AccessLogExpire directive in, 74AccessLogSizeLimit directive in, 74activation groups, in ILE and, 90-92active user file for GreenYak chat, 337active user list in GreenYak chat, 340-342, 341AddType configuration in, 82-84, 83AgentLog directive in, 72, 72alert() in JavaScript, 30, 36, 43-44, 43, 44, 47Apache Web server, xvii, 316application programming interfaces (APIs), xix,

159-177CGI Parse (QzhbCGIParse) in, 160, 172-177,

196-207#CGIParse wrapper in, 196-207, 197-198, 199Convert to Database (QtmhCvtDB) in, 160,

167-171, 191-195Convert URL to Path (QzhbCvtURLtoPath) in, 177#CvtDB wrapper for, 191-195, 191-192Get Environment Variable (QtmhGetEnv) in,

163-165, 184-187#GetEnv/#GetEnv2 wrappers in, 184-187, 184, 185ILE and, 159, 180

Integrated File System (IFS) and, 209-210Produce Full HTTP Response (QzhbCGIUtils) in,

177Put Environmental Variable (QtmhPutEnv) in,

171-172, 195-196#PutEvn wrapper in, 195-196, 196QTMHCGI service program for, 160-161, 180QZHBCGI service program for, 160-161, 180#RdStin/#RdStin2 wrapper for, 187-191, 188, 189Read Standard Input (QtmhRdStin) in, 165-167,

187-191Retrieve Directive (QzhbRetrieveDirective) in, 177service program for, 160TCGIPARSE program in, 199-207, 199-206, 207TCVTDB program for, 192-195, 193, 194, 195TGETENV program for, 185-187, 186, 187TRDSTIN program in, 189-191, 189-190, 191TWRSTOUT program example in, 182-183, 182,

183#WrStout wrapper for, 180-183, 181-183, 211,

226-237wrappers for, 159, 180Write Standard Output (QtmhWrStout) in,

161-163, 180-183, 211, 226-237

Note: Boldface numbers indicate illustrations. 365

Page 4: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

AS/400, xviiAuthType protection subdirective in, 61-63, 62autorefresh

GreenYak chat, 347HTTP-EQUIV Meta tags in, 9-10

Bbatch (BCH) jobs, 255batch immediate (BCI) jobs in, 254-256bind by copy in ILE and, 88, 91, 98bind by reference in ILE and, 88-89, 91, 99, 100-107Bind Service Program (BNDSRVPGM) command, 101binder language in ILE and, 89, 92, 102-103binding directories in ILE, 89-90, 92, 107-109, 109BindSpecific directive, 81-82, 81blacklist file for GreenYak chat, 338<BODY> tag, 280, 288, tags, 292boundary, in Upload Files application, 324Browse button, 322built-in functions (BIFs), xix, 86

CCache Control HTTP header, 7caching

Cache Control HTTP header, 7Expires HTTP header and, 6-7Pragma HTTP header, 7, 8Web site design example and, 286

CALLER activation groups in ILE and, 90cascading stylesheets in, 13-20, 280-281, 280case conversion, #ToUpper/#ToLower, 218-219CGI Parse (QzhbCGIParse) in, 160, 172-177, 196-207CGI programming, xviii

application programming interfaces (APIs) in,159-177

CGI Parse (QzhbCGIParse) in, 172-177, 196-207#CGIParse wrapper in, 196-207, 197-198, 199#ExecCGI (execute CGI as SSI) in, 215-216, 216F.HTTPSTD standard HTTP function in, 179-207hidden fields and, 11-12HTML and, 2-4HTTP headers and, 4-8Meta tags in, 9-11server side includes (SSI) and, 215-216, 266simple formatting using, 13-16, 13-16Upload Files application, 321-331, 322-330, 321validation of JavaScript form and, 30virtual hosts (host headers) in, 78-79, 78, 78

#CGIParse wrapper in, 196-207, 197-198, 199

CGIErrorLog directive in, 72, 72CHAIN, 121, 159character values

#CtoN, convert character values to numeric,217-218

#Replace, 218#ToUpper/#ToLower, 218-219#ZChar (zero suppress a character), 219

charAt() method, 33, 34chat client file for GreenYak chat, 336CHATBLPF file (blacklist) in GreenYak chat,

338-339, 338CHATCTLPF file (chat client) GreenYak chat,

336-337, 336, 341CHATEXIT program in, 346-347, 346-347CHATPF file (text messages) in GreenYak chat,

337-338, 338CHATPOST(client input program ), 343-345, 344, 345CHATUPF file (active user) in GreenYak chat, 337,

337, 340-342CHATUSERS program in GreenYak chat, 340-342,

341classes of stylesheets in, 16-18, 17, 18client input program in (CHATPOST), 343-345, 344,

345CLP programming, Get URI (GETURI) application,

311-312, 311-312COLS attribute in frames, 21commitment control

ILE and, 90SQL, 121-122

common gateway interface (See CGI programming)Common log format in, 67-68compiling code

ILE and, 96, 107-109SQL and, 120

Configure TCPIP (CFGTCP) command for, 79-80, 80Content-type HTTP header, 5-6, 6conversation text program in (CHATAREA) in,

342-343, 343convert case, #ToUpper/#ToLower, 218-219convert character values to numeric, #CtoN, 217-218Convert to Database (QtmhCvtDB) in, 160, 167-171,

191-195Convert URL to Path (QzhbCvtURLtoPath) in, 177cookies, 221-243

creation of, in eRPG, 223-238, 239-240, 239date manipulation in RPG and, 237#DayOfWeek subprocedure for, 229, 229domain for, 226expiration date for, 225

366

INDEX

Page 5: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

#GetCookie subroutine for, 232-235, 233-234, 238,238

#GetGMTTime subprocedure for, 227-229, 227-228HTTP headers and, 237-238, 241informational web sites about, 222, 224Integrated Language Environment (ILE) and, 226-237JavaScript and, 223#NameOfDay subprocedure for, 230-231, 230#NameOfMonth subprocedure for, 231-232, 231-232value pairs in, 225, 239, 241-242, 242path for, 225-226position of, in web page, 224pseudoarrays and, 234#PutCookie subprocedure for, 235-237,

235-236,238, 238request method for, 241, 242sample of, TCOOKIE programs, 238-243, 239-243secure tag, Secure Sockets Layer (SSL) and, 226security risks of, 222-223tail matching in, 226URL and, 225-226uses for, 221-223Web site design example and, 282, 286, 287, 304#WrStout wrapper for, 226-237Write to Standard Output (QtmhWrStout) for,

226-237writing data to browser from, 224-226, 241-242

Counter application, 305, 317-321, 318, 319-320Create Bound RPG (CRTBNDRPG) command, 90Create Directory (CRTDIR), 249Create Folder (CRTFLR) command, 248Create Program (CRTPGM) command in ILE and, 88,

96Create RPG Module (CRTRPGMOD) command in

ILE and, 88, 96, 97-98, 101Create Service Program (CRTSRVPGM) command in

ILE, 88, 89, 101, 102, 105, 106CRLF characters, in Upload Files application, 325-331#CtoN, convert character values to numeric, 217-218current signature, ILE and, 106-107cursors, SQL, 121, 126-127, 126, 132, 132, 133-135,

141, 142custom error pages for HTTP, 74-76, 76

Ddaemon, 316database

Convert to Database (QtmhCvtDB) in, 167-171,191-195

#CvtDB wrapper for, 191-195, 191-192

TCVTDB program for, 192-195, 193, 194, 195dates

cookies and, 237#DayOfWeek subprocedure for cookie, 229, 229#NameOfDay subprocedure for cookies, 230-231,

230#NameOfMonth subprocedure for cookie, 231-232,

231-232server side includes (SSIs) and, 267, 267

day of week, #DayOfWeek subprocedure for cookie,229, 229

DDS log format in, 67-68debugging, 253-257

alert() in, 43-44, 43, 44batch (BCH) jobs, 255batch immediate (BCI) jobs in, 254-256ending HTTP server instance for, 254error reporting with eRPG, 259-265JavaScript and, 42-46job logs in, 256-257minat and maxat parameters for, 256Netscape error messages for, 45-46, 45, 46service jobs for, 257Start Debug (STRDBG) command in, 257very verbose HTTP server, 257-259, 259Work with Active Jobs (WRKACTJOB) in,

254-255definition specifications (Dspecs) in Web site design

example and, 286DELETE command in SQL, 116, 117-118denial of service (DoS) attack protection, xix, 56-60

firewalls and, 59NOMAX setting and, 58timeouts and, 59time-value parameters and, 58

Detection directive in, for DoS attack prevention, 57,59

development of eRPG, xviii-xixdirectives, Retrieve Directive (QzhbRetrieveDirective)

in, 177directories in Integrated File System (IFS) and, 246Display Program (DSPPGM) to view binding

directory in ILE, 109document type definitions (DTDs), in XML, 350, 351domain for cookies and, 226DYNAMIC SCROLL command, SQL, 133-135, 141dynamic SQL, xix-xx, 128-135, 129-130

E#EchoV (environment variables) in, 214-215, 214-215

Note: Boldface numbers indicate illustrations. 367

INDEX

Page 6: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

embedded SQL in, 120-123, 124-128, 124, 125empty shopping basket feature for web site, 277, 278,

278, 302-304, 302-303encapsulation, xix, 86environment variables

#EchoV (environment variables) in, 214-215,214-215

Get Environment Variable (QtmhGetEnv) in,163-165, 184-187

#GetEnv/#GetEnv2 wrappers in, 184-187, 184, 185Put Environmental Variable (QtmhPutEnv) in,

171-172, 195-196#PutEvn wrapper in, 195-196, 196TGETENV program for, 185-187, 186, 187

error messages, 259-265custom error pages for HTTP, 74-76, 76error reporting with eRPG, 259-265in JavaScript forms, 34, 35Netscape error messages for, 45-46, 45, 46very verbose HTTP server, 257-259, 259

error pages for HTTP, 74-76, 76error reporting with eRPG, 259-265, 260-265ERRORFORM program for, 259-261, 260-265ErrorLog directive in, 71-72, 72ErrorPage directive for, 75-76, 75Exec directive in, 52, 53-54#ExecCGI (execute CGI as SSI) in, 215-216, 216expiration date for cookies and, 225Expires HTTP header, 6-7EXPORT (ALL) keyword in ILE and, 102, 105, 106Extended log format in, 67-68extensible markup language (XML), 349, 350-353, 351external stylesheets, 18-19

FF.HTTPSTD standard HTTP function, 179-207

#CGIParse wrapper in, 196-207, 197-198, 199#CvtDB wrapper for, 191-195, 191-192#GetEnv/#GetEnv2 wrappers in, 184-187, 184, 185#PutEvn wrapper in, 195-196, 196#RdStin/#RdStin2 wrapper for, 187-191, 188, 189TCGIPARSE program in, 199-207, 199-206, 207TCVTDB program for, 192-195, 193, 194, 195TGETENV program for, 185-187, 186, 187TRDSTIN program in, 189-191, 189-190, 191TWRSTOUT program example in, 182-183, 182,

183Web site design example and, 285, 289

#WrStout wrapper for, 180-183, 181-183, 180, 211,226-237

F.IFSHTML, read from IFS, 207-212F.SSI, server side include functions, 212-216, 213,

213-217F.STRING string manipulation functions, 216-220FETCH command in SQL, 127, 127, 134, 134, 142field manipulation, JavaScript forms, 32-35, 32-33, 35file header processing, in Upload Files application,

326-331file systems (See also Integrated File System), 245File Transfer Protocol (FTP), 249-251, 316filenames in Integrated File System (IFS) and, 208files in Integrated File System (IFS) and, 246firewalls, vs. DoS attacks, 59folders in Integrated File System (IFS) and, 208, 246<FONT> tags, 14, 16form validation, 28-32, 28-31<FORM> tag, 323forms in JavaScript, 28-38

error message display in, 34, 35field manipulation in, 32-35, 32-33, 35hidden, 38, 40HREF to submit, 39-40submission of, 36-38, 36, 37-38validation of, 28-32, 28-31

forms in SQL, 157<FRAME> tags in, 22, 24-25frames, 20-25

absolute pixel size in, 21browsers support for, 20-21, 22defining, using <FRAMESET> tag, 21, 24-25examples of, 22-25, 23, 24fixed size, 22<FRAME> tags in, 22, 24-25frameset within, 23-24, 24in GreenYak chat, 334-336, 334, 339-340, 339name of, 22<NOFRAMES> tag in, 22percentage sizing of, 21positioning of, 21relative scaling value in, 21ROWS and COLS attribute in, 21scrolling, 22sizing of, 21source of content in, 22uses for, 20-22, 25

<FRAMESET> tag, 21, 24-25future of eRPG, xix-xx, 360-361

368

INDEX

Page 7: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

GGET

CGI Parse (QzhbCGIParse) in, 196-207Convert to Database (QtmhCvtDB) in, 191-195#CvtDB wrapper for, 191-195, 191-192name formats for FTP and, 251Read Standard Input (QtmhRdStin) in, 165-167,

187-191TCGIPARSE program in, 199-207, 199-206, 207

Get Environment Variable (QtmhGetEnv) in, 163-165,184-187

Get URI (GETURI) application, 305, 306-317, 308,311-315

#GetCookie subroutine for, 232-35, 233-234, 238, 238#GetEnv/#GetEnv2 wrappers in, 184-187, 184, 185#GetGMTTime subprocedure for cookies and,

227-229, 227-228GreenYak chat application, 333-348

active user list in, 340-342, 341autorefresh in, 347CHATBLPF file (blacklist) in, 338-339, 338CHATCTLPF file (chat client), 336-337, 336, 341CHATEXIT program in, 346-347, 346-347CHATPF file (text messages) in, 337-338, 338CHATUPF file (active user) in, 337, 337, 340, 341,

342CHATUSERS program in, 340-342, 341client input program in (CHATPOST), 343-345,

344, 345conversation text program in (CHATAREA) in,

342-343, 343files used in, 336-339frames in, 334-336, 334, 339-340, 339header section in, 340page design in, 334-336, 334, 335

grouping ILE subprocedures into modules or serviceprograms in, 111-112

Hhandheld device markup language (HDML), 306, 349,

353-356, 354-355, 356handheld devices and eRPG, 349-361

extensible markup language (XML) and, 350-353,351

handheld device markup language (HDML) in,306, 349, 353-356, 354-355, 356

simulator for, 353-356, 356wireless markup language (WML) and, 356-360,

357-359, 360

<HEAD> tags, 14, 292header section in GreenYak chat, 340Header subroutine, Web site design example and, 287headers, HTTP (See HTTP headers)Hello World syndrome, xx-xxihidden fields in, 11-12

Web site design example and, 296hidden JavaScript forms, 38, 40hidden keyword, 12host headers (virtual hosts), 77-79, 78HREF to submit JavaScript forms, 39-40HTML (See hypertext markup language)<HTML> tags, 292HTTP configuration, 25, 51-84, 316

AccessLog directive in, 69-70, 69AccessLogArchive directive in, 73AccessLogExpire directive in, 74AccessLogSizeLimit directive in, 74AddType configuration in, 82-84, 83AgentLog directive in, 72, 72AS/400 security issues and, 57AuthType protection subdirective in, 61-63, 62BindSpecific directive in, 81-82, 81CGIErrorLog directive in, 72, 72cleaning up old log entries in, 72-74, 73Common log format in, 67-68Configure TCPIP (CFGTCP) command for, 79-80,

80custom error pages for, 74-76, 76DDS log format in, 67-68denial of service (DoS) attack protection using,

56-60Detection directive in, for DoS attack prevention,

57, 59ending HTTP server instance for debugging in, 254ErrorLog directive in, 71-72, 72ErrorPage directive for, 75-76, 75Exec directive in, 52, 53-54Extended log format in, 67-68F.HTTPSTD standard HTTP function in, 179-207firewalls and, 59headers for, 82HTTP-EQUIV Meta tags in, 9-10Imbeds directive for, 266IP addresses for, 79%%LDAP%% value in, 64LogFormat directive in, 67-68logging in, 67-74Map directive in, 52-53Mask subdirective in, 64-65Meta tags in, 9-11

Note: Boldface numbers indicate illustrations. 369

INDEX

Page 8: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

HTTP configuration, continuedMIME data types in, 83, 84multiple servers in, 79-82multiple web sites running on, 76-82naming logs for, 70NOMAX setting and, 58order of Map, Exec, and Pass directives in, 52,

55-56, 55Pass directive in, 52, 54-55PasswdFile subdirective in, 63-64Penalization directive in, for DoS attack

prevention, 57, 58-59Produce Full HTTP Response (QzhbCGIUtils) in,

177Protect directive in, 60-66, 66Protection directive example in, 60-65, 65protection subdirectives in, 60-65purging error logs in, 74RefererLog directive in, 71, 71server side includes (SSIs) and, 266ServerID subdirective in, 63sockets communications and, 306-307Start TCPIP Interface (STRTCPIFC) command for,

80storing logs for, 69-70%%SYSTEM%% value in, 63timeouts and, 59time–value parameters and, 58Trust directive in, for DoS attack prevention, 57, 59validation lists in, 60, 64very verbose HTTP server, 257-259, 259virtual hosts (host headers) in, 77-79, 78

HTTP headers, 4-8AddType configuration in, 82-84, 83Cache-Control, 7Content-type, 5-6, 6cookies and, 237-238, 241Expires, 6-7Location, 8Pragma, 7, 8server side includes (SSIs) and, 270, 270SQL, 137, 138, 139, 156Web site design and, 8, 287, 292, 304

HTTP servers (See also HTTP configuration), xix, 316HTTP-EQUIV Meta tags in, 9-10hyperlinks, 274

JavaScript and, 39-40onMouseOver/onMouseOut in, 41-42, 41, 42window status changes in, 40-42, 41, 42

hypertext markup language (HTML), xviii, xix, 1-4,25, 349

cascading stylesheets in, 13-20classes of stylesheets in, 16-18, 17, 18ERRORFORM program in, 259-261, 260-265external stylesheets in, 18-19, 19frames in (See frames), 339handheld device markup language (HDML) and,

353-356, 354-355, 356hidden fields and, 12Meta tags in, 9-11referencing JavaScript source for, tag for, 49-50screen scrapers for, 252server side includes (SSIs) and, 266simple formatting using, 13-16, 13-16stylesheets for, 12-20tutorials on Internet, 3-4Upload Files application and, 321-331, 322-330very verbose HTTP server, 258-259, 259wireless markup language (WML) and, 356-360,

357-359, 360Workstation Gateway Interface (WSG), 252-253,

253XML and, 350, 351

IifsHTML subprocedure, 210-212, 210-211Imbeds directive for HTTP server and, 266include virtual, server side includes (SSIs) and,

268-269, 269#IncludeF (file SSI directive) in, 213-214, 214#IncludeV (include virtual command) in, 212-213,

213initialization subroutine (INZSR), Web site design

example, 286-287<INPUT> tags, 281INSERT command in SQL, 116inserting SSI data to web page, 267-269, 267, 268,

269, 270Integrated File System (IFS), 207-209, 245-249

APIs for, 209-210Create Directory (CRTDIR) in, 249Create Folder (CRTFLR) command in, 248directories in, 246F.IFSHTML, read from IFS, 207-212filenames in, 208files in, 246folders in, 208, 246ifsHTML subprocedure for, 210-212, 210-211libraries in, 208, 246objects in, 208QDLS in, 208, 248

370

INDEX

Page 9: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

QOpenSys file system in, 209, 249QSYS.LIB in, 208, 246-248root directory in, 209, 246, 246special directories in, 249tree structure of, 246, 246UNIX and, 209, 249Work with Documents (WRKDOC) command in,

248Work with Folders (WRKFLR) command in, 248Work with Link (WRKLNK) command in, 208,

249Integrated Language Environment (ILE), xix, 85-113

activation groups in, 90-91, 92application programming interfaces (APIs) and,

wrappers for, 159-177, 180bind by copy in, 88, 91, 98bind by reference in, 88-89, 91, 99, 100-107Bind Service Program (BNDSRVPGM) command

in, 101binder language in, 89, 92, 102-103binding directories in, 89-90, 92, 107-109, 109built-in functions (BIFs) and, 86CALLER activation groups in, 90commitment and, 90compiling code in, 96, 107-109Create Bound RPG (CRTBNDRPG) command in,

90Create Program (CRTPGM) command in, 88, 96Create RPG Module (CRTRPGMOD) command

in, 88, 96, 97-98, 101Create Service Program (CRTSRVPGM) command

in, 88, 89, 101, 102, 105, 106current and previous signatures in, 106Display Program (DSPPGM) to view binding

directory in, 109encapsulation and, 86examples using, 92-99EXPORT (ALL) keyword in, 102, 105, 106F.HTTPSTD standard HTTP function in, 179-207grouping subprocedures into modules or service

programs in, 111-112Hello module example in, 93-96, 94modular programming in, 86, 99modules in, 87-88, 91, 94, 95, 99named activation groups in, 90NEW activation groups in, 90NOPASS keyword in, 110-111, 110OMIT keyword in, 110-111, 110open data paths (ODPs) and, 90Open Query File (OPNQRYF) and activation

groups in, 90

OPTIONS keyword in, 110-111, 110program interface (PI) definition in, 94prototypes in, 94, 99QSRVSRC to store binder language for, 103RETURN opcode in, 95service programs in, 88-89, 91, 99, 100-107, 100signature creation in, 106-107, 107signatures in, 89, 102-106subprocedure design in, 111subprocedure examples in, 87, 91, 93-99, 93, 95,

97, 98-99, 104-106, 104, 105subprocedure parameter keywords in, 109-111, 109user-defined functions in, 86VALUE keyword in, 110, 110, 110

INTO clause, in SQL, 127IP addresses, multiple web sites running on HTTP

server, 79iSeries 400, xviiisNumeric() function, 31-32, 50item table in web site, 274-275, 275, 281

JJavaScript, xviii, xix, 25, 27-50

alert() in, 30, 36, 43-44, 43, 44, 47autorefresh in, 347browser support of, 27charAt() method in, 33, 34cookies and, 223debugging, 42-46error message display in, 34, 35form field manipulation in, 32-35, 32-33, 35form submission in, 36-38, 36, 37-38form validation in, 28-32, 28-31forms in, 28-38hidden forms in, 38, 40hyperlinks in, using HREF, 39-40isNumeric() function in, 31-32, 50Netscape error messages for, 45-46, 45, 46onClick() method in, 36-38onMouseOver/onMouseOut in, 41-42, 41, 42references to source using, 49-50tag for, 49-50sortBy() in, 38submit() in, 37SubmitForm() in, 40toUpperCase() in, 34trimming blanks (trim()) from character data in,

46-49, 47, 48, 49user-defined functions in, 31-32Validate() function in, 29, 33

Note: Boldface numbers indicate illustrations. 371

INDEX

Page 10: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

JavaScript, continuedwindow status changes in, 40-42, 41, 42

job logs in debugging and, 256-257

Kkeywords, for search engines, 10

L%%LDAP%% value in, 64legacy systems, xxi-xxiilength of string, #Len (length of string), 219libraries in Integrated File System (IFS) and, 208, 246lightweight directory access protocol (LDAP),

%%LDAP%% value in, 64<LINK> tags, 19Linux, xvii, 245

FTP and, 250XML and, 352

Location HTTP header, 8LogFormat directive in, 67-68logging the HTTP server, 67-74

AccessLog directive in, 69-70, 69AccessLogArchive directive in, 73AccessLogExpire directive in, 74AccessLogSizeLimit directive in, 74AgentLog directive in, 72, 72CGIErrorLog directive in, 72, 72cleaning up old log entries in, 72-74, 73Common log format in, 67-68DDS log format in, 67-68ErrorLog directive in, 71-72, 72Extended log format in, 67-68LogFormat directive in, 67-68naming logs for, 70purging error logs in, 74RefererLog directive in, 71, 71storing logs for, 69-70, 69

LOOKUP, 159looping in SQL, 142lowercase conversion, #ToUpper/#ToLower, 218-219

MMap directive in, 52-53Mask subdirective in, 64-65Meta tags, 5, 9-11

HTTP-EQUIV Meta tags in, 9-10keywords for search engines in, 10NAME, 10-11

MIME data types, HTTP configuration and, 83, 84minat and maxat parameters for debugging and, 256mobile applications (See handheld devices and eRPG)modular code and ILE, 86, 99module in ILE and, 87-88, 91, 94, 95, 99

grouping subprocedures into, 111-112, 111multifail errors, 75-76multiple servers, HTTP, 79-82multiple web sites running on HTTP server, 76-82

BindSpecific directive in, 81-82, 81configuration files for, 81Configure TCPIP (CFGTCP) command for, 79-80,

80IP addresses for, 79multiple servers in, 79-82Start TCPIP Interface (STRTCPIFC) command for,

80virtual hosts (host headers) in, 77-79, 78

Nname formats for FTP, 251NAME Meta tags, 10-11#NameOfDay subprocedure for cookies, 230-231, 230#NameOfMonth subprocedure for cookie, 231-232,

231-232named activation groups in ILE and, 90Net.Data, 321Netscape error messages for JavaScript, 45-46, 45, 46NEW activation groups in ILE and, 90new line characters, 4, 137NEXT keyword in SQL, 142<NOFRAMES> tag in, 22NOMAX setting, 58NOPASS keyword in, 110-111, 110null terminated strings, 173numeric values, #CtoN, convert character values to

numeric, 217-218numeric variables in SQL, 137

Oobjects in Integrated File System (IFS) and, 208OMIT keyword in, 110-111, 110onClick() method, 36-38onMouseOver/onMouseOut, 41-42, 41, 42open data paths (ODPs) and ILE and, 90Open Query File (OPNQRYF), xix-xx

ILE and, and activation groups in, 90SQL vs., 116, 118, 124, 128, 146

OpenWave, HDML and, 353

372

INDEX

Page 11: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

OPTIONS keyword in, 110-111, 110ORDER BY clause in SQL, 119, 156, 157order of Map, Exec, and Pass directives, in HTTP

configuration and, 52, 55-56, 55order processing in Web site, 275-277, 276, 277overriding HTTP headers, 5

Ppaging using SQL, 136parsing

CGI Parse (QzhbCGIParse) in, 172-177, 196-207#CGIParse wrapper in, 196-207, 197-198, 199

pass by value/pass by reference, VALUE keyword in,110, 110

Pass directive in, 52, 54-55PasswdFile subdirective in, 63-64passwords

AuthType protection subdirective in, 61-63, 62PasswdFile subdirective in, 63-64Protect directive in, 66%%SYSTEM%% value in, 63

Penalization directive in, for DoS attack prevention, 57percentage sizing of frames, 21POP, 316POST

CGI Parse (QzhbCGIParse) in, 196-207Convert to Database (QtmhCvtDB) in, 191-195#CvtDB wrapper for, 191-195, 191-192name formats for FTP and, 251Read Standard Input (QtmhRdStin) in, 165-167,

187-191TCGIPARSE program in, 199-207, 199-206, 207

Pragma HTTP header, 7, 8PREPARE command in dynamic SQL and, 131, 131previous signature, ILE and, 106-107Produce Full HTTP Response (QzhbCGIUtils) in, 177program interface (PI) definition in ILE and, 94Protect directive in, 60-66, 66Protection directive in, 60-65protection subdirectives in, 60-65prototypes, ILE, 94, 99, 285-286proxy servers, Cache Control HTTP header, 7pseudoarrays and cookies and, 234purging error logs in, 74Put Environmental Variable (QtmhPutEnv) in,

171-172, 195-196#PutCookie subprocedure for, 235-237, 235-236, 238,

238#PutEvn wrapper in, 195-196, 196

QQDLS, 208, 248QOpenSys file system in, 209, 249QSRVSRC to store binder language for ILE and, 103QSYS.LIB

Integrated File System (IFS) and, 208, 246-248name formats for FTP and, 251

QTMHCGI service program for, 160-161, 180QtmhCvtDB (Convert to Database) in, 167-171,

191-195QtmhGetEnv (Get Environment Variable ) in,

163-165, 184-187QtmhPutEnv(Put Environmental Variable) in,

171-172, 195-196QtmhRdStin (Read Standard Input ) in, 165-167,

187-191QtmhWrStout (Write Standard Output) in, 161-163,

180-183, 211, 226-237QUTCOFFSET, 227QZHBCGI service program for, 160-161, 180QzhbCGIParse(CGI Parse) in, 172-177, 196-207QzhbCGIUtils(Produce Full HTTP Response) in, 177QzhbCvtURLtoPath (Convert URL to Path) in, 177QzhbRetrieveDirective (Retrieve Directive) in, 177

R#RdStin/#RdStin2 wrapper for, 187-191, 188, 189READ, 159Read Standard Input (QtmhRdStin) in, 165-167,

187-191reading data from a Web page, using SQL, 149,

155-156READX, 121redirecting a web page, HTTP-EQUIV Meta tags in,

9-10referencing JavaScript source, 49-50RefererLog directive, 71, 71RELATIVE keyword in SQL, 134-135, 135, 142relative scaling value in frames, 21#Replace, 218result sets in SQL, 120Retrieve Directive (QzhbRetrieveDirective) in, 177return codes (SQL Code/SQLCOD) in, 122, 123, 123,

127-128, 128RETURN opcode in ILE and, 95root folder/directory, 209, 246, 246ROWS and COLS attribute in frames, 21

Note: Boldface numbers indicate illustrations. 373

INDEX

Page 12: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

Sschemas, in XML, 350, 351screen scrapers, Workstation Gateway Interface

(WSG), 252-253, 253<SCRIPT> tag for, 49-50scrollable cursors in SQL, 133-135, 141search engines, Meta tags for, 9-11Secure Sockets Layer (SSL), 275

cookies and, 226security

AS/400 as secure machine, 57cookies and, 222-223denial of service (DoS) attack protection in, 56-60Mask subdirective in, 64-65NOMAX setting and, 58Pass directive in, 54-55Protection directive in, 60-65validation lists in, 60, 64

SELECT command in SQL, 116, 118-120, 141serial cursors in SQL, 133server side includes (SSIs), 266-271

CGI programming and, 266date directive for, 267, 267directives for, keywords and comments in, 267-270#EchoV (environment variables) in, 214-215,

214-215#ExecCGI (execute CGI as SSI) in, 215-216, 216F.SSI for, 212-216, 213, 213-217HTML and, 266HTTP configuration for, 266HTTP headers in, 270, 270Imbeds directive for HTTP server and, 266include virtual in, 268-269, 269#IncludeF (file SSI directive) in, 213-214, 214#IncludeV (include virtual command) in, 212-213,

213inserting SSI data to web page, 267-269, 267, 268,

269, 270Web site design example and, 279, 288

ServerID subdirective, 63service jobs, debugging and, 257service programs, ILE, 88-89, 91, 100-107, 160

grouping subprocedures into, 111-112SETLL, 121SHOP1 program and source, 283-288, 283-285SHOP2 program and source, 288-292, 289-291SHOP3 program and source, 292-287, 293-296SHOP4 program and source, 297-302, 297-299SHOP5 program and source, 302-304, 302-303

shopping basket for web site, 276-277, 276, 277, 282,282, 289-292, 289-291

signatures in ILE and, 89, 102-106simulator for handheld device programming, 353-356,

356SMTP, 316socket communications, 306-307sortBy(), 38Source Entry Utility (SEU), 120special directories in Integrated File System (IFS) and,

249SQL, xix-xx, 115-158

building dynamic SQL statements in, 131, 131building statements in, 141, 156-157commands in, 116-117commitment control in, 121-122cursors in, 121, 126-127, 126, 132-135, 132, 141,

142DELETE command in, 116, 117-118displaying data in, 156displaying form in, 157Dspecs for DYNSQL eRPG program, 136, 136DYNAMIC SCROLL command in, 133-135, 141dynamic SQL in, 128-135, 129-130DYNSQL program in action, 144-146, 144, 145,

146embedded SQL in, 120-128, 124, 125FETCH statement in, 127, 127, 134, 134, 142First subroutine in, 138-139, 139, 155Form subroutine in, 157HTTP headers and, 137, 138, 139, 156INSERT command in, 116INTO clause in, 127item master file example in, 146-157, 147, 150-155Last subroutine in, 143, 143looping in, 142main processing of DYNSQL program example in,

138-144, 138-144Main subroutine in, 139, 139-141, 156new line characters in, 137NEXT keyword in, 142numeric variables in, 137Open Query File (OPNQRYF) vs., 116, 118, 124,

128, 146ORDER BY clause in, 119, 156, 157paging using, 136positioning with dynamic SQL in, 132-135PREPARE command in dynamic SQL and, 131, 131reading data from a Web page in, 149, 155-156RELATIVE keyword in, 134-135, 135, 142result sets in, 120

374

INDEX

Page 13: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

return codes (SQL Code/SQLCOD) in, 122, 123,123, 127-128, 128

scrollable cursors in, 133-135, 141SELECT command in, 116, 118-120, 141selecting and sorting in, 146-157serial cursors in, 133Source Entry Utility (SEU) and, 120SQLCOD in, 142SQLRPGLE member type in, 120-121, 122,

136-146Start SQL (STRSQL) command for, 117tables (physical files) in, 116temporary variables in, 137UPDATE command in, 116, 117-118views (logical files) in, 116WHERE clause in, 117, 156, 157wildcard values in, 118work variables in, 130-131, 131, 130

SQL Code/SQLCOD, 122, 123, 123, 127-128, 128, 142SQLRPGLE member type in, 120-122, 136-146standard HTTP function (See F.HTTPSTD)standard input

#RdStin/#RdStin2 wrapper for, 187-191, 188, 189Read Standard Input (QtmhRdStin) in, 165-167,

187-191TRDSTIN program in, 189-191, 189-190, 191TWRSTOUT program example in, 182-183, 182,

183#WrStout wrapper for, 180-183, 181-183, 180, 211,

226-237Write Standard Output (QtmhWrStout) in,

161-163, 180-183, 211, 226-237Start Debug (STRDBG) command, 257Start SQL (STRSQL) command, 117Start TCPIP Interface (STRTCPIFC) command for, 80static web page, 13-16, 13-16stream data, in Upload Files application, 325-327,

325-326string manipulation functions (F.STRING), 216-220

#CtoN, convert character values to numeric,217-218

JavaScript and, 46-49#Len (length of string), 219

#Replace, 218#ToUpper/#ToLower, 218-219trimming blanks (trim()) from character data in,

46-49, 47, 48, 49#ZChar (zero suppress a character), 219

<STYLE> tags, 14, 15, 19stylesheets, 12-20

cascading, 13-20, 280-281, 280

classes of, 16-18, 17, 18external, 18-19Web site design example and, 280-281, 280XML, 350, 351

subfile type actions, 300, 302submit button for Web site example and, 296-297submit(), 37SubmitForm(), 40submitting JavaScript form, 36-38, 36, 37-38subprocedures in ILE, 87, 91, 93-99, 93, 95, 97,

98-99, 104-106, 104, 105!designing, 111grouping into modules or service programs,

111-112parameter keywords for, 109-111

subroutines, Web site example and, 286-287%%SYSTEM%% value in, 63

Ttables (physical files) in SQL, 116tail matching in cookies and, 226TCGIPARSE program in, 199-207, 199-206, 207TCOOKIE programs, 238-243, 239-243TCP/IP, 249

sockets communications and, 316TCVTDB program for, 192-195, 193, 194, 195temporary variables in SQL, 137terminal emulation, Workstation Gateway Interface

(WSG), 252-253, 253text message file for GreenYak chat, 337TGETENV program for, 185-187, 186, 187time

#GetGMTTime subprocedure for cookie, 227-229,227-228

QUTCOFFSET, 227timeouts and DoS attacks, 59timestamps in Web site example and, 286time–value parameters and DoS attacks, 58Tomcat, xviitools for the Web, 1-25#ToUpper/#ToLower, 218-219toUpperCase(), 34TRDSTIN program in, 189-191, 189-190, 191tree structure of Integrated File System (IFS) and, 246,

246%TRIM, 47trimming blanks (trim()) from character data in, 46-49,

47, 48, 49Trust directive in, for DoS attack prevention, 57, 59TWRSTOUT program example, 182-183, 182, 183

Note: Boldface numbers indicate illustrations. 375

INDEX

Page 14: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

UUniform Resource Identifiers (URIs),

Get URI (GETURI) application for, 305, 306-317,308, 311-315

UNIX, 245FTP and, 250Integrated File System (IFS) and, 209, 249XML and, 352

UPDATE command in SQL, 116, 117-118updating shopping basket contents in Web site

example and, 297-302, 297-299Upload Files application, 306, 321-331, 322-330uppercase conversion, #ToUpper/#ToLower, 218-219URLs

Convert URL to Path (QzhbCvtURLtoPath) in, 177cookies and, 225-226Location HTTP header, 8

user-defined functionsJavaScript and, 31-32ILE and, 86

user-defined signatures, ILE, 106-107, 107user IDs

AuthType protection subdirective in, 61-63, 62PasswdFile subdirective in, 63-64Protect directive in, 66

VValidate() function in, 29, 33validation lists in, 60, 64validation, forms, 28-32, 28-31very verbose HTTP server, 257-259, 259views (logical files) in SQL, 116virtual hosts (host headers) in, 77-79, 78

WWeb crawlers

keywords for search engines in, 10Meta tags in, 9-11NAME Meta tags, 10-11

Web server (See also HTTP configuration), xviii,51-84

Web site creation using eRPG, 273-304adding items to shopping basket in, 278Body subroutine in, 288caching in, 286code for, 279-304cookies for, 282, 286, 287, 304definition specifications in, 286

empty shopping basket feature for, 277, 278, 278,302-304, 302-303

F.HTTPSTD service program in, 285, 289Footer subroutine in, 288formatting in, 278Header subroutine in, 287hidden fields in, 296HTTP headers in, 287, 292, 304hyperlinks in, 274initialization subroutine (INZSR) in, 286-287item table for, 274-275, 275, 281, 281main program in, 287order processing in, 275-277, 276, 277prototype definition in, 285-286secure sockets layer (SSL) connections in, 275server side includes (SSIs) in, 279, 288SHOP1 program and source, 283-288, 283-285SHOP2 program in, 288-292, 289-291SHOP3 program in, 292-287, 293-296SHOP4 program for, 297-302, 297-299SHOP5 program in, 302-304, 302-303shopping basket for, 276-277, 276, 277, 282, 282,

289-292, 289-291stylesheet for, 280-281, 280subfile type actions in, 300, 302submit button for, 296-297timestamps in, 286updating basket contents in, 278, 297-302, 297-299Welcome page in, 274, 274, 279, 280working variables in, 286

WHERE clause in SQL, 117, 156, 157wildcard values in SQL, 118window status changes in JavaScript, 40-42, 41, 42Windows, 245

FTP and, 250XML and, 352

wireless applications (See handheld devices andeRPG)

wireless markup language (WML), 306, 349, 356-360,357-359, 360

work variablesSQL, 130-131, 131Web site design example and, 286

Work with Active Jobs (WRKACTJOB) in, 254-255Work with Documents (WRKDOC) command, 248Work with Folders (WRKFLR) command, 248Work with Link (WRKLNK) command, 208, 249Workstation Gateway Interface (WSG), 252-253, 253Worldwide Web Consortium (W3C), 5

376

INDEX

Page 15: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

#WrStout wrapper for, 180-183, 181-183, 180, 211,226-237

wrappers for APIs, 159, 180Write Standard Output (QtmhWrStout) in, 161-163,

180-183, 211, 226-237WYSIWYG HTML editors, 1-2

XXML (See extensible markup language)

Z#ZChar (zero suppress a character), 219

Note: Boldface numbers indicate illustrations. 377

INDEX

Page 16: D:Venturae-rpg Section 3 - MC Press Onlineeditorial.mcpressonline.com/web/mcpdf.nsf/wdocs/5056/$FILE/5056... · APPENDIX T he CD-ROM that you receive with e-RPG(v2): e-Volving RPG

Recommended