Document Management, EDI Software, MICR Check Printing, ACH Payment Solutions






About the Author:


Shahar Mor

Shahar Mor,
President, Barmor Information Systems

Shahar has worked on the iSeries 400 for 16 years. He started as a system administrator responsible for security, performance, database administration, VoIP, backup and recovery procedures and connectivity issues. He later became a senior programmer in a bank and then head of infrastructure for an insurance company. Shahar now owns Barmor, a consulting firm in Israel, which employs over 20 people that work on projects for the iSeries 400 in the network environment. He also has written a Redbook for IBM on iSeries e-commerce and he is Search400.com site expert for connectivity issues on the iSeries.



EZContentManager

With ACOM's Electronic Document Management Software you can easily create, store, manage, retrieve and distribute your documents and checks via the Web! Additionally, all of your documents can be automatically indexed for easy search and retrieval at any time! Read More...

View Quick Demo of Document Management Solution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EZContentManager

With ACOM's Electronic Document Management Software you can easily create, store, manage, retrieve and distribute your documents and checks via the Web! Additionally, all of your documents can be automatically indexed for easy search and retrieval at any time! Read More...

View Quick Demo of Document Management Solution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EZContentManager

With ACOM's Electronic Document Management Software you can easily create, store, manage, retrieve and distribute your documents and checks via the Web! Additionally, all of your documents can be automatically indexed for easy search and retrieval at any time! Read More...

View Quick Demo of Document Management Solution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EZContentManager

With ACOM's Electronic Document Management Software you can easily create, store, manage, retrieve and distribute your documents and checks via the Web! Additionally, all of your documents can be automatically indexed for easy search and retrieval at any time! Read More...

View Quick Demo of Document Management Solution

PC/Windows connectivity: Top 10 expert Q&As

Article courtesy of Search400.com
By Shahar Mor


Shahar Mor, iSeries/i5 PC/Windows connectivity expert, has been answering Search400.com's member questions for more than five years. iSeries users have asked Shahar the same questions again and again. In an effort to save you time, we've compiled the top 10 questions asked about iSeries/i5 connectivity for you. Do you have a question that's not listed here? Ask Shahar your connectivity questions.


Top Ten Questions

  1. Send a PC command from an iSeries program

  2. Send files to a Windows machine from a CLP program

  3. Automate the process of sending files from a PC to an iSeries

  4. Access data in an external database from an RPG program

  5. Pull an iSeries HTML file from the Web using HTTP

  6. Importing iSeries database files to Excel

  7. Send data from Excel to an iSeries database

  8. Get a lot of files in one FTP script on the iSeries

  9. Call an RPG program from VB using ODBC

  10. Print a PDF file from the iSeries


1. Send a PC command from an iSeries program

Question:
How can I send a PC command from an iSeries program?

Answer:
There are two methods you can use:

  • Use STRPCCMD: This command can send a limited length string to the PC, it requires an emulation (this works from an interactive session only.)
  • Use RUNRMTCMD: This command can be used from batch and interactive programs -- it is not limited in length, however it requires the remote command service from Client Access to run on the PC.



topReturn to Table of Contents




2. Send files to a Windows machine from a CLP program

Question:
How can I send files to a Windows machine from a CLP program?

Answer:
It is possible to use QNTC. QNTC is a file system that allows iSeries programs to write data directly to a shared directory on Windows NT.

You will need the same user and password on the iSeries and the NT; you will need to define the directory required as shared on the NT side. When QNTC is configured correctly, the iSeries command CPY can copy from and to QNTC as if it is local.

topReturn to Table of Contents




3. Automate the process of sending files from a PC to an iSeries

Question:
How can I automate the process of sending files from a PC to an iSeries?

Answer:

Use any PC scheduler to launch script to FTP the required file to the iSeries.
For example:

FTP -s:myscriptfile.txt where myscriptfile.txt contains something like this:

USER as400user
as400password
cd qgpl
ascii
put pcfile as400file

topReturn to Table of Contents




4. Access data in an external database from an RPG program

Question:
Can I access data in an external database from an RPG program?

Answer:

It is possible to access external data from the iSeries using JDBC. If the access has a pure JDBC driver, then you may do the following:

  • Install the driver.
  • Write a small Java program to read the access file.

 

topReturn to Table of Contents




5. Pull an iSeries HTML file from the Web using HTTP

Question:
Can the iSeries pull an HTML file from the Web using HTTP?

Answer:
In order to connect to a Web site from the iSeries via HTTP you can:

  • Write a small socket program that behaves like a browser.
  • Write HTTP client program using Java.
  • Buy an "iSeries HTTP client" such as GETURI from BVSTools (it is considered shareware).
  • Use Curl from a pase environment.

 

topReturn to Table of Contents




6. Importing iSeries database files to Excel

Question:
How can I import iSeries database files to Excel?

Answer:
iSeries Access has an Excel Add-In that provides data transfer support. During iSeries Access installation process, install the following components:

Data Transfer Base Support and Data Transfer Excel Add-In (Under Data Access -- Data Transfer)

 

Once installed, activate the iSeries Access Data Transfer feature add-in:

  1. Open Excel worksheet
  2. Select Add-Ins from the Tools pull-down menu.
  3. Select the iSeries Access Data Transfer feature

 

To set up an SQL statement that returns data to the worksheet:

  1. From the pull-down menu "Data", select "Transfer Data from iSeries"
  2. From Transfer Request dialog window, select "Create New"
  3. Specify the iSeries system name
  4. On next dialog window, specify the library/file name
  5. On next dialog window, press the "Properties" button
  6. Select the "SQL" tab
  7. Select the option "Process Select as native SQL" and Press OK
  8. Press the "Data Options" button
  9. From the "Change SQL Select Options" dialog window, enter your SQL statement and press OK
  10. Press Next
  11. If you want to save this definition so you can run it again later, specify a file name with the .DTF extension
  12. Press Finish

 

The results of your query should be returned to the active worksheet.

Excel also has some data transfer features that allow you access toiSeries data using ODBC drivers to access the system. If you want to play around with those, here's how to get started:

  1. From the pull-down menu "Data",
    select "Import External Data" -> "New Database Query"

 

topReturn to Table of Contents




7. Send data from Excel to an iSeries database

Question:
How can I send data from Excel to an iSeries database?

Answer:

I don't think you'll find any OS/400 feature that makes it substantially easier. To do that, you'd probably need to buy a third-party data movement or replication product.

One approach would be using the CPYFRMIMPF CL command.

  1. Define target table with DDS or SQL.
  2. Export Excel file into delimited format.
  3. FTP delimited format file to your iSeries server.
  4. Use CPYFRMIMPF CL command to load the delimited format file into the target table.

 

topReturn to Table of Contents




8. Get a lot of files in one FTP script on the iSeries

Question:
How can I get a lot of files in one FTP script on the iSeries?

Answer:

MGET can be used in FTP script.

  • It's easy to set the destination library to be different then QGPL'. For example, lcd mylib will direct the files to mylib.
  • If the file names are short enough, the iSeries FTP client will behave the way you want (i.e. new file for every remote file), however, for longer then 10 character file names, this may be an issue.
  • The easiest way to work around this naming restriction is to direct the FTP incoming files to the directory on the IFS.

    For example:
    lcd /tmp
    mget longnamesintheremote server*




topReturn to Table of Contents




9. Call an RPG program from VB using ODBC

Question:
What's the best way to call an RPG program from VB using ODBC?

Answer:
It is possible to call an iSeries program from VB using stored procedure support as follows:

  1. Get mdac up and running -- This is the Microsoft part.
  2. Create the procedure on the iSeries using one of the compilers (i.e. RPG' Cobol' c' pure SQL).
  3. Register the procedure using the create function as follows:

    CREATE PROCEDURE QGPL.myproc
    (parm1 OUT CHAR(10), parm2 OUT CHAR(10))
    (EXTERNAL NAME QGPL.pgmname LANGUAGE CL SIMPLE CALL)

  4. Embed the code for procedure call, this is using the CALL statement in the execute.




topReturn to Table of Contents




10. Print a PDF file from the iSeries


Question:
How can I print a PDF file from the iSeries?

Answer:
You can use FTP to create a spool file with the PDF in it. For example:

  1. crtprtf mylib/myprtf *usrascii
  2. ftp loopback
    user password
    bin
    cd mylib
    put mypdf myprtf
    quit

This creates a new spool file with the PDF file in it.

 

topReturn to Table of Contents

 

# # #

 
Document Management Articles | Document Management System | Document Management Demo | Document Imaging

ACOM Solutions
2850 E. 29th Street · Long Beach, CA 90806-2313
Phone: (562) 424-7899 · Fax: (562) 424-8662
©2008 ACOM Solutions, Inc.