iSeries Office Integrator -...

56
iSeries Office Integrator Copyright © 1992-2002 ... RJS Software Systems Inc. User Guide RJS Software Systems Inc. 14041 Burnhaven Drive, Suite 120 Burnsville, MN 55337 Phn: (952) 898-3038 Fax: (952) 898-1781 Sales Email: [email protected] Support Email: [email protected] Web Site: http://www.rjssoftware.com

Transcript of iSeries Office Integrator -...

iSeries Office IntegratorCopyright © 1992-2002 ... RJS Software Systems Inc.

User Guide

RJS Software Systems Inc. 14041 Burnhaven Drive, Suite 120

Burnsville, MN 55337

Phn: (952) 898-3038Fax: (952) 898-1781

Sales Email: [email protected] Email: [email protected]

Web Site: http://www.rjssoftware.com

Table of ContentsPart I iSeries Office Integrator 3

................................................................................................................................... 31 Overview .......................................................................................................................................................... 3Introduction to iSeries Office Integrator .......................................................................................................................................................... 4About RJS Software Systems, Inc. .......................................................................................................................................................... 4Licensing Information .......................................................................................................................................................... 4Contacting RJS Software Systems, Inc.

................................................................................................................................... 42 Installation .......................................................................................................................................................... 4Introduction to Installation .......................................................................................................................................................... 5AS/400 Prerequisites .......................................................................................................................................................... 5PC Prerequisites .......................................................................................................................................................... 5AS/400 Installation .......................................................................................................................................................... 5AS/400 User Authorization Code Entry .......................................................................................................................................................... 5Installing iSeries Office Integrator Desktop Server on the PC .......................................................................................................................................................... 6Deinstallation of iSeries Office Integrator

................................................................................................................................... 63 Getting Started .......................................................................................................................................................... 6Introduction to Getting Started .......................................................................................................................................................... 6Installing the iSeries Office Integrator Software .......................................................................................................................................................... 6Overview of File Transfer API .......................................................................................................................................................... 7Overview of Remote Command API .......................................................................................................................................................... 8Starting iSeries Office Integrator Desktop Server on PC .......................................................................................................................................................... 9First Steps - Running Sample CL Programs

.......................................................................................................................................................... 10Sending Your First File to a PC Desktop via FTP

.......................................................................................................................................................... 12Sending a File to your Desktop PC

.......................................................................................................................................................... 13Sending an SQL Query to your Desktop PC

.......................................................................................................................................................... 14Running PC Commands from the AS/400

.......................................................................................................................................................... 15Copying Data to the Windows Clipboard with OFCRUNPC

.......................................................................................................................................................... 16Launching a Web Site with OFCRUNPC

.......................................................................................................................................................... 17Running a PC Program with OFCRUNPC

.......................................................................................................................................................... 18Creating ODBC Data Source for Mail Merge

.......................................................................................................................................................... 20Running Your First MS Word Single Letter Merge

.......................................................................................................................................................... 22Running Your First MS Word Mail Merge

.......................................................................................................................................................... 23Running a Mail Merge and Printing the Document

.......................................................................................................................................................... 25What's Next After Getting Started?

................................................................................................................................... 254 Main Menu .......................................................................................................................................................... 25Introduction to Main Menu .......................................................................................................................................................... 27Getting to the Main Menu .......................................................................................................................................................... 27Available Options on the Main Menu

................................................................................................................................... 295 AS/400 Commands .......................................................................................................................................................... 29Introduction to AS/400 Commands .......................................................................................................................................................... 29OFCDBSND: Send AS/400 Database File via FTP .......................................................................................................................................................... 31OFCIFSSND: Send File from IFS Directory via FTP .......................................................................................................................................................... 33OFCEXPORT - Export AS/400 File to PC Format .......................................................................................................................................................... 38OFCSQLIFS: Export AS/400 File to Selected PC Format using SQL .......................................................................................................................................................... 44OFCSQL: Run SQL Query Statement .......................................................................................................................................................... 46OFCTFR: Send/Receive Files via FTP .......................................................................................................................................................... 49OFCRUNPC: Run Job on Remote Windows Based PC .......................................................................................................................................................... 54OFCIP: Retrieve Current Session IP Address

iSeries Office IntegratorI

Copyright © 1992-2002 ... RJS Software Systems Inc.

................................................................................................................................... 556 Problem Handling .......................................................................................................................................................... 55Common Errors .......................................................................................................................................................... 55Other Errors

Index 0

IIContents

II

Copyright © 1992-2002 ... RJS Software Systems Inc.

iSeries Office Integrator3

Copyright © 1992-2002 ... RJS Software Systems Inc.

1 iSeries Office Integrator

1.1 Overview

1.1.1 Introduction to iSeries Office Integrator

The iSeries Office Integrator software is a native OS/400 API used to quickly send and receiveAS/400 library members, shared folder documents or IFS files via FTP. Files can be sent to anotherAS/400, Windows NT Server, Unix/Linux server or any system that runs an FTP Server.

Since the iSeries Office Integrator product is command line based, FTP file processing can beembedded in any CL, RPG or COBOL program along with error checking and logging.

The iSeries Office Integrator software can be used with or without the AS/400 FTP Server running.This means that AS/400 shops that want to send/receive files from the AS/400 don't have to open upthe AS/400 FTP Server to the Internet unless required.

Any AS/400 database file can be automatically converted and sent via FTP in CSV, HTML or XMLformats, thus eliminating the translation issues usually associated with sending AS/400 database filesthat contain packed data fields.

The iSeries Office Integrator Desktop Server component enables the iSeries Office Integrator to beable to send/receive AS/400 files to any network server or TCP/IP attached PC.

The iSeries Office Integrator Desktop Server isn't just a PC-based FTP server. The desktop servercontains the ability to talk to the OFCRUNPC remote command API on the AS/400. The OFCRUNPCcommand allows PC jobs to be run from the AS/400 command line or within batch jobs such as nightlyprocessing. Listed below are some examples of how the iSeries Office Integrator Remote CommandAPI can be used.

The OFCRUNPC command can be used to:

Launch any PC based application such as MS Word, Excel, Web Browser, etc. by calling the programdirectly via the command line or by calling a document name and letting Windows determine whichapplication to launch.

Launch a web browser to have it open the selected web link. This is great for adding web siteintegration into existing AS/400 applications. Green screen applications can have direct access tothe web browser.Pop up a simple message box on the PC. This can be useful to visually notify users of AS/400events.

Directly launch MS Word or MS Excel using special *EXCEL and *WORD keywords.

Launch MS Word via OLE and perform selected data merge options. This is handy if you want tolaunch MS Word with a selected document template and have your AS/400 application passinformation into the document or perform merge functions such as replacing text at selected bookmarklocations in the template document. What a great way to replace OfficeVision/400.

Set clipboard information from the AS/400. This allows an AS/400 application to send informationdirectly back to the PC clipboard for pasting into any PC application.

The uses for the OFCRUNPC command functionality are endless.

iSeries Office Integrator 4

Copyright © 1992-2002 ... RJS Software Systems Inc.

Make sure to tell us how you're going to use our software.

1.1.2 About RJS Software Systems, Inc.

RJS Software is a privately-held software and hardware company dedicated to providing high-qualityAS/400 - iSeries, Client/Server and web-based products and customer services. Customer Service iscentral to the company's objective. Read more about us on our web site.

Copyright© 1992-2002 by RJS Software Systems Inc. All rights reserved.This manual and the softwaredescribed in it are copyrighted with all rights reserved. No part of this publication may be reproduced,transmitted, transcribed, stored in a retrieval system or translated into any language in any form byany means without the written permission of RJS Software Systems.

TrademarksiSeries Office Integrator is a trademark of RJS Software Systems. Brand names and productnames are trademarks or registered trademarks of their respective companies.

1.1.3 Licensing Information

iSeries Office Integrator is licensed on a per AS/400 system partition basis.

1.1.4 Contacting RJS Software Systems, Inc.

For technical support, please review the following information before contacting RJS SoftwareSystems.

For Technical Support with iSeries Office IntegratorBecause of the complexity of dealing with the various AS/400 connectivity environments, pleasegather and organize as much information as possible on the problem prior to contacting RJS SoftwareSystems for support.

If you have a question about an iSeries Office Integrator operation, first browse through the OnlineHelp to try to find your answer prior to calling RJS Software Systems.

Contact InformationTelephone support is available on normal business days from 9:00 am to 5:00 pm central time.(952) 898-3038 Voice(952) 898-3038 Fax

Support is available via Email at [email protected].

You may also find the answer to your question on our web site: www.rjssoftware.com.

1.2 Installation

1.2.1 Introduction to Installation

This section covers the installation of the iSeries Office Integrator software on the AS/400 system.

iSeries Office Integrator5

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.2.2 AS/400 Prerequisites

A RISC AS/400 system running V4R2-V5R1 or above is required to run the software.

TCP/IP connectivity must be enabled. If TCP/IP is not active, the software will not work.

1.2.3 PC Prerequisites

TCP/IP must be running on the PC and the iSeries Office Integrator Desktop Server must also beinstalled and running on the PC.

The iSeries Office Integrator Desktop Server can be installed on any PC running Windows 95, 98,Me, NT, 2000, XP

Client Access/400 IS NOT required.

1.2.4 AS/400 Installation

This section includes instructions for restoring the iSeries Office Integrator AS/400 library.

AS/400 Installation Using RSTLIB commandInsert the RJS CD into the AS/400 CD Drive and sign on to the AS/400 with a user ID that hassecurity officer authority.

Run the following AS/400 command to restore the iSeries Office Integrator library:RSTLIB SAVLIB(RJSOFFICE) DEV(OPT01) OPTFILE('/RJSOFFIC')

AS/400 Installation Using FTPThis method of installation is described in the RJS Product Catalog and also on the RJS SoftwareSystems installation screen on the RJS CD-ROM.

Note: All web download packages contain an automated FTP upload utility.

1.2.5 AS/400 User Authorization Code Entry

Sign on to the AS/400 with a user ID that has security officer authority.

Entering iSeries Office Integrator Access CodeAdd the RJSOFFICE library to the user library list by typing: ADDLIBLE RJSOFFICE and pressingEnter

Go to the iSeries Office Integrator main menu by typing: GO RJSOFFICE and pressing Enter.

Take option 1 and enter the appropriate access codes listed on the access code sheet provided byRJS Software Systems.

If you have questions or problems with entering the access codes, contact RJS Software Systemsfor assistance.

1.2.6 Installing iSeries Office Integrator Desktop Server on the PC

The following steps should be used to install iSeries Office Integrator on a PC.

Start your PC and make sure Windows is running.

iSeries Office Integrator 6

Copyright © 1992-2002 ... RJS Software Systems Inc.

Insert the RJS installation CD-ROM into drive D: (CD-DRIVE).

1.) Click the Windows Start button and select the Run menu. When the Run dialog is shown, typeD:\VB5RUN\SETUP.EXE and click the OK button to start the VB5 Runtime installation process. Whenthe installation program has started, follow the on screen instructions to complete the installation.

Most of the time you should be able to simply use the default settings.

2.) Click the Windows Start button and select the Run menu. When the Run dialog is shown, typeD:\RJSOFFIC\SETUP.EXE and click the OK button to start the RJS iSeries Office Integratorinstallation process. When the installation program has started, follow the on screen instructions tocomplete the PC installation.

Most of the time you should be able to simply use the default settings.

After copying files, the Setup program will create a RJS iSeries Office Integrator program group andnotify you when it's done.

The RJS iSeries Office Integrator can now be launched from the RJS iSeries Office Integratorprogram group.

1.2.7 Deinstallation of iSeries Office Integrator

The following sections describe how to remove the iSeries Office Integrator from an AS/400 system.

Removing iSeries Office Integrator from an AS/400To remove iSeries Office Integratorfrom an AS/400, perform the following individual steps.

Make sure the RJSOFFICE library is not being used.

Delete the RJSOFFICE library from the AS/400 by entering the following command:DLTLIB LIB(RJSOFFICE)

1.3 Getting Started

1.3.1 Introduction to Getting Started

The purpose of this section is to describe how to quickly get started using the iSeries OfficeIntegrator to start sending and receiving files from your AS/400 via FTP or interacting with PCprograms such as MS Word, Excel, etc.

1.3.2 Installing the iSeries Office Integrator Software

If you haven't installed the software yet, go back to the installation section and install the softwarebefore continuing. If you're just reading ahead to find out what to do, then please continue.

1.3.3 Overview of File Transfer API

What is FTP ? Quite simply, FTP is a standard protocol for sending and receiving files via the Internetor an Intranet. If you're not sure whether you have a FTP server configured in your network, you willneed to talk to your network administrator or contact RJS Software Systems before you startattempting to use the iSeries Office IntegratorFile Transfer software.

The concept behind the iSeries Office Integrator File Transfer API is that AS/400 users andapplication developers need an easy way to send or receive AS/400 files or documents from the

iSeries Office Integrator7

Copyright © 1992-2002 ... RJS Software Systems Inc.

Integrated File System (IFS) without requiring a lot of programming effort or configuration to do so.Most companies have the AS/400 FTP Server running and may also have the need to shuttle data toa Windows NT or Unix server.

The iSeries Office Integrator API commands can be utilized to quickly schedule FTP file transfers viathe AS/400 job scheduler.

The OFCTFR command can be embedded into CL, RPG or COBOL programs to add FTP file transferwith built-in error checking to any AS/400 application.

Listed below are some of the ways that iSeries Office Integrator can be utilized in traditional AS/400application development scenarios:• Data warehouse information can be sent from the AS/400 is CSV format for importing into a

Windows NT or Unix based data warehouse.• EDI information can be quickly exchanged with suppliers and trading partners.• AS/400 libraries can be backed up to save files and the save files can be transmitted to another

AS/400 or stored on a Windows NT or Unix Server for burning to CD.• A file can be transmitted to a remote AS/400 and then a job can be run or submitted to batch on the

remote AS/400 system.• A file can be retrieved from a trading partner's FTP Server.• AS/400 data queries can be run and sent directly to a useer desktop. No more file downloads

because iSeries Office Integratorsends the data directly to a folder on the user's desktop.

The possibilities for utilizing the iSeries Office Integrator file transfer API are limited only by yourimagination.

If you have a scenario you would like to discuss, please contact RJS Software Systems forassistance.

1.3.4 Overview of Remote Command API

Usually people think of FTP as simply a file transfer mechanism; however it can be much more thanthat. In the case of the iSeries Office Integrator Remote Command API, we have written our owncommunications layer based on FTP to allow an AS/400 application to interact directly with any PCvia FTP. This allows an AS/400 application to:

Launch any PC based application such as MS Word, Excel, Web Browser, etc. by calling the programdirectly via the command line or by calling a document name and letting Windows determine whichapplication to launch.

Launch a web browser to have it open the selected web link. This is great for adding web siteintegration into existing AS/400 applications. Green screen applications can have direct access tothe web browser.

Pop up a simple message box on the PC. This can be useful to visually notify users of AS/400events.

Directly launch MS Word or MS Excel using special *EXCEL and *WORD keywords.

Launch MS Word via OLE and perform selected data merge options. This is handy if you want tolaunch MS Word with a selected document template and have your AS/400 application passinformation into the document or perform merge functions such as replacing text at selected bookmarklocations in the template document. What a great way to replace OfficeVision/400.

Set clipboard information from the AS/400. This allows an AS/400 application to send information

iSeries Office Integrator 8

Copyright © 1992-2002 ... RJS Software Systems Inc.

directly back to the PC clipboard for pasting into any PC application.

The uses for the OFCRUNPC command functionality are endless.

We would like to hear how you plan to use this functionality.

1.3.5 Starting iSeries Office Integrator Desktop Server on PC

In order to run remote PC commands, MS Word mail merges, file transfers etc. on a remote PC fromthe AS/400, the iSeries Office Integrator program must be started on the PC.

Note: Make sure the RJS iSeries Office Integrator has been installed on the PC before continuing.

Start the RJS iSeries Office Integrator program from the RJS iSeries Office integrator programgroup.

When the main Window is displayed, click the Start button to start the desktop server.

iSeries Office Integrator Main Window

Then minimize the Server program and it will show in the system tray.

The PC is now ready to receive file transfers and run remote commands.

The iSeries Office Integrator program only needs to be started once. It will remain running until the PCis shut down or the program is closed.

iSeries Office Integrator9

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.3.6 First Steps - Running Sample CL Programs

Each of the included CL program samples are compiled and ready to run from the main menu.

Try out these samples to quickly see how the iSeries Office Integrator works.

Note: Make sure the iSeries Desktop Integrator Desktop Server is running on the PC beforeattempting to run any of these menu options. Otherwise the samples will not work correctly.

Type GO RJSOFFICE and press Enter to get to the main menu.

Listed below are the sample program menu options and a description of what will happen when theoption is run:

Option 10 - Work with Sample Source CodeThis menu option is used to display all the included sample CL programs in the SOURCE source file inthe RJSOFFICE library.

Note: This option assumes that you have the IBM Application Development software tools on yourAS/400 system and are familiar with using them.

Option 11 - Run Single Letter Mail MergeThis menu option is a ready to run example of creating a single mail merge letter from an application.It opens the selected template name and passes data to the template bookmarks by calling theOFCRUNPC command.

Option 12 - Run Multiple Letter Mail MergeThis menu option is a ready to run example of creating a multiple letter mail merge letter from anapplication. It converts an AS/400 file to CSV format with column headings, transfers the file to theuser desktop and then runs the mail merge to merge the AS/400 data with the selected lettertemplate.

Option 13 - Launch MS WordThis menu option is a ready to run example of launching MS Word.

Option 14 - Launch MS ExcelThis menu option is a ready to run example of launching MS Excel.

Option 15 - Launch a Web SiteThis menu option is a ready to run example of launching a selected web site URL address. This is agreat way to add web browser integration to an AS/400 green screen application.

Option 16 - Run Windows Calculator Command LineThis menu option is a ready to run example of launching a PC program by passing a PC command lineto the OFCRUNPC API. This example launches the Windows calculator.

Option 17 - Display Message Box on User PCThis menu option is a ready to run example of how to display a simple message box on a user PC andwait for an OK response.

Option 18 - Copy Data From AS/400 to Windows ClipboardThis menu option is a ready to run example of how to copy lines of data to the Windows clipboardfrom an AS/400 application and paste them into the application.

iSeries Office Integrator 10

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.3.7 Sending Your First File to a PC Desktop via FTP

Let's begin by sending our first file from the AS/400 via FTP. This example will actually send a filefrom an AS/400 library into the IFS on the same AS/400 system, so you can make sure everything isworking correctly.

Note: This example assumes the AS/400 FTP Server is running. If necessary you can start theAS/400 FTP server using the following AS/400 command: STRTCPSVR *FTP

Sign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE

Next type: GO RJSOFFICE and press Enter. This will take you to the iSeries Office Integrator mainmenu.

Type OFCTFR at the command line and press F4. The OFCTFR command prompt will be displayed.

Send/Receive Files via FTP Command Prompt - OFCTFR

Enter the following parameters for this test. We will be sending file QCUSTCDT from library QIWS tofile QCUSTCDT.TXT in the root IFS directory on our AS/400 system via FTP:

Note: Every AS/400 system should have this file since it's installed as part of Client Access/400.

Remote system: Change this value to LOCALHOST here since we're sending and receiving from/tothe same system.

Local file name: Enter '/QSYS.LIB/QIWS.LIB/QCUSTCDT.FILE/CUSTCDT.MBR'

iSeries Office Integrator11

Copyright © 1992-2002 ... RJS Software Systems Inc.

Remote file name: Enter '/QCUSTCDT.TXT'

Transfer function: Enter PUT

User profile on remote system: Enter a valid AS/400 user ID.

Password to remote system: Enter a valid AS/400 password.

AS/400 file name format: Enter 1 to use NAMEFMT 1.

Data format: Enter ASCII so the file gets converted to ASCII.

FTP Log Option: Enter *DSP so the log will display on screen.

Press Enter to send the start the file transfer.

When the transfer has completed the log will display telling you if there were any errors.

That's all there is to it. You've sent your first file via FTP.

To see where the file was created you can map a drive to the root AS/400 IFS directory or run thefollowing command to see the file in the IFS: WRKLNK OBJ('/qcustcdt.txt')

PC file QCUSTCDT.TXT in the AS/400 Integrated File System (IFS) root directory

iSeries Office Integrator 12

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.3.8 Sending a File to your Desktop PC

This example uses the iSeries Office Integrator software to convert an AS/400 file to CSV format andsend the file to the root directory of the PC running the iSeries Office Integrator component. TheOFCTFR command is utilized to send the file.

This is a simple two step process for transferring a data file from the AS/400 to a user desktop.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

Run the following commands to convert the sample AS/400 file to CSV format and send to yourdesktop:

1.) The command listed below creates a file named: qcustcdt.txt in the root IFS directory.

OFCEXPORT FILE(QIWS/QCUSTCDT) FILNAM('/qcustcdt.txt') MBROPT(*REPLACE)DTAFMT(*CSV)

2.) The command listed below sends the selected file to the root directory of the C: drive of the PCcalling the command. It will display the FTP log after the transfer has completed.

OFCTFR RMTSYS(*CURRENT) LCLFIL('/qcustcdt.txt') RMTFIL('/qcustcdt.txt') FUNCTION(PUT)USR(TEST) PWD(TEST) NAMEFMT(1) FORMAT(BINARY) LOGOPT(*DSP)

3.) From the windows desktop, select start/run and type c:\qcustcdt.txt and click OK to open thetext file.

Start Run Screen

4.) The text file will be displayed in your default text editor. This is usually Windows Notepad.

iSeries Office Integrator13

Copyright © 1992-2002 ... RJS Software Systems Inc.

CSV Text File Displayed in Windows Notepad

1.3.9 Sending an SQL Query to your Desktop PC

This example uses the OFCSQLIFS command to run an SQL query, convert the results to CSV formatand then send the file to the root directory of the PC running the iSeries Office Integrator component.The OFCTFR command is utilized to send the file.

This is a simple two step process for transferring an AS/400 data query from the AS/400 to a userdesktop.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

Run the following commands to convert the sample AS/400 file to CSV format and send to yourdesktop:

1.) The SQL query command listed below creates a file named: qcustcdt.txt in the root IFS directoryafter selecting all records from file QCUSTCDT in library QIWS.

OFCSQLIFS SQL('SELECT * FROM QIWS/QCUSTCDT') IFSFILE('/qcustcdt.TXT')MBROPT(*REPLACE) DTAFMT(*CSV)

iSeries Office Integrator 14

Copyright © 1992-2002 ... RJS Software Systems Inc.

2.) The command listed below sends the selected file to the root directory of the C: drive of the PCcalling the command. It will display the FTP log after the transfer has completed.

OFCTFR RMTSYS(*CURRENT) LCLFIL('/qcustcdt.txt') RMTFIL('/qcustcdt.txt') FUNCTION(PUT)USR(TEST) PWD(TEST) NAMEFMT(1) FORMAT(BINARY) LOGOPT(*DSP)

3.) From the windows desktop, select start/run and type c:\qcustcdt.txt and click OK to open thetext file.

Start Run Screen

4.) The text file will be displayed in your default text editor. This is usually Windows Notepad.

CSV Text File Displayed in Windows Notepad

1.3.10 Running PC Commands from the AS/400

In the next section you will run some sample PC commands from the AS/400 to copy data to theclipboard, launch a word document and more.

iSeries Office Integrator15

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.3.11 Copying Data to the Windows Clipboard with OFCRUNPC

This example will clear the windows clipboard and copy the selected text string from the AS/400 5250session to the clipboard on your PC. The windows clipboard is a nice way to quickly exchange databetween an AS/400 5250 display session and a windows PC.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

1.) Go to the RJSOFFICE menu (GO RJSOFFICE) and select menu option 18. Copy Data fromAS/400 to Windows Clipboard

The AS/400 will send data to the Windows clipboard and the launch MS Word. Once MS Word opens,you can paste the clipboard data into MS Word to see if the integration commands worked.

-or-

1.) Run the following commands to copy data from the AS/400 5250 session to the Windowsclipboard:

OFCRUNPC RMTSYS(*CURRENT) CMD('This is a test') OPTION(*CLIPCLEAR)OFCRUNPC RMTSYS(*CURRENT) CMD('This is a test') OPTION(*CLIPSET)

Now launch the Windows Notepad program or your Word Processor program and select Edit/Pasteto paste the clipboard data into your PC program.

If the clipboard paste works, you should see the string: "This is a test" in your PC program.

iSeries Office Integrator 16

Copyright © 1992-2002 ... RJS Software Systems Inc.

Windows Notepad with pasted clipboard string

1.3.12 Launching a Web Site with OFCRUNPC

This example will launch a web browser window with the selected web site on your PC. This is a niceway to build web site integration into any AS/400 green screen application.

Imagine entering data into an order entry program and then pressing a function key such as F8 toquickly take you to the FedEx or UPS web site.

Alternatively, imagine calling your web based imaging application from an AS/400 green screen andpassing a key value such as customer number, part number, etc. with the web site call.

The applications for web browser integration with an AS/400 5250 session are endless.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

1.) Go to the RJSOFFICE menu (GO RJSOFFICE) and select menu option 15. Launch a Web Site

Your web browser should launch and display the YAHOO.COM web site.

-or-

iSeries Office Integrator17

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.) Run the following command to launch the selected web site:

OFCRUNPC RMTSYS(*CURRENT) CMD('http://www.yahoo.com') OPTION(*WEBSITE)

If it works correctly you should see the Yahoo web site appear in the web browser window on yourPC.

Yahoo Web site launched with OFCRUNPC *WEBSITE option

1.3.13 Running a PC Program with OFCRUNPC

This example will launch the Windows Notepad program from your PC.

Any PC command line can be called using the OFCRUNPC command.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

1.) Go to the RJSOFFICE menu (GO RJSOFFICE) and select menu option 16. Run WindowsCalculator Command Line

The windows calculator program should launch.

-or-

iSeries Office Integrator 18

Copyright © 1992-2002 ... RJS Software Systems Inc.

Run the following command to launch Windows Notepad on your PC:

OFCRUNPC RMTSYS(*CURRENT) CMD('CALC.EXE') OPTION(*LAUNCHEXEC)

If it works correctly you should see the Windows Calculator program appear on your PC.

Windows Calculator

1.3.14 Creating ODBC Data Source for Mail Merge

In order to run a MS Word mail merge an ODBC data source named Text Files must be created onthe PC. This is a one time setup step.

Note: The iSeries Office Integrator PC Installation should have created this data source automaticallyduring installation. Run ODBCAD32.EXE as listed below and check the System DSN's to see if TextFiles already exists.

If the DSN: Text Files already exists, the rest of the ODBC Data Source Setup section can beskipped.

The steps listed below should be used to create an ODBC data source called: Text Files

From Windows desktop, select Start/Run and type: ODBCAD32.EXE.

Click OK to start the ODBC Data Source Administrator.

Click the System DSN tab.

iSeries Office Integrator19

Copyright © 1992-2002 ... RJS Software Systems Inc.

Click the Add button to create a new ODBC data source.

Select Microsoft Text Driver for the driver type and click the Finish button.

Enter Text Files for the data source name.

iSeries Office Integrator 20

Copyright © 1992-2002 ... RJS Software Systems Inc.

Click OK to create the new data source.

The Text Files data source will be utilized for all mail merges.

If you have problems creating an ODBC data source, you can get the latest ODBC driver updatesfrom Microsoft, http://www.microsoft.com/data otherwise contact RJS Software Systems forassistance.

1.3.15 Running Your First MS Word Single Letter Merge

This example will launch MS Word and pass data from the AS/400 command line into the documenttemplate based on bookmarks defined in the template.

A good use for this type of letter would be to place a letter merge behind a function key in an AS/400user program.

Imagine an A/R clerk pressing F8 to have the A/R inquiry generate a collection letter on the fly orquickly create a customer thank you letter without cutting and pasting information.

There are unlimited uses for MS Word letter creation with live AS/400 data.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

1.) Go to the RJSOFFICE menu (GO RJSOFFICE) and select menu option 11. Run Single LetterMail Merge

The single letter mail merge should run automatically

-or-

Run the following commands to run the selected merge to create a single letter with the selectedAS/400 data. These commands can be embedded into a CL program.

iSeries Office Integrator21

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.) The following CL command launches MS Word and gets it ready to receive letter mergecommands.

OFCRUNPC RMTSYS(*CURRENT) CMD('WORDLAUNCH') OPTION(*WORDOLE)

2.) The following CL command opens the MS Word template that contain the following bookmarks:TO_FIELD, FROM_FIELD, CC_FIELD, RE_FIELD and SINCERELY_FIELD

OFCRUNPC RMTSYS(*CURRENT) CMD('WORDOPENTEMPLATE~C:\ProgramFiles\RJSOFFICESV\TESTMEMO.DOT') OPTION(*WORDOLE)

3.) The following CL command inserts the selected data values at each of the bookmarks:

OFCRUNPC RMTSYS(*CURRENT) CMD('WORDINSERTBOOKMARK~TO_FIELD~ValuedCustomer~FROM_FIELD~RJS Software~CC_FIELD~Nobody Else~RE_FIELD~This is a iSeriesOffice Integrator MS Word Test') OPTION(*WORDOLE)

4.) The following CL command jumps to the signature bookmark:

OFCRUNPC RMTSYS(*CURRENT) CMD('WORDINSERTBOOKMARK~SINCERELY_FIELD~')OPTION(*WORDOLE)

5.) The following CL command inserts the sincerely salutation at the signature bookmark:

OFCRUNPC RMTSYS(*CURRENT) CMD('WORDINSERTTEXT~Sincerely<CRLF>JamesJohnson<CRLF>President') OPTION(*WORDOLE)

If these steps works correctly you should see the MS Word program appear and look similar to thefollowing:

iSeries Office Integrator 22

Copyright © 1992-2002 ... RJS Software Systems Inc.

Letter Created with Live AS/400 Data passed in from a 5250 Program

1.3.16 Running Your First MS Word Mail Merge

This example will run the OFCEXPORT command to select and send all customer records from acustomer file, launch MS Word and merge the live AS/400 data with each name to create acustomized letter document for each customer.

Mail merges are a great way to send customized letters to several vendors or customers withouthand keying each letter.

Information is extracted from an AS/400 database and then sent to MS Word automatically for mailmerge processing using three easy to use CL commands.

There are unlimited uses for MS Word mail merges created with live AS/400 data.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

Note: Make sure you have a directory on your C: drive named C:\TEMP or the mail merge will notwork correctly.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

1.) Go to the RJSOFFICE menu (GO RJSOFFICE) and select menu option 12. Run Multiple LetterMail Merge

iSeries Office Integrator23

Copyright © 1992-2002 ... RJS Software Systems Inc.

The multiple letter mail merge should run automatically

-or-

Run the following commands to run the selected merge to create a single merged word document thatcontains all pages merged with the selected AS/400 data. These commands can be embedded into aCL program.

1.) The command listed below creates a mail merge data file named: rjscust.txt and sends it toC:\Program Files\RJSOFFICE on the local PC hard drive.

OFCDBSND RMTSYS(*CURRENT) FILE(RJSOFFICE/RJSCUST) COLHDG(*YES)RMTFIL('''/Program Files/RJSOFFICE/RJSCUST.TXT''') USR(TEST) PWD(TEST)

2.) The following CL command runs the mail merge using the specified template name:

OFCRUNPC RMTSYS(*CURRENT) CMD('MERGELETTER~C:\ProgramFiles\RJSOFFICE\MERGE1.DOT~C:\Program Files\RJSOFFICE\RJSCUST.TXT')OPTION(*WORDOLE)

If these steps work correctly you should see the MS Word program appear and look similar to thefollowing:

Mail Merge Created with Live AS/400 Data passed in from AS/400 Data Query

1.3.17 Running a Mail Merge and Printing the Document

This example will run the OFCEXPORT command to select and send all customer records from acustomer file, launch MS Word and merge the live AS/400 data with each name to create a

iSeries Office Integrator 24

Copyright © 1992-2002 ... RJS Software Systems Inc.

customized letter document for each customer. The document will then be printed to the selected PCprinter.

Mail merges are a great way to send customized letters to several vendors or customers withouthand keying each letter.

Information is extracted from an AS/400 database and then sent to MS Word automatically for mailmerge processing using three easy to use CL commands.

There are unlimited uses for MS Word mail merges created with live AS/400 data.

PC StepsMake sure the iSeries Office Integrator is running as described in Starting iSeries Office IntegratorRemote Command Server on PC.

Note: Make sure you have a directory on your C: drive named C:\TEMP or the mail merge will notwork correctly.

AS/400 StepsSign on to the AS/400 system and add the RJSOFFICE library to your library list by using thefollowing AS/400 command: ADDLIBLE RJSOFFICE.

Run the following commands to run the selected merge to create a single merged word document thatcontains all pages merged with the selected AS/400 data and. This option also auto prints thedocument. These commands can be embedded into a CL program.

1.) The command listed below creates a mail merge data file named: rjscust.txt and sends it toC:\Program Files\RJSOFFICE on the local PC hard drive.

OFCDBSND RMTSYS(*CURRENT) FILE(RJSOFFICE/RJSCUST) COLHDG(*YES)RMTFIL('''/Program Files/RJSOFFICE/RJSCUST.TXT''') USR(TEST) PWD(TEST)

2.) The following CL command runs the mail merge using the specified template name:

OFCRUNPC RMTSYS(*CURRENT) CMD('MERGELETTERPRINT~C:\ProgramFiles\RJSOFFICE\MERGE1.DOT~C:\Program Files\RJSOFFICE\RJSCUST.TXT~HP LaserJet4000') OPTION(*WORDOLE)

If these steps work correctly you should see the MS Word program appear, open the document,automatically print the document and then close itself.

Note: If you get a printer error when running this option, start MS Word and select File/Print. Findyou printer in the pulldown list of printers and use that name when running the MERGELETTERPRINToption.

By adding the two commands above to a CL program, a document merge process with automaticprinting can be easily created.

iSeries Office Integrator25

Copyright © 1992-2002 ... RJS Software Systems Inc.

Mail Merge Created with Live AS/400 Data passed in from AS/400 Data Query

1.3.18 What's Next After Getting Started?

You should now have the basics down for sending files via FTP, running PC commands and creatingMS Word mail merges from the AS/400. The next few sections are a reference for each of the iSeriesOffice Integrator commands and available parameters.

1.4 Main Menu

1.4.1 Introduction to Main Menu

This section gives an overview of the iSeries Office Integrator main menu and the available options.

iSeries Office Integrator 26

Copyright © 1992-2002 ... RJS Software Systems Inc.

iSeries Office Integrator Main Menu

iSeries Office Integrator27

Copyright © 1992-2002 ... RJS Software Systems Inc.

iSeries Office Integrator Main Menu Page 2

1.4.2 Getting to the Main Menu

Sign on to the AS/400 system and add the RJSOFFICE library to your library list using the followingAS/400 command: ADDLIBLE RJSOFFICE.

Next type: GO RJSOFFICE and press Enter. This will take you to the iSeries Office Integrator mainmenu.

1.4.3 Available Options on the Main Menu

Option 1 - Enter iSeries Office Integrator License CodeThis menu option is used to enter the AS/400 access code for the iSeries Office Integrator software.An access code will be provided to you by RJS Software Systems Inc.

Option 10 - Work with Sample Source CodeThis menu option is used to display all the included sample CL programs in the SOURCE source file inthe RJSOFFICE library.

Note: This option assumes that you have the IBM Application Development software tools on yourAS/400 system and are familiar with using them.

Option 11 - Run Single Letter Mail MergeThis menu option is a ready to run example of creating a single mail merge letter from an application.It opens the selected template name and passes data to the template bookmarks by calling theOFCRUNPC command.

iSeries Office Integrator 28

Copyright © 1992-2002 ... RJS Software Systems Inc.

Option 12 - Run Multiple Letter Mail MergeThis menu option is a ready to run example of creating a multiple letter mail merge letter from anapplication. It converts an AS/400 file to CSV format with column headings, transfers the file to theuser desktop and then runs the mail merge to merge the AS/400 data with the selected lettertemplate.

Option 13 - Launch MS WordThis menu option is a ready to run example of launching MS Word.

Option 14 - Launch MS ExcelThis menu option is a ready to run example of launching MS Excel.

Option 15 - Launch a Web SiteThis menu option is a ready to run example of launching a selected web site URL address. This is agreat way to add web browser integration to an AS/400 green screen application.

Option 16 - Run Windows Calculator Command LineThis menu option is a ready to run example of launching a PC program by passing a PC command lineto the OFCRUNPC API. This example launches the Windows calculator.

Option 17 - Display Message Box on User PCThis menu option is a ready to run example of how to display a simple message box on a user PC andwait for an OK response.

Option 18 - Copy Data From AS/400 to Windows ClipboardThis menu option is a ready to run example of how to copy lines of data to the Windows clipboardfrom an AS/400 application and paste them into the application.

Option 30 - Convert and Send AS/400 Database File to User PC - OFCDBSNDThis menu option is used to access the OFCDBSND command for sending AS/400 database filesfrom the AS/400 in CSV format. The command first converts the file to the selected PC format andthen sends it via FTP.

This command can only be used for sending files.

Option 31 - Send IFS File to User PC - OFCIFSSNDThis menu option is used to access the OFCIFSSND command for sending files from the AS/400Integrated File System (IFS).

This is a simplified version of OFCTFR with fewer parameters to enter. It can only be used forsending files.

Option 32 - Export AS/400 File to PC Format in IFS - OFCEXPORTThis menu option is used to access the OFCEXPORT command for converting an entire AS/400 datafile into PC formats such as CSV, HTML and XML.

Option 33 - Export AS/400 File to PC Format in IFS using SQL - OFCSQLIFSThis menu option is used to access the OFCSQLIFS command for converting selected records andfields from anAS/400 data file into PC formats such as CSV, HTML and XML.

Option 34 - Run SQL Query Statement - OFCSQLThis menu option is used to access the OFCSQL command for running interactive SQL queries andupdates.

iSeries Office Integrator29

Copyright © 1992-2002 ... RJS Software Systems Inc.

Note: Do note use this command unless you know a lot about SQL and are comfortable usinginteractive SQL.

Option 40 - Run Job on Remote Windows based PC - OFCRUNPCThis menu option is used to access the OFCRUNPC command for running PC commands from theAS/400 system.

1.5 AS/400 Commands

1.5.1 Introduction to AS/400 Commands

This section gives an overview of the iSeries Office Integrator AS/400 commands. The iSeries OfficeIntegrator commands can be embedded in any RPG, CL or COBOL program as well as any otherAS/400 language.

1.5.2 OFCDBSND: Send AS/400 Database File via FTP

The OFCDBSND command is used to send any AS/400 database file via FTP in CSV (CommaSeparated Variable), HTML or XML format. The command has built-in error checking so if the FTPtransfer fails, a CPF9898 escape message will be issued so user programs can be notified there wasa transfer failure.

Almost any PC application, including MS Access, Word or Excel can read CSV files so CSV is a goodcommon data format to use when exchanging files with remote sites or sending data to user desktopPCs.

OFCDBSND Command Parameters

iSeries Office Integrator 30

Copyright © 1992-2002 ... RJS Software Systems Inc.

Remote SystemThis parameter holds the IP address or Host Name of the FTP server you will be connecting to.

If *CURRENT is entered here, the PC where the current 5250 session is being run will be accessed.

Using *CURRENT eliminates the need to know your PC's TCP/IP address

From File Name/LibraryThis parameter holds the AS/400 Library/File/Member you wish to send via FTP.

Example File: QCUSTCDT

Example Library: QIWS

Example Member: *FIRST

To Remote File NameThis parameter holds the name of the remote file you are sending to.

Example: /QCUSTCDT.TXT

User Profile on Remote SystemEnter a valid user ID for the remote FTP server.

Password to Remote SystemEnter a valid password for the remote FTP server.

Data FormatBINARY - Do not change data formatting. Leave data in original format.

This format is very useful for transmitting AS/400 libraries or object data contained in save files. It'salso useful for storing ASCII data on the AS/400.

When transferring PC file into the IFS or from the IFS to a PC or Unix FTP server, this is usually thesetting that will be used because the data files will already be in the required PC format.

ASCII - Perform ASCII translation.

EBCDIC - Perform EBCDIC translation.

FTP Log Option*DSP - Display log after processing.*PRT - Print the log after processing.*NONE -Do not generate a log during processing.

FTP Command(s) Before Transfer (1-3)These parameters hold up to 3 FTP commands that can be run on the remote system before the filetransfer takes place. This can be used to run AS/400 jobs, create save files, etc.

Example remote AS/400 command to add library QGPL to library list: QUOTE RCMD ADDLIBLEQGPL

FTP Command(s) After Transfer (1-3)These parameters hold up to 3 FTP commands that can be run on the remote system after the filetransfer takes place. This can be used to run AS/400 jobs, create save files, etc.

iSeries Office Integrator31

Copyright © 1992-2002 ... RJS Software Systems Inc.

Example remote AS/400 command to submit job on remote AS/400: SBMJOB CMD(CALLPGM(TEST999)

Example Command Line Using OFCDBSND

This example sends an AS/400 file member to a remote FTP server and converts the data to ASCIICSV format.OFCDBSND RMTSYS(LOCALHOST) FILE(QIWS/QCUSTCDT) MBR(*FIRST)RMTFIL('/QCUSTCDT.TXT') USR(QSYSOPR) PWD(QSYSOPR) FORMAT(ASCII) LOGOPT(*DSP)

1.5.3 OFCIFSSND: Send File from IFS Directory via FTP

The OFCIFSSND command is a simplified version of the OFCTFR command used to send a file fromthe AS/400 IFS via FTP. The command has built-in error checking so if the FTP transfer fails, aCPF9898 escape message will be issued so user programs can be notified there was a transferfailure.

OFCIFSSND Command Parameters

Remote SystemThis parameter holds the IP address or Host Name of the FTP server you will be connecting to.

If *CURRENT is entered here, the PC where the current 5250 session is being run will be accessed.

Using *CURRENT eliminates the need to know your PC's TCP/IP address

From IFS File NameThis parameter holds the name of the local file you are sending from.

iSeries Office Integrator 32

Copyright © 1992-2002 ... RJS Software Systems Inc.

AS/400 data member example: /QSYS.LIB/QIWS.LIB/QCUSTCDT.FILE/CUSTCDT.MBR

IFS file Example: /TEMP/DATA.TXT

To Remote File NameThis parameter holds the name of the remote file you are sending to.

Example: /QCUSTCDT.TXT

User Profile on Remote SystemEnter a valid user ID for the remote FTP server.

Password to Remote SystemEnter a valid password for the remote FTP server.

Data FormatBINARY - Do not change data formatting. Leave data in original format.

This format is very useful for transmitting AS/400 libraries or object data contained in save files. It'salso useful for storing ASCII data on the AS/400.

When transferring PC file into the IFS or from the IFS to a PC or Unix FTP server, this is usually thesetting that will be used because the data files will already be in the required PC format.

ASCII - Perform ASCII translation.

EBCDIC - Perform EBCDIC translation.

FTP Log Option*DSP - Display log after processing.

*PRT - Print the log after processing.

*NONE - Do not generate a log during processing.

FTP Command(s) Before Transfer (1-3)These parameters hold up to 3 FTP commands that can be run on the remote system before the filetransfer takes place. This can be used to run AS/400 jobs, create save files, etc.

Example remote AS/400 command to add library QGPL to library list: QUOTE RCMD ADDLIBLEQGPL

FTP Command(s) After Transfer (1-3)These parameters hold up to 3 FTP commands that can be run on the remote system after the filetransfer takes place. This can be used to run AS/400 jobs, create save files, etc.

Example remote AS/400 command to submit job on remote AS/400: SBMJOB CMD(CALLPGM(TEST999)

Example Command Line Using OFCIFSSND

This example sends an AS/400 file member to a remote FTP server and converts the data to ASCIIformat.

OFCIFSSND RMTSYS(LOCALHOST)

iSeries Office Integrator33

Copyright © 1992-2002 ... RJS Software Systems Inc.

IFSFILE('/QSYS.LIB/QIWS.LIB/QCUSTCDT.FILE/CUSTCDT.MBR') RMTFIL('/QCUSTCDT.TXT')USR(QSYSOPR) PWD(QSYSOPR) FORMAT(ASCII) LOGOPT(*DSP)

1.5.4 OFCEXPORT - Export AS/400 File to PC Format

The OFCEXPORT command can be used to convert an entire AS/400 file into a selected PC formatand store the resulting PC file in an AS/400 IFS folder or QDLS Shared Folder.

PC Output Formats Currently Available:

CSV - ASCII Comma Separated Variable File

HTML - HTML Table Format

TBL/Fixed - Fixed Length ASCII File

XML - XML Table Format

OFCEXPORT Command prompt screen 1

From file name/LibraryEnter the name of the AS/400 file that will get converted. Also enter the library name or *LIBL for thelibrary name.

MemberEnter the name of the AS/400 file member name to convert. (Default - *FIRST)

IFS Output File Name

iSeries Office Integrator 34

Copyright © 1992-2002 ... RJS Software Systems Inc.

Enter the name of the AS/400 IFS output file where the converted data will be stored. Data can beoutput into a regular IFS folder off the AS/400 root directory or files can be created in the old sharedfolders file system QDLS.

Note: If files are output to a QDLS shared folder, the file names can only be 8.3 characters becauseQDLS does not support long file names. The root IFS system supports long file names.

Example output file names:

1.) The example listed below shows an IFS output file name of CSV1.TXT getting created in adirectory named FILES off the root IFS directory.

/FILES/CSV1.TXT

2.) The example listed below shows an IFS output file name of CSV1.TXT getting created in a QDLSshared folder named FILES within the QDLS subdirectory.

/QDLS/FILES/CSV1.TXT

Replace or add recordsThis option determines whether to replace all records or add records to an existing IFS output file.This feature is nice if you want to convert multiple AS/400 files into a single PC file.

*REPLACE - Replace all record in the IFS output file. (Default)*ADD - Add to an existing IFS output file.

Record delimiterThis option determines the character sequence that will be placed at the end of each data line todenote a new line of data.

*CRLF - A carriage return/line feed combination is placed at the end of the record. (Default)*LF - A line feed is placed at the end of the record.*CR - A carriage return is placed at the end of the record.*CRLF - A line feed/carriage return combination is placed at the end of the record.

Output last record delimiterThis option determines if the record delimiter value gets output after the last record in the file. In somerare situations, you may want a file created without a record delimiter after the last record in anoutput file.

*YES - Output record delimiter after last record. (Default)*NO - Don't output record delimiter after last record.

Record format of output fileThis option determines which output PC data type to use when the AS/400 file gets converted.

*CSV - Comma Separated Variable. CSV is the most widely used export format. This format can beautomatically opened by MS Excel, MS Access and can be opened or imported by just about any PCsoftware product that has a data import feature. (Default)

*TBL - Fixed Length ASCII Format. Some software packages can only import from a fixed lengthASCII record. The fixed length format is useful when an application must write to a fixed length outputfile because the application that will read the file requires a fixed length format. In general, you shouldattempt to use *CSV instead of fixed length if possible.

iSeries Office Integrator35

Copyright © 1992-2002 ... RJS Software Systems Inc.

*HTM - HTML Table Format. HTML format is an ideal way to publish AS/400 table queries to a website on a daily basis. HTML tables as well as the other formats can be emailed with SMTP/400 toprovide daily email updates to a remote user. The HTML tables can also be published via FTP/400 orbasic AS/400 FTP to any web site. If using the AS/400 web server, the resulting HTML file can besimply converted to an IFS folder and the table file will be immediately available via the AS/400 webserver.

*XML - XML Table Format. XML table format is an ideal way to publish AS/400 table queries to a website or send data to an EDI provider on a regular basis. Users can then create XSL style sheets withtheir favorite HTML editor to allow the XML files to be easily viewed from the web.

Future direction: The future direction for XML output is to be able to publish one or more parent/childrelationships for applications such as sending invoices, orders, etc. where the information isn'tpresented in a single table format. Contact RJS Software Systems if you would like to further discussXML formatting.

*SV - Do not use this format. It is basically the same as *CSV, so use the *CSV format instead.

Field delimiterWhen *CSV is used for the output format, the field delimiter setting determine the value placedbetween each field in the output file. Usually a comma is placed between each record, but someapplications use a different delimiter such as a tab value, tilde - ~, pipe - | etc.

*COMMA - Place a comma between each record.(Default)*BLANK - Place a blank character between each record.*TAB - Place a tab character between each record.Character value - Key any other single character value that you would like to use instead of acomma, blank or tab character.

Output column headingsEnable this setting if you want the first record in the output file to contain column headings.

*YES - Output column headings in first record.*NO - Don't output column headings in first record.(Default)

Output quotes around textEnable this setting if you want all text values to be surrounded with double quotes. Some applicationsrequire quotes to be placed around all text values and some do not.

Example text with double quotes: "This is a test"Example text without double quotes: This is a test

*YES - Output quotes around text. (Default)*NO - Don't output quotes around text.

XML/HTML Report HeadingEnter the report/file heading for the selected HTML table report or XML file. This is a descriptive titlethat will be placed in the resulting HTML or XML file as a heading.

XML/XSL Stylesheet URLEnter the URL of the location of the XSL style sheet used to display the XML file when viewed withInternet Explorer. XSL style sheets allow XML to be displayed in a selected table format.

If you are not yet familiar with XSL style sheets, use the Web site listed below or your favorite XMLsite to learn more about XSL style sheets and XML.

iSeries Office Integrator 36

Copyright © 1992-2002 ... RJS Software Systems Inc.

http://www.xml101.com

HTML Heading Foreground ColorThis setting will output the 6 digit color value to be used for the HTML Heading Foreground Color.

#FFFFFF - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Heading Background ColorThis setting will output the 6 digit color value to be used for the HTML Heading Background Color.

#800000 - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Text Foreground ColorThis setting will output the 6 digit color value to be used for the HTML Text Foreground Color.

#000000 - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Text Background ColorThis setting will output the 6 digit color value to be used for the HTML Text Background Color.

#F7EFDE - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Title Foreground ColorThis setting will output the 6 digit color value to be used for the HTML Title Foreground Color.

#000000 - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoftware.com/htmlcolor.htm

Column Heading InfoThis setting determines the format of the column headings if they are output.

*FLDNAME - Output the field name from the AS/400 file being converted. (Default)

*COLHDG1 - Output the column heading 1 value from the AS/400 file definition.

*COLHDG2 - Output the column heading 2 value from the AS/400 file definition.

*COLHDG3 - Output the column heading 3 value from the AS/400 file definition.

*FLDTEXT - Output the field text value from the AS/400 file definition.

iSeries Office Integrator37

Copyright © 1992-2002 ... RJS Software Systems Inc.

Change IFS output authorityUse this setting if you want to change the IFS authority assigned to the IFS output file when it getscreated. You will need to do so if you wish users other than the file owner/creator to have access tothe file. Usually an IFS output file gets created with *PUBLIC - *EXCLUDE authority so only userswith *ALLOBJ or the owner can view the files.

*YES - Change the default IFS output authority*NO - Don't change the default IFS output authority.(Default)

UserUse this setting to determine which AS/400 user will have authority to the IFS output file beingcreated if the change IFS output authority setting is enabled.

*PUBLIC - This is the catch-all value for all AS/400 users. (Default)Enter a selected AS/400 user ID

New data authoritiesUse this setting to alter data authority for the output file when it gets created in the selected IFS folderif the change IFS output authority setting is enabled.

Specifies the data authorities being given to the users specified in the user parameter. If a valueother than *SAME is specified, the value replaces any data authorities (*OBJOPR, *READ, *ADD,*UPD, *DLT, and *EXECUTE) that the users currently have to the objects.

*SAME - The users' data authorities to the objects do not change.

*NONE - The users do not have any of the data authorities to the objects.

*RWX - The users are given *RWX authority to the objects. The users are given *RWX authority toperform all operations on the object except those limited to the owner or controlled by objectexistence, object management, object alter, and object reference authority. The user can change theobject and perform basic functions on the object. *RWX authority provides object operationalauthority and all the data authorities. (Default)

*RX - The users are given *RX authority to perform basic operations on the object, such as run aprogram or display the contents of a file. The user is prevented from changing the object. *RXauthority provides object operational authority and read and execute authorities.

*RW - The users are given *RW authority to view the contents of an object and change the contentsof an object. *RW authority provides object operational authority and data read, add, update, anddelete authorities.

*WX - The users are given *WX authority to change the contents of an object and run a program orsearch a library or directory. *WX authority provides object operational authority and data add,update, delete, and execute authorities.

*R - The users are given *R authority to view the contents of an object. *R authority provides objectoperational authority and data read authority.

*W - The users are given *W authority to change the contents of an object. *W authority providesobject operational authority and data add, update, and delete authorities.

*X - The users are given *X authority to run a program or search a library or directory. *X authorityprovides object operational authority and data execute authority.

iSeries Office Integrator 38

Copyright © 1992-2002 ... RJS Software Systems Inc.

*EXCLUDE - Exclude authority prevents the user from accessing the object.

*AUTL - The public authority of the authorization list specified in the AUTL parameter is used for thepublic authority for the object.

New object authoritiesUse this setting to alter object authority for the output file when it gets created in the selected IFSfolder if the change IFS output authority setting is enabled.

*SAME -The users' object authorities to the objects do not

*NONE - The users do not have any other object authorities (existence, management, alter, orreference). If*EXCLUDE or *AUTL is specified for the DTAAUT parameter, this value must be specified.

*ALL - All of the other object authorities (existence, management, alter, and reference) are given tothe users. (Default)

*OBJEXIST - The users are given object existence authority to the object.

*OBJMGT - The users are given object management authority to the object.

*OBJALTER - The users are given object alter authority to the object.

*OBJREF - The users are given object reference authority to the object.

1.5.5 OFCSQLIFS: Export AS/400 File to Selected PC Format using SQL

The OFCSQLIFS command can be used to convert selected records and fields from an AS/400 fileinto a selected PC format and store the resulting PC file in an AS/400 IFS folder or QDLS SharedFolder.

PC Output Formats Currently Available:

CSV - ASCII Comma Separated Variable File

HTML - HTML Table Format

TBL/Fixed - Fixed Length ASCII File

XML - XML Table Format

iSeries Office Integrator39

Copyright © 1992-2002 ... RJS Software Systems Inc.

OFCSQLIFS command prompt screen 1

SQL Select StatementEnter an SQL record select statement to select records and field from an AS/400 file.

1.) The example listed below selects all records from a file named QCUSTCDT in library QIWS.

SELECT * FROM QIWS/QCUSTCDT

2.) The example listed below selects all records from a file named QCUSTCDT in library QIWS thatmatch the state of Minnesota.

SELECT * FROM QIWS/QCUSTCDT WHERE STATE = 'MN'

3.) The example listed below selects only the customer ID and customer name from a file namedQCUSTCDT in library QIWS.

SELECT CUSNUM, LSTNAM, INIT FROM QIWS/QCUSTCDT

More information on using AS/400 SQL can be found at the IBM AS/400 web site:http://www.as400.ibm.com

IFS Output File NameEnter the name of the AS/400 IFS output file where the converted data will be stored. Data can beoutput into a regular IFS folder off the AS/400 root directory or files can be created in the old sharedfolders file system QDLS.

Note: If files are output to a QDLS shared folder, the file names can only be 8.3 characters because

iSeries Office Integrator 40

Copyright © 1992-2002 ... RJS Software Systems Inc.

QDLS does not support long file names. The root IFS system supports long file names.

Example output file names:

1.) The example listed below shows an IFS output file name of CSV1.TXT getting created in adirectory named FILES off the root IFS directory.

/FILES/CSV1.TXT

2.) The example listed below shows an IFS output file name of CSV1.TXT getting created in a QDLSshared folder named FILES within the QDLS subdirectory.

/QDLS/FILES/CSV1.TXT

Replace or add recordsThis option determines whether to replace all records or add records to an existing IFS output file.This feature is nice if you want to convert multiple AS/400 files into a single PC file.

*REPLACE - Replace all record in the IFS output file. (Default)*ADD - Add to an existing IFS output file.

Record delimiterThis option determines the character sequence that will be placed at the end of each data line todenote a new line of data.

*CRLF - A carriage return/line feed combination is placed at the end of the record. (Default)*LF - A line feed is placed at the end of the record.*CR - A carriage return is placed at the end of the record.*CRLF - A line feed/carriage return combination is placed at the end of the record.

Output last record delimiterThis option determines if the record delimiter value gets output after the last record in the file. In somerare situations, you may want a file created without a record delimiter after the last record in anoutput file.

*YES - Output record delimiter after last record. (Default)*NO - Don't output record delimiter after last record.

Record format of output fileThis option determines which output PC data type to use when the AS/400 file gets converted.

*CSV - Comma Separated Variable. CSV is the most widely used export format. This format can beautomatically opened by MS Excel, MS Access and can be opened or imported by just about any PCsoftware product that has a data import feature. (Default)

*TBL - Fixed Length ASCII Format. Some software packages can only import from a fixed lengthASCII record. The fixed length format is useful when an application must write to a fixed length outputfile because the application that will read the file requires a fixed length format. In general, you shouldattempt to use *CSV instead of fixed length if possible.

*HTM - HTML Table Format. HTML format is an ideal way to publish AS/400 table queries to a website on a daily basis. HTML tables as well as the other formats can be emailed with SMTP/400 toprovide daily email updates to a remote user. The HTML tables can also be published via FTP/400 orbasic AS/400 FTP to any web site. If using the AS/400 web server, the resulting HTML file can besimply converted to an IFS folder and the table file will be immediately available via the AS/400 web

iSeries Office Integrator41

Copyright © 1992-2002 ... RJS Software Systems Inc.

server.

*XML - XML Table Format. XML table format is an ideal way to publish AS/400 table queries to a website or send data to an EDI provider on a regular basis. Users can then create XSL style sheets withtheir favorite HTML editor to allow the XML files to be easily viewed from the web.

Future direction: The future direction for XML output is to be able to publish one or more parent/childrelationships for applications such as sending invoices, orders, etc. where the information isn'tpresented in a single table format. Contact RJS Software Systems if you would like to further discussXML formatting.

*SV - Do not use this format. It is basically the same as *CSV, so use the *CSV format instead.

Field delimiterWhen *CSV is used for the output format, the field delimiter setting determine the value placedbetween each field in the output file. Usually a comma is placed between each record, but someapplications use a different delimiter such as a tab value, tilde - ~, pipe - | etc.

*COMMA - Place a comma between each record.(Default)*BLANK - Place a blank character between each record.*TAB - Place a tab character between each record.Character value - Key any other single character value that you would like to use instead of acomma, blank or tab character.

Output column headingsEnable this setting if you want the first record in the output file to contain column headings.

*YES - Output column headings in first record.*NO - Don't output column headings in first record.(Default)

Output quotes around textEnable this setting if you want all text values to be surrounded with double quotes. Some applicationsrequire quotes to be placed around all text values and some do not.

Example text with double quotes: "This is a test"Example text without double quotes: This is a test

*YES - Output quotes around text. (Default)*NO - Don't output quotes around text.

XML/HTML Report HeadingEnter the report/file heading for the selected HTML table report or XML file. This is a descriptive titlethat will be placed in the resulting HTML or XML file as a heading.

XML/XSL Stylesheet URLEnter the URL of the location of the XSL style sheet used to display the XML file when viewed withInternet Explorer. XSL style sheets allow XML to be displayed in a selected table format.

If you are not yet familiar with XSL style sheets, use the Web site listed below or your favorite XMLsite to learn more about XSL style sheets and XML.http://www.xml101.com

HTML Heading Foreground ColorThis setting will output the 6 digit color value to be used for the HTML Heading Foreground Color.

iSeries Office Integrator 42

Copyright © 1992-2002 ... RJS Software Systems Inc.

#FFFFFF - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Heading Background ColorThis setting will output the 6 digit color value to be used for the HTML Heading Background Color.

#800000 - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Text Foreground ColorThis setting will output the 6 digit color value to be used for the HTML Text Foreground Color.

#000000 - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Text Background ColorThis setting will output the 6 digit color value to be used for the HTML Text Background Color.

#F7EFDE - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

HTML Title Foreground ColorThis setting will output the 6 digit color value to be used for the HTML Title Foreground Color.

#000000 - (Default)

Use the Web site listed below or your favorite HTML editor to determine HTML color values:http://www.rjssoft.com/htmlcolor.htm

Column Heading InfoThis setting determines the format of the column headings if they are output.

*FLDNAME - Output the field name from the AS/400 file being converted. (Default)

*COLHDG1 - Output the column heading 1 value from the AS/400 file definition.

*COLHDG2 - Output the column heading 2 value from the AS/400 file definition.

*COLHDG3 - Output the column heading 3 value from the AS/400 file definition.

*FLDTEXT - Output the field text value from the AS/400 file definition.

Change IFS output authorityUse this setting if you want to change the IFS authority assigned to the IFS output file when it getscreated. You will need to do so if you wish users other than the file owner/creator to have access tothe file. Usually an IFS output file gets created with *PUBLIC - *EXCLUDE authority so only userswith *ALLOBJ or the owner can view the files.

iSeries Office Integrator43

Copyright © 1992-2002 ... RJS Software Systems Inc.

*YES - Change the default IFS output authority*NO - Don't change the default IFS output authority.(Default)

UserUse this setting to determine which AS/400 user will have authority to the IFS output file beingcreated if the change IFS output authority setting is enabled.

*PUBLIC - This is the catch-all value for all AS/400 users. (Default)Enter a selected AS/400 user ID

New data authoritiesUse this setting to alter data authority for the output file when it gets created in the selected IFS folderif the change IFS output authority setting is enabled.

Specifies the data authorities being given to the users specified in the user parameter. If a valueother than *SAME is specified, the value replaces any data authorities (*OBJOPR, *READ, *ADD,*UPD, *DLT, and *EXECUTE) that the users currently have to the objects.

*SAME - The users' data authorities to the objects do not change.

*NONE - The users do not have any of the data authorities to the objects.

*RWX - The users are given *RWX authority to the objects. The users are given *RWX authority toperform all operations on the object except those limited to the owner or controlled by objectexistence, object management, object alter, and object reference authority. The user can change theobject and perform basic functions on the object. *RWX authority provides object operationalauthority and all the data authorities. (Default)

*RX - The users are given *RX authority to perform basic operations on the object, such as run aprogram or display the contents of a file. The user is prevented from changing the object. *RXauthority provides object operational authority and read and execute authorities.

*RW - The users are given *RW authority to view the contents of an object and change the contentsof an object. *RW authority provides object operational authority and data read, add, update, anddelete authorities.

*WX - The users are given *WX authority to change the contents of an object and run a program orsearch a library or directory. *WX authority provides object operational authority and data add,update, delete, and execute authorities.

*R - The users are given *R authority to view the contents of an object. *R authority provides objectoperational authority and data read authority.

*W - The users are given *W authority to change the contents of an object. *W authority providesobject operational authority and data add, update, and delete authorities.

*X - The users are given *X authority to run a program or search a library or directory. *X authorityprovides object operational authority and data execute authority.

*EXCLUDE - Exclude authority prevents the user from accessing the object.

*AUTL - The public authority of the authorization list specified in the AUTL parameter is used for thepublic authority for the object.

New object authorities

iSeries Office Integrator 44

Copyright © 1992-2002 ... RJS Software Systems Inc.

Use this setting to alter object authority for the output file when it gets created in the selected IFSfolder if the change IFS output authority setting is enabled.

*SAME -The users' object authorities to the objects do not

*NONE - The users do not have any other object authorities (existence, management, alter, orreference). If*EXCLUDE or *AUTL is specified for the DTAAUT parameter, this value must be specified.

*ALL - All of the other object authorities (existence, management, alter, and reference) are given tothe users. (Default)

*OBJEXIST - The users are given object existence authority to the object.

*OBJMGT - The users are given object management authority to the object.

*OBJALTER - The users are given object alter authority to the object.

*OBJREF - The users are given object reference authority to the object.

1.5.6 OFCSQL: Run SQL Query Statement

The OFCSQL command is a command line SQL interface to allow users who don't have AS/400 queryand don't own the AS/400 SQL product to run SQL statements to copy data, update records or deleterecords from any AS/400 data file.

OFCSQL command prompt screen 1

iSeries Office Integrator45

Copyright © 1992-2002 ... RJS Software Systems Inc.

SQL StatementEnter an SQL record statement to select records, update records or delete records from the selectedAS/400 file. If *SOURCE is entered for this setting, the SQL statements can be run from a source file.This feature is nice if you want to store the source for an SQL query in a source member.

1.) The example listed below selects all records from a file named QCUSTCDT in library QIWS.

SELECT * FROM QIWS/QCUSTCDT

2.) The example listed below selects all records from a file named QCUSTCDT in library QIWS thatmatch the state of Minnesota.

SELECT * FROM QIWS/QCUSTCDT WHERE STATE = 'MN'

3.) The example listed below selects only the customer ID and customer name from a file namedQCUSTCDT in library QIWS.

SELECT CUSNUM, LSTNAM, INIT FROM QIWS/QCUSTCDT

4.) The example listed below counts all records in the selected file and returns the record count.

SELECT COUNT(*) FROM QIWS/QCUSTCDT

5.) The example listed below resets all balances for customers from Minnesota to 0.

UPDATE QIWS/QCUSTCDT SET BALDUE = 0 WHERE STATE = 'MN'

6.) The example listed below resets all balances for all customers.

UPDATE QIWS/QCUSTCDT SET BALDUE = 0

Note: be very careful when running a query to update all records in a file. Make sure to first backupthe file to make sure important data doesn't get lost if you incorrectly run the query.

7.) The example listed below deletes all records for customers from Minnesota.

DELETE FROM QIWS/QCUSTCDT WHERE STATE = 'MN'

8.) The example listed below deletes all records for all customers.

DELETE FROM QIWS/QCUSTCDT

Note: be very careful when running a query to delete all records in a file. Make sure to first backup thefile to make sure important data doesn't get lost if you incorrectly run the query.

More information on using AS/400 SQL can be found at the IBM AS/400 web site:http://www.as400.ibm.com

OutputThis parameter determines where the results of an SQL SELECT query will be output.

* - Display the query results on screen. (Default)*PRINT - Print the query results in an unformatted spool file*OUTFILE - Output the query results to an AS/400 file in the specified library.

iSeries Office Integrator 46

Copyright © 1992-2002 ... RJS Software Systems Inc.

Query source fileEnter the name of the AS/400 source file where the SQL query source will be stored. Also enter thelibrary name or *LIBL for the library name.

Note: When creating a source file to hold query source members, make sure the record length is setto120 bytes.

Query source memberEnter the name of the source member to use when running the query.

Edit query source memberThis option determines if the query source member should be edited before the query is run. Onlyenable this setting if you need to make changes to a stored query source member.

*NO - Do not edit query source member. (Default)*YES - Edit query source member

File to receive outputThis option determines where the output file will get created if *OUTFILE was chosen for the outputoption.

Enter the name of the AS/400 output file to be created. Also enter the library name or *LIBL for thelibrary name.

Output member optionsThis option determines the name of the file member within the created output file. It also determinedwhether records are added to the output file or replaced.

*REPLACE - Replace all records in the output file. (Default)*ADD - Add records to the output file.

1.5.7 OFCTFR: Send/Receive Files via FTP

The OFCTFR command is used to send/receive files from the AS/400 to a remote system. Thecommand has built-in error checking so if the FTP transfer fails, a CPF9898 escape message will beissued so user programs can be notified there was a transfer failure.

iSeries Office Integrator47

Copyright © 1992-2002 ... RJS Software Systems Inc.

OFCTFR Command Parameters

Remote SystemThis parameter holds the IP address or Host Name of the FTP server you will be connecting to.

If *CURRENT is entered here, the PC where the current 5250 session is being run will be accessed.

Using *CURRENT eliminates the need to know your PC's TCP/IP address

Local File's NameThis parameter holds the name of the local file you are sending from or receiving to.

NAMEFMT 0 Example (Library/File.member): QIWS/QCUSTCDT.CUSTCDT

NAMEFMT 1 Example (IFS Directory path): /QSYS.LIB/QIWS.LIB/QCUSTCDT.FILE/CUSTCDT.MBR

Remote File's NameThis parameter holds the name of the remote file you are sending to or receiving from.NAMEFMT 0 Example (Library/File.Member): QIWS/QCUSTCDT.CUSTCDT

NAMEFMT 1 Example (IFS Directory path): /QSYS.LIB/QIWS.LIB/QCUSTCDT.FILE/CUSTCDT.MBR

Local Path to Receive MGETThis parameter holds the name of the directory path where files will get stored when the MGETdirective is used.

Example path to receive files to: /TEMP

iSeries Office Integrator 48

Copyright © 1992-2002 ... RJS Software Systems Inc.

In this example, files will get received to the /TEMP directory in the AS/400 IFS.

If you need help with this parameter, contact RJS Software Systems.

Remote Path to Receive MPUTThis parameter holds the name of the remote directory path where files will get stored when the MPUTdirective is used.

Example remote path which will receive files via MPUT: /TEMP

In this example, files will get sent to the /TEMP directory on the remote system.

If you need help with this parameter, contact RJS Software Systems.

Transfer FunctionThis setting tells which file transfer function will be run.

NONE - Only remote FTP commands are being run via the FTP command parameters. No file transferwill occur.

PUT - Send one local file to selected remote file.

GET - Receive one remote file to selected local file.

MPUT - Send multiple files from local system to remote directory.

MGET -Receive multiple files from remote system to local directory.

User Profile on Remote SystemEnter a valid user ID for the remote FTP server.

Password to Remote SystemEnter a valid password for the remote FTP server.

AS/400 File Name Format0 - Uses the AS/400 library naming format.

Example (Library/File.Member): QIWS/QCUSTCDT.CUSTCDT

1 - Uses the AS/400 IFS file naming format.Example (IFS Directory path): /QSYS.LIB/QIWS.LIB/QCUSTCDT.FILE/CUSTCDT.MBR

Data FormatBINARY - Do not change data formatting. Leave data in original format.

This format is very useful for transmitting AS/400 libraries or object data contained in save files. It'salso useful for storing ASCII data on the AS/400.

When transferring PC file into the IFS or from the IFS to a PC or Unix FTP server, this is usually thesetting that will be used because the data files will already be in the required PC format.

ASCII - Perform ASCII translation.

EBCDIC - Perform EBCDIC translation.

iSeries Office Integrator49

Copyright © 1992-2002 ... RJS Software Systems Inc.

FTP Log Option*DSP - Display log after processing.

*PRT - Print the log after processing.

*NONE - Do not generate a log during processing.

FTP Command(s) Before Transfer (1-3)These parameters hold up to 3 FTP commands that can be run on the remote system before the filetransfer takes place. This can be used to run AS/400 jobs, create save files, etc.

Example remote AS/400 command to add library QGPL to library list: QUOTE RCMD ADDLIBLEQGPL

FTP Command(s) After Transfer (1-3)These parameters hold up to 3 FTP commands that can be run on the remote system after the filetransfer takes place. This can be used to run AS/400 jobs, create save files, etc.

Example remote AS/400 command to submit job on remote AS/400: SBMJOB CMD(CALLPGM(TEST999)

1.5.8 OFCRUNPC: Run Job on Remote Windows Based PC

The OFCRUNPC command is used to run PC commands on a PC attached to the AS/400 running theRJS iSeries Office Integrator.

Note: Requires iSeries Office Integrator Remote Command Server license.

The OFCRUNPC command is a great way to integrate PC applications with any AS/400 application.

The OFCRUNPC command can be used to:

Launch any PC based application such as MS Word, Excel, Web Browser, etc. by calling the programdirectly via the command line or by calling a document name and letting Windows determine whichapplication to launch.

Launch a web browser to have it open the selected web link. This is great for adding web siteintegration into existing AS/400 applications. Green screen applications can have direct access tothe web browser.

Pop up a simple message box on the PC. This can be useful to visually notify users of AS/400events.

Directly launch MS Word or MS Excel using special *EXCEL and *WORD keywords.Launch MS Word via OLE and perform selected data merge options. This is handy if you want tolaunch MS Word with a selected document template and have your AS/400 application passinformation into the document or perform merge functions such as replacing text at selected bookmarklocations in the template document. What a great way to replace OfficeVision/400.

Set clipboard information from the AS/400. This allows an AS/400 application to send informationdirectly back to the PC clipboard for pasting into any PC application.

The uses for the OFCRUNPC command functionality are endless.

We would like to hear how you plan to use this functionality.

iSeries Office Integrator 50

Copyright © 1992-2002 ... RJS Software Systems Inc.

OFCRUNPC Command Parameters

Remote SystemThis parameter holds the IP address or Host Name of the FTP server you will be connecting to.

If *CURRENT is entered here, the PC where the current 5250 session is being run will be accessed.

Using *CURRENT eliminates the need to know your PC's TCP/IP address.

PC Command to RunThis parameter holds the PC command line to run. Any standard PC command line can be enteredhere along with command line parameters. Long PC file names and directory names are alsosupported.

If you're simply launching a PC document, simply include the path and location to the selected PCdocument.

Run OptionsThis parameter holds the selected PC function to run.

*SHELL - Launch a PC application using a specific command line. The command line must include anexact path to the program being called.

Example Command Line Using OFCRUNPC to Launch Windows NotepadOFCRUNPC RMTSYS(*CURRENT) CMD('C:\WINNT\NOTEPAD.EXE') OPTION(*SHELL)

*SHELLWAIT - Launch a PC application using a specific command line. The command line mustinclude an exact path to the program being called. The AS/400 command will not return until the PC

iSeries Office Integrator51

Copyright © 1992-2002 ... RJS Software Systems Inc.

command completes. This way you can delay AS/400 processing until the selected PC commandcompletes.

Example Command Line Using OFCRUNPC to Launch Windows Notepad and WaitOFCRUNPC RMTSYS(*CURRENT) CMD('C:\WINNT\NOTEPAD.EXE') OPTION(*SHELLWAIT)

*LAUNCH - Launch a selected PC document by passing the document file and path as the commandline. The associated Windows application will be launched based on the document file extension.

Example Command Line Using OFCRUNPC to Launch MS Word documentOFCRUNPC RMTSYS(*CURRENT) CMD('C:\TEST1.DOC') OPTION(*LAUNCH)

*LAUNCHWAIT - Launch a selected PC document by passing the document file and path as thecommand line. The associated Windows application will be launched based on the document fileextension. The AS/400 command will not return until the PC command completes. This way you candelay AS/400 processing until the selected PC command completes.

Example Command Line Using OFCRUNPC to Launch Windows Notepad and WaitOFCRUNPC RMTSYS(*CURRENT) CMD(NOTEPAD.EXE) OPTION(*LAUNCHWAIT)

*LAUNCHEXEC - Launch a selected program, PC document or web link using the WindowsShellExecute command.

Example Command Line Using OFCRUNPC to Launch Windows NotepadOFCRUNPC RMTSYS(*CURRENT) CMD(NOTEPAD.EXE) OPTION(*LAUNCHEXEC)

*CLIPCLEAR - Clear the windows clipboard.

Note: You must always clear the clipboard before calling *CLIPSET or *CLIPAPPEND

Example Command Line Using OFCRUNPC to Clear ClipboardOFCRUNPC RMTSYS(*CURRENT) CMD('') OPTION(*CLIPCLEAR)

*CLIPSET - Set new text data in the clipboard.

Example Command Line Using OFCRUNPC to set clipboard dataOFCRUNPC RMTSYS(*CURRENT) CMD('This is a test') OPTION(*CLIPSET)

*CLIPAPPEND - Append new data to existing clipboard text data.

Example Command Line Using OFCRUNPC to append to clipboard dataOFCRUNPC RMTSYS(*CURRENT) CMD('This is a test') OPTION(*CLIPAPPEND)

*WEBSITE - Same as *LAUNCHEXEC

Example Command Line Using OFCRUNPC to Open Web SiteOFCRUNPC RMTSYS(*CURRENT) CMD('http://www.rjssoft.com') OPTION(*WEBSITE)

*WORD - Launch MS Word.

Example Command Line Using OFCRUNPC to Launch MS WordOFCRUNPC RMTSYS(*CURRENT) OPTION(*WORD)

*EXCEL - Launch MS Excel.

iSeries Office Integrator 52

Copyright © 1992-2002 ... RJS Software Systems Inc.

Example Command Line Using OFCRUNPC to Launch MS ExcelOFCRUNPC RMTSYS(*CURRENT) OPTION(*EXCEL)

*MSGBOX - Display a popup windows message box.

Example Command Line Using OFCRUNPC to Display Windows Message BoxOFCRUNPC RMTSYS(*CURRENT) CMD('Test Message') OPTION(*MSGBOX)

*WORDOLE - Run the selected MS Word OLE Commands.

This option is perfect for running MS Word mail merge functions. Using this option can allow you toeliminate the usage of the Officevision/400 product for word processing by using MS Word instead.

There are two type of MS Word OLE commands that can be called:

1.) Individual document commands - These are word commands that can perform single sequentialoperations on a word document such as creating a new file, opening a file that exists, printing a file,etc.

Available Individual Document MS Word Commands to call

Launch MS Word and connect the iSeries Office Integrator to MS Word via OLEOFCRUNPC CMD('WORDLAUNCH') OPTION(*WORDOLE)

Note: WORDLAUNCH is always the first command that must be called.

Create a new MS Word document with the regular templateOFCRUNPC CMD('WORDFILENEW') OPTION(*WORDOLE)

Create a new MS Word document using a selected templateOFCRUNPC CMD('WORDFILENEW~C:\TEMPLATE1.DOT') OPTION(*WORDOLE)

Create a new MS Word document with the default templateOFCRUNPC CMD('WORDFILENEWDEFAULT') OPTION(*WORDOLE)

Insert text data at up to 7 document bookmark locationsOFCRUNPCCMD('WORDINSERTBOOKMARK~BOOKMARK1~DATA1~BOOKMARK2~DATA2~BOOKMARK3~Sincerely<CRLF>Mr Jones') OPTION(*WORDOLE)Note: If the bookmark data contains the special keyword <CRLF>, MS Word will insert a carriagereturn in the data stream.

Insert text data at current cursor locationOFCRUNPC CMD('WORDINSERTTEXT~This is a test line of data') OPTION(*WORDOLE)Note: If the data contains the special keyword <CRLF>, MS Word will insert a carriage return in thedata stream.

Open an existing MS Word documentOFCRUNPC CMD('WORDFILEOPEN~C:\WORD1.DOC') OPTION(*WORDOLE)

Close current MS Word documentOFCRUNPC CMD('WORDFILECLOSE') OPTION(*WORDOLE)

Print current MS Word documentOFCRUNPC CMD('WORDFILEPRINT') OPTION(*WORDOLE)

iSeries Office Integrator53

Copyright © 1992-2002 ... RJS Software Systems Inc.

Print current MS Word document with document defaultsOFCRUNPC CMD('WORDFILEPRINTDEFAULT') OPTION(*WORDOLE)

Display Print Preview for current MS Word documentOFCRUNPC CMD('WORDFILEPRINTPREVIEW') OPTION(*WORDOLE)

Save a MS Word documentOFCRUNPC CMD('WORDFILESAVE') OPTION(*WORDOLE)

Save a MS Word document with selected nameOFCRUNPC CMD('WORDFILESAVEAS~C:\DOCNAME.DOC') OPTION(*WORDOLE)

Exit the MS Word programOFCRUNPC CMD('WORDFILEEXIT') OPTION(*WORDOLE)

Release the MS Word OLE connectionOFCRUNPC CMD('WORDRELEASE') OPTION(*WORDOLE)

Maximize Word WindowOFCRUNPC CMD('WORDAPPMAX') OPTION(*WORDOLE)

Minimize Word WindowOFCRUNPC CMD('WORDAPPMIN') OPTION(*WORDOLE)

Show MS WordOFCRUNPC CMD('WORDAPPSHOW') OPTION(*WORDOLE)

Hide MS WordOFCRUNPC CMD('WORDAPPHIDE') OPTION(*WORDOLE)

2.) Multiple function document commands - These are word commands that can perform multipleoperations on a word document such as running a mail merge and printing the document all in onestep.

Available Multiple Function MS Word Document Commands to call

Launch MS Word, open selected document, print to selected printer and close wordOFCRUNPC CMD('WORDFILEOPENPRINT~C:\DOC1.DOC~Acrobat PDFWriter')OPTION(*WORDOLE)

Launch MS Word, open selected template, process merge with text file and leave word open so usercan print or save documentOFCRUNPC CMD('MERGELETTER~C:\TEMP\TEMPLATE1.DOT~C:\TEMP\QCUSTCDT.TXT')OPTION(*WORDOLE)

Launch MS Word, open selected template, process merge with text file, save document to newdocument and close word.OFCRUNPCCMD('MERGELETTERSAVE~C:\TEMP\TEMPLATE1.DOT~C:\TEMP\QCUSTCDT.TXT~C:\TEMP\DOC1.DOC') OPTION(*WORDOLE)

Launch MS Word, open selected template, process merge with text file, print document to selectedprinter and close word.OFCRUNPCCMD('MERGELETTERPRINT~C:\TEMP\TEMPLATE1.DOT~C:\TEMP\QCUSTCDT.TXT~Acrobat

iSeries Office Integrator 54

Copyright © 1992-2002 ... RJS Software Systems Inc.

PDFWriter') OPTION(*WORDOLE)

Please contact RJS Software Systems if you have any problems or suggestions for additional Wordor Excel OLE commands.

1.5.9 OFCIP: Retrieve Current Session IP Address

The OFCIP API command returns the TCP/IP address for the current 5250 session. This API is usedanytime an AS/400 application needs to know the IP address of the PC or terminal which is runningthe 5250 session. This API must be called from a CL program.

OFCIP Command Parameters

DeviceThis parameter holds the AS/400 display device name. Use * to retrieve the current 5250 session'sIP address.

IP AddressThis parameter returns a 15 character IP address for the selected device or current 5250 session.

iSeries Office Integrator55

Copyright © 1992-2002 ... RJS Software Systems Inc.

1.6 Problem Handling

1.6.1 Common Errors

If errors occur while running the iSeries Office Integrator API's, always make sure to check theAS/400 job log by using the DSPJOBLOG command from the AS/400 command line. Many times thejob log will give some idea as to what is failing.

You should also use the *DSP option for the FTP Log Option on all FTP commands to troubleshootany issues.

1.6.2 Other Errors

If you cannot resolve the problem you're experiencing by using the previous troubleshooting methods,you should contact RJS Software Systems for advice on solving the problems you're experiencing.